[Lldb-commits] [lldb] 9326633 - [lldb] Remove PATH workaround for Android (#124682)

via lldb-commits lldb-commits at lists.llvm.org
Wed Jan 29 00:21:49 PST 2025


Author: Brad Smith
Date: 2025-01-29T03:21:45-05:00
New Revision: 9326633abd0e59fc77072488ee8cded4fe83c8a1

URL: https://github.com/llvm/llvm-project/commit/9326633abd0e59fc77072488ee8cded4fe83c8a1
DIFF: https://github.com/llvm/llvm-project/commit/9326633abd0e59fc77072488ee8cded4fe83c8a1.diff

LOG: [lldb] Remove PATH workaround for Android (#124682)

Added: 
    

Modified: 
    lldb/source/Host/posix/ProcessLauncherPosixFork.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Host/posix/ProcessLauncherPosixFork.cpp b/lldb/source/Host/posix/ProcessLauncherPosixFork.cpp
index 7d856954684c49..3e956290c3055a 100644
--- a/lldb/source/Host/posix/ProcessLauncherPosixFork.cpp
+++ b/lldb/source/Host/posix/ProcessLauncherPosixFork.cpp
@@ -230,16 +230,6 @@ MakeForkActions(const ProcessLaunchInfo &info) {
   return result;
 }
 
-static Environment::Envp FixupEnvironment(Environment env) {
-#ifdef __ANDROID__
-  // If there is no PATH variable specified inside the environment then set the
-  // path to /system/bin. It is required because the default path used by
-  // execve() is wrong on android.
-  env.try_emplace("PATH", "/system/bin");
-#endif
-  return env.getEnvp();
-}
-
 ForkLaunchInfo::ForkLaunchInfo(const ProcessLaunchInfo &info)
     : separate_process_group(
           info.GetFlags().Test(eLaunchFlagLaunchInSeparateProcessGroup)),
@@ -247,8 +237,7 @@ ForkLaunchInfo::ForkLaunchInfo(const ProcessLaunchInfo &info)
       disable_aslr(info.GetFlags().Test(eLaunchFlagDisableASLR)),
       wd(info.GetWorkingDirectory().GetPath()),
       argv(info.GetArguments().GetConstArgumentVector()),
-      envp(FixupEnvironment(info.GetEnvironment())),
-      actions(MakeForkActions(info)) {}
+      envp(info.GetEnvironment().getEnvp()), actions(MakeForkActions(info)) {}
 
 HostProcess
 ProcessLauncherPosixFork::LaunchProcess(const ProcessLaunchInfo &launch_info,


        


More information about the lldb-commits mailing list