@@ -1387,18 +1387,31 @@ static bool ShouldLaunchUsingXPC(ProcessLaunchInfo &launch_info) {
1387
1387
Status Host::ShellExpandArguments (ProcessLaunchInfo &launch_info) {
1388
1388
Status error;
1389
1389
if (launch_info.GetFlags ().Test (eLaunchFlagShellExpandArguments)) {
1390
- FileSpec expand_tool_spec = HostInfo::GetSupportExeDir ();
1391
- if (!expand_tool_spec) {
1392
- error.SetErrorString (
1393
- " could not get support executable directory for lldb-argdumper tool" );
1394
- return error;
1390
+ FileSpec expand_tool_spec;
1391
+ Environment host_env = Host::GetEnvironment ();
1392
+ std::string env_argdumper_path = host_env.lookup (" LLDB_ARGDUMPER_PATH" );
1393
+ if (!env_argdumper_path.empty ()) {
1394
+ expand_tool_spec.SetFile (env_argdumper_path, FileSpec::Style::native);
1395
+ Log *log (GetLog (LLDBLog::Host | LLDBLog::Process));
1396
+ LLDB_LOGF (log,
1397
+ " lldb-argdumper exe path set from environment variable: %s" ,
1398
+ env_argdumper_path.c_str ());
1395
1399
}
1396
- expand_tool_spec.AppendPathComponent (" lldb-argdumper" );
1397
- if (!FileSystem::Instance ().Exists (expand_tool_spec)) {
1398
- error.SetErrorStringWithFormat (
1399
- " could not find the lldb-argdumper tool: %s" ,
1400
- expand_tool_spec.GetPath ().c_str ());
1401
- return error;
1400
+ bool argdumper_exists = FileSystem::Instance ().Exists (env_argdumper_path);
1401
+ if (!argdumper_exists) {
1402
+ expand_tool_spec = HostInfo::GetSupportExeDir ();
1403
+ if (!expand_tool_spec) {
1404
+ error.SetErrorString (" could not get support executable directory for "
1405
+ " lldb-argdumper tool" );
1406
+ return error;
1407
+ }
1408
+ expand_tool_spec.AppendPathComponent (" lldb-argdumper" );
1409
+ if (!FileSystem::Instance ().Exists (expand_tool_spec)) {
1410
+ error.SetErrorStringWithFormat (
1411
+ " could not find the lldb-argdumper tool: %s" ,
1412
+ expand_tool_spec.GetPath ().c_str ());
1413
+ return error;
1414
+ }
1402
1415
}
1403
1416
1404
1417
StreamString expand_tool_spec_stream;
0 commit comments