[Lldb-commits] [lldb] r218424 - Moved PlatformDarwin::GetEnvironment() to PlatformPOSIX to fix Linux/llgs issue.

Todd Fiala todd.fiala at gmail.com
Wed Sep 24 16:10:31 PDT 2014


Author: tfiala
Date: Wed Sep 24 18:10:30 2014
New Revision: 218424

URL: http://llvm.org/viewvc/llvm-project?rev=218424&view=rev
Log:
Moved PlatformDarwin::GetEnvironment() to PlatformPOSIX to fix Linux/llgs issue.

See http://reviews.llvm.org/D5486 for more details.

I was tracking a problem where llgs on linux would not pick up any environment variables. On OSX there is a virtual function PlatformDarwin::GetEnvironment() which correctly sets up the list of environment variables. On linux llgs it defaults to a base class default implementation which clears the list.

I moved the OSX implementation down to PlatformPOSIX. This fixes my problem on linux still works properly on OSX.

Change by Shawn Best.
Slight tweak to convert 'virtual' to 'override' in PlatformDarwin.h virtual method override by Todd.

Tested:
Ubuntu 14.04 x86_64, cmake/ninja build + tests.
MacOSX 10.9.5 x86_64, Xcode 6.1 Beta build + tests.

Modified:
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
    lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h
    lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
    lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.h

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp?rev=218424&r1=218423&r2=218424&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp Wed Sep 24 18:10:30 2014
@@ -1212,17 +1212,6 @@ PlatformDarwin::SetThreadCreationBreakpo
     return bp_sp;
 }
 
-size_t
-PlatformDarwin::GetEnvironment (StringList &env)
-{
-    if (IsRemote())
-    {
-        if (m_remote_platform_sp)
-            return m_remote_platform_sp->GetEnvironment(env);
-        return 0;
-    }
-    return Host::GetEnvironment(env);
-}
 
 int32_t
 PlatformDarwin::GetResumeCountForLaunchInfo (ProcessLaunchInfo &launch_info)

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h?rev=218424&r1=218423&r2=218424&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.h Wed Sep 24 18:10:30 2014
@@ -78,9 +78,6 @@ public:
     virtual bool
     ModuleIsExcludedForNonModuleSpecificSearches (lldb_private::Target &target, const lldb::ModuleSP &module_sp);
     
-    virtual size_t
-    GetEnvironment (lldb_private::StringList &environment);
-
     bool
     ARMGetSupportedArchitectureAtIndex (uint32_t idx, lldb_private::ArchSpec &arch);
     

Modified: lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp?rev=218424&r1=218423&r2=218424&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp Wed Sep 24 18:10:30 2014
@@ -634,6 +634,18 @@ PlatformPOSIX::GetRemoteOSBuildString (s
     return false;
 }
 
+size_t
+PlatformPOSIX::GetEnvironment (StringList &env)
+{
+    if (IsRemote())
+    {
+        if (m_remote_platform_sp)
+            return m_remote_platform_sp->GetEnvironment(env);
+        return 0;
+    }
+    return Host::GetEnvironment(env);
+}
+
 bool
 PlatformPOSIX::GetRemoteOSKernelDescription (std::string &s)
 {

Modified: lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.h?rev=218424&r1=218423&r2=218424&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.h (original)
+++ lldb/trunk/source/Plugins/Platform/POSIX/PlatformPOSIX.h Wed Sep 24 18:10:30 2014
@@ -101,6 +101,9 @@ public:
     lldb_private::ArchSpec
     GetRemoteSystemArchitecture () override;
 
+    size_t
+    GetEnvironment (lldb_private::StringList &environment) override;
+
     bool
     IsConnected () const override;
 





More information about the lldb-commits mailing list