[Lldb-commits] [PATCH] Linux - debugging of local processes via lldb-gdbserver

Vince Harron vharron at google.com
Wed Feb 11 13:01:35 PST 2015


Hi ovyalov, clayborg,

Instead of lldb calling the ptrace APIs directly, it launches an llgs
instance and communicates with it via the remote debug protocol.

This has two advantages.

1) There is more code shared between the remote debugging code path
and the local debugging code path.  If a feature works in remote, it
probably works locally and vice-versa.

2) It makes us more architecturally similar to OSX (which also does
local debugging via a connection to debugserver).

This path is called LLGS local.  We think that this configuration is
now at parity with (or better than) local linux debugging.

It is currently invoked if you have an environment variable defined
"PLATFORM_LINUX_FORCE_LLGS_LOCAL"

We would like to switch to LLGS local as the default path and only
use the non-LLGS path if someone has an environment variable defined
"PLATFORM_LINUX_DISABLE_LLGS_LOCAL"

Later, if all goes well, we would like to remove non-LLGS local
debugging support to simplify the codebase and avoid confusion.

http://reviews.llvm.org/D7567

Files:
  source/Plugins/Platform/Linux/PlatformLinux.cpp
  test/lldbtest.py

Index: source/Plugins/Platform/Linux/PlatformLinux.cpp
===================================================================
--- source/Plugins/Platform/Linux/PlatformLinux.cpp
+++ source/Plugins/Platform/Linux/PlatformLinux.cpp
@@ -64,13 +64,13 @@
         static PropertyDefinition
         g_properties[] =
         {
-            { "use-llgs-for-local" , OptionValue::eTypeBoolean, true, false, NULL, NULL, "Control whether the platform uses llgs for local debug sessions." },
+            { "use-llgs-for-local" , OptionValue::eTypeBoolean, true, true, NULL, NULL, "Control whether the platform uses llgs for local debug sessions." },
             {  NULL        , OptionValue::eTypeInvalid, false, 0  , NULL, NULL, NULL  }
         };
 
-        // Allow environment variable to force using llgs-local.
-        if (getenv("PLATFORM_LINUX_FORCE_LLGS_LOCAL"))
-            g_properties[ePropertyUseLlgsForLocal].default_uint_value = true;
+        // Allow environment variable to disable llgs-local.
+        if (getenv("PLATFORM_LINUX_DISABLE_LLGS_LOCAL"))
+            g_properties[ePropertyUseLlgsForLocal].default_uint_value = false;
 
         return g_properties;
     }
Index: test/lldbtest.py
===================================================================
--- test/lldbtest.py
+++ test/lldbtest.py
@@ -595,7 +595,7 @@
 
 def expectedFailureLLGS(bugnumber=None, compilers=None):
     def fn(self):
-        return 'PLATFORM_LINUX_FORCE_LLGS_LOCAL' in os.environ and self.expectedCompiler(compilers)
+        return 'PLATFORM_LINUX_DISABLE_LLGS_LOCAL' not in os.environ and self.expectedCompiler(compilers)
     if bugnumber: return expectedFailure(fn, bugnumber)
 
 def skipIfRemote(func):

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7567.19778.patch
Type: text/x-patch
Size: 1706 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150211/a353eb76/attachment.bin>


More information about the lldb-commits mailing list