[PATCH] D43768: [LLDB][PPC64] Fix single step and LldbGdbServer tests

Pavel Labath via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 8 07:43:46 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL327013: [LLDB][PPC64] Fix single step and LldbGdbServer tests (authored by labath, committed by ).
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

https://reviews.llvm.org/D43768

Files:
  lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
  lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
  lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/main.cpp


Index: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
===================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
@@ -331,7 +331,7 @@
         self.assertTrue('pc' in generic_regs)
 
         # Ensure we have a frame pointer register. PPC64le's FP is the same as SP
-        if(self.getArchitecture() != 'powerpc64le'):
+        if self.getArchitecture() != 'powerpc64le':
             self.assertTrue('fp' in generic_regs)
 
         # Ensure we have a stack pointer register.
Index: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/main.cpp
===================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/main.cpp
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/main.cpp
@@ -303,18 +303,22 @@
       printf("code address: %p\n", func_p);
       pthread_mutex_unlock(&g_print_mutex);
     } else if (std::strstr(argv[i], CALL_FUNCTION_PREFIX)) {
+      void (*func_p)() = nullptr;
+
       // Defaut to providing the address of main.
       if (std::strcmp(argv[i] + strlen(CALL_FUNCTION_PREFIX), "hello") == 0)
-        hello();
+        func_p = hello;
       else if (std::strcmp(argv[i] + strlen(CALL_FUNCTION_PREFIX),
                            "swap_chars") == 0)
-        swap_chars();
+        func_p = swap_chars;
       else {
         pthread_mutex_lock(&g_print_mutex);
         printf("unknown function: %s\n",
                argv[i] + strlen(CALL_FUNCTION_PREFIX));
         pthread_mutex_unlock(&g_print_mutex);
       }
+      if (func_p)
+        func_p();
     } else if (std::strstr(argv[i], THREAD_PREFIX)) {
       // Check if we're creating a new thread.
       if (std::strstr(argv[i] + strlen(THREAD_PREFIX), THREAD_COMMAND_NEW)) {
Index: lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
===================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
+++ lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
@@ -1008,9 +1008,10 @@
                     reg_info["name"] in PREFERRED_REGISTER_NAMES):
                 # We found a preferred register.  Use it.
                 return reg_info["lldb_register_index"]
-            if ("generic" in reg_info) and (reg_info["generic"] == "fp"):
-                # A frame pointer register will do as a register to modify
-                # temporarily.
+            if ("generic" in reg_info) and (reg_info["generic"] == "fp" or
+                    reg_info["generic"] == "arg1"):
+                # A frame pointer or first arg register will do as a
+                # register to modify temporarily.
                 alternative_register_index = reg_info["lldb_register_index"]
 
         # We didn't find a preferred register.  Return whatever alternative register


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43768.137572.patch
Type: text/x-patch
Size: 3100 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180308/dcc1b9f3/attachment.bin>


More information about the llvm-commits mailing list