Fix breakpoint setting in gdb remote test cases on arm
authorTamas Berghammer <tberghammer@google.com>
Thu, 28 May 2015 10:55:01 +0000 (10:55 +0000)
committerTamas Berghammer <tberghammer@google.com>
Thu, 28 May 2015 10:55:01 +0000 (10:55 +0000)
llvm-svn: 238411

lldb/test/tools/lldb-server/TestLldbGdbServer.py
lldb/test/tools/lldb-server/gdbremote_testcase.py

index 1b36fdb..5efb225 100644 (file)
@@ -1204,8 +1204,11 @@ class LldbGdbServerTestCase(gdbremote_testcase.GdbRemoteTestCaseBase):
         function_address = int(context.get("function_address"), 16)
 
         # Set the breakpoint.
-        # Note this might need to be switched per platform (ARM, mips, etc.).
-        BREAKPOINT_KIND = 1
+        if self.getArchitecture() == "arm":
+            # TODO: Handle case when setting breakpoint in thumb code
+            BREAKPOINT_KIND = 4
+        else:
+            BREAKPOINT_KIND = 1
         self.reset_test_sequence()
         self.add_set_breakpoint_packets(function_address, do_continue=True, breakpoint_kind=BREAKPOINT_KIND)
 
index b3ac63b..773dded 100644 (file)
@@ -1218,8 +1218,11 @@ class GdbRemoteTestCaseBase(TestBase):
         g_c2_address = int(context.get("g_c2_address"), 16)
 
         # Set a breakpoint at the given address.
-        # Note this might need to be switched per platform (ARM, mips, etc.).
-        BREAKPOINT_KIND = 1
+        if self.getArchitecture() == "arm":
+            # TODO: Handle case when setting breakpoint in thumb code
+            BREAKPOINT_KIND = 4
+        else:
+            BREAKPOINT_KIND = 1
         self.reset_test_sequence()
         self.add_set_breakpoint_packets(function_address, do_continue=True, breakpoint_kind=BREAKPOINT_KIND)
         context = self.expect_gdbremote_sequence()