From: Enrico Granata Date: Fri, 20 Feb 2015 22:20:30 +0000 (+0000) Subject: Rename the "glob arguments" feature to "shell expand arguments" X-Git-Tag: llvmorg-3.7.0-rc1~11295 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b38ef8c2b60d9bd4ea4ab2d603f401ee080a0163;p=platform%2Fupstream%2Fllvm.git Rename the "glob arguments" feature to "shell expand arguments" This should not bring any feature change, except changing names of things here and there llvm-svn: 230077 --- diff --git a/lldb/include/lldb/API/SBLaunchInfo.h b/lldb/include/lldb/API/SBLaunchInfo.h index f1b2951..68c0f38 100644 --- a/lldb/include/lldb/API/SBLaunchInfo.h +++ b/lldb/include/lldb/API/SBLaunchInfo.h @@ -142,10 +142,10 @@ public: SetShell (const char * path); bool - GetGlobArguments (); + GetShellExpandArguments (); void - SetGlobArguments (bool glob); + SetShellExpandArguments (bool glob); uint32_t GetResumeCount (); diff --git a/lldb/include/lldb/Host/Host.h b/lldb/include/lldb/Host/Host.h index b4b248c..6a0a60c 100644 --- a/lldb/include/lldb/Host/Host.h +++ b/lldb/include/lldb/Host/Host.h @@ -254,14 +254,14 @@ public: LaunchProcess (ProcessLaunchInfo &launch_info); //------------------------------------------------------------------ - /// Perform globbing of the command-line for this launch info + /// Perform expansion of the command-line for this launch info /// This can potentially involve wildcard expansion // environment variable replacement, and whatever other // argument magic the platform defines as part of its typical // user experience //------------------------------------------------------------------ static Error - GlobArguments (ProcessLaunchInfo &launch_info); + ShellExpandArguments (ProcessLaunchInfo &launch_info); static Error RunShellCommand (const char *command, // Shouldn't be NULL diff --git a/lldb/include/lldb/Target/Platform.h b/lldb/include/lldb/Target/Platform.h index 6c01709..77c7dea 100644 --- a/lldb/include/lldb/Target/Platform.h +++ b/lldb/include/lldb/Target/Platform.h @@ -386,14 +386,14 @@ namespace lldb_private { LaunchProcess (ProcessLaunchInfo &launch_info); //------------------------------------------------------------------ - /// Perform globbing of the command-line for this launch info + /// Perform expansion of the command-line for this launch info /// This can potentially involve wildcard expansion // environment variable replacement, and whatever other // argument magic the platform defines as part of its typical // user experience //------------------------------------------------------------------ virtual Error - GlobArguments (ProcessLaunchInfo &launch_info); + ShellExpandArguments (ProcessLaunchInfo &launch_info); //------------------------------------------------------------------ /// Kill process on a platform. diff --git a/lldb/include/lldb/Target/ProcessLaunchInfo.h b/lldb/include/lldb/Target/ProcessLaunchInfo.h index 9e1918d..a18bac1 100644 --- a/lldb/include/lldb/Target/ProcessLaunchInfo.h +++ b/lldb/include/lldb/Target/ProcessLaunchInfo.h @@ -134,13 +134,13 @@ namespace lldb_private SetLaunchInSeparateProcessGroup (bool separate); bool - GetGlobArguments () const + GetShellExpandArguments () const { - return m_flags.Test(lldb::eLaunchFlagGlobArguments); + return m_flags.Test(lldb::eLaunchFlagShellExpandArguments); } void - SetGlobArguments (bool glob); + SetShellExpandArguments (bool expand); void Clear (); diff --git a/lldb/include/lldb/lldb-enumerations.h b/lldb/include/lldb/lldb-enumerations.h index 1c04f37..7b5ea70 100644 --- a/lldb/include/lldb/lldb-enumerations.h +++ b/lldb/include/lldb/lldb-enumerations.h @@ -51,7 +51,7 @@ namespace lldb { ///< set this flag so lldb & the handee don't race to set its exit status. eLaunchFlagDetachOnError = (1u << 9), ///< If set, then the client stub should detach rather than killing the debugee ///< if it loses connection with lldb. - eLaunchFlagGlobArguments = (1u << 10), ///< Glob arguments without going through a shell + eLaunchFlagShellExpandArguments = (1u << 10), ///< Perform shell-style argument expansion eLaunchFlagCloseTTYOnExit = (1u << 11), ///< Close the open TTY on exit } LaunchFlags; diff --git a/lldb/scripts/Python/interface/SBLaunchInfo.i b/lldb/scripts/Python/interface/SBLaunchInfo.i index a117f81..24f3f85 100644 --- a/lldb/scripts/Python/interface/SBLaunchInfo.i +++ b/lldb/scripts/Python/interface/SBLaunchInfo.i @@ -93,10 +93,10 @@ public: SetShell (const char * path); bool - GetGlobArguments (); + GetShellExpandArguments (); void - SetGlobArguments (bool glob); + SetShellExpandArguments (bool expand); uint32_t GetResumeCount (); diff --git a/lldb/source/API/SBLaunchInfo.cpp b/lldb/source/API/SBLaunchInfo.cpp index 681f5fe..82289ba 100644 --- a/lldb/source/API/SBLaunchInfo.cpp +++ b/lldb/source/API/SBLaunchInfo.cpp @@ -224,15 +224,15 @@ SBLaunchInfo::SetShell (const char * path) } bool -SBLaunchInfo::GetGlobArguments () +SBLaunchInfo::GetShellExpandArguments () { - return m_opaque_sp->GetGlobArguments(); + return m_opaque_sp->GetShellExpandArguments(); } void -SBLaunchInfo::SetGlobArguments (bool glob) +SBLaunchInfo::SetShellExpandArguments (bool expand) { - m_opaque_sp->SetGlobArguments(glob); + m_opaque_sp->SetShellExpandArguments(expand); } uint32_t diff --git a/lldb/source/Host/freebsd/Host.cpp b/lldb/source/Host/freebsd/Host.cpp index 56e0684..e2bc1dc 100644 --- a/lldb/source/Host/freebsd/Host.cpp +++ b/lldb/source/Host/freebsd/Host.cpp @@ -313,7 +313,7 @@ Host::GetUnixSignals () } Error -Host::GlobArguments (ProcessLaunchInfo &launch_info) +Host::ShellExpandArguments (ProcessLaunchInfo &launch_info) { return Error("unimplemented"); } diff --git a/lldb/source/Host/linux/Host.cpp b/lldb/source/Host/linux/Host.cpp index 90898c7..edad8f7 100644 --- a/lldb/source/Host/linux/Host.cpp +++ b/lldb/source/Host/linux/Host.cpp @@ -418,7 +418,7 @@ Host::GetUnixSignals () } Error -Host::GlobArguments (ProcessLaunchInfo &launch_info) +Host::ShellExpandArguments (ProcessLaunchInfo &launch_info) { return Error("unimplemented"); } diff --git a/lldb/source/Host/macosx/Host.mm b/lldb/source/Host/macosx/Host.mm index 1e7c0de7..512d324 100644 --- a/lldb/source/Host/macosx/Host.mm +++ b/lldb/source/Host/macosx/Host.mm @@ -1353,19 +1353,19 @@ Host::LaunchProcess (ProcessLaunchInfo &launch_info) } Error -Host::GlobArguments (ProcessLaunchInfo &launch_info) +Host::ShellExpandArguments (ProcessLaunchInfo &launch_info) { Error error; - if (launch_info.GetFlags().Test(eLaunchFlagGlobArguments)) + if (launch_info.GetFlags().Test(eLaunchFlagShellExpandArguments)) { - FileSpec glob_tool_spec; - if (!HostInfo::GetLLDBPath(lldb::ePathTypeSupportExecutableDir, glob_tool_spec)) + FileSpec expand_tool_spec; + if (!HostInfo::GetLLDBPath(lldb::ePathTypeSupportExecutableDir, expand_tool_spec)) { error.SetErrorString("could not find argdumper tool"); return error; } - glob_tool_spec.AppendPathComponent("argdumper"); - if (!glob_tool_spec.Exists()) + expand_tool_spec.AppendPathComponent("argdumper"); + if (!expand_tool_spec.Exists()) { error.SetErrorString("could not find argdumper tool"); return error; @@ -1373,15 +1373,15 @@ Host::GlobArguments (ProcessLaunchInfo &launch_info) std::string quoted_cmd_string; launch_info.GetArguments().GetQuotedCommandString(quoted_cmd_string); - StreamString glob_command; + StreamString expand_command; - glob_command.Printf("%s %s", - glob_tool_spec.GetPath().c_str(), - quoted_cmd_string.c_str()); + expand_command.Printf("%s %s", + expand_tool_spec.GetPath().c_str(), + quoted_cmd_string.c_str()); int status; std::string output; - RunShellCommand(glob_command.GetData(), launch_info.GetWorkingDirectory(), &status, nullptr, &output, 10); + RunShellCommand(expand_command.GetData(), launch_info.GetWorkingDirectory(), &status, nullptr, &output, 10); if (status != 0) { @@ -1409,7 +1409,7 @@ Host::GlobArguments (ProcessLaunchInfo &launch_info) error.SetErrorString("invalid JSON"); return error; } - + auto args_array_sp = args_sp->GetAsArray(); if (!args_array_sp) { diff --git a/lldb/source/Host/windows/Host.cpp b/lldb/source/Host/windows/Host.cpp index afd3e42..052e6aa 100644 --- a/lldb/source/Host/windows/Host.cpp +++ b/lldb/source/Host/windows/Host.cpp @@ -220,19 +220,19 @@ Host::StartMonitoringChildProcess(Host::MonitorChildProcessCallback callback, vo } Error -Host::GlobArguments (ProcessLaunchInfo &launch_info) +Host::ShellExpandArguments (ProcessLaunchInfo &launch_info) { Error error; - if (launch_info.GetFlags().Test(eLaunchFlagGlobArguments)) + if (launch_info.GetFlags().Test(eLaunchFlagShellExpandArguments)) { - FileSpec glob_tool_spec; - if (!HostInfo::GetLLDBPath(lldb::ePathTypeSupportExecutableDir, glob_tool_spec)) + FileSpec expand_tool_spec; + if (!HostInfo::GetLLDBPath(lldb::ePathTypeSupportExecutableDir, expand_tool_spec)) { error.SetErrorString("could not find argdumper tool"); return error; } - glob_tool_spec.AppendPathComponent("argdumper.exe"); - if (!glob_tool_spec.Exists()) + expand_tool_spec.AppendPathComponent("argdumper.exe"); + if (!expand_tool_spec.Exists()) { error.SetErrorString("could not find argdumper tool"); return error; @@ -241,15 +241,15 @@ Host::GlobArguments (ProcessLaunchInfo &launch_info) std::string quoted_cmd_string; launch_info.GetArguments().GetQuotedCommandString(quoted_cmd_string); std::replace(quoted_cmd_string.begin(), quoted_cmd_string.end(), '\\', '/'); - StreamString glob_command; + StreamString expand_command; - glob_command.Printf("%s %s", - glob_tool_spec.GetPath().c_str(), - quoted_cmd_string.c_str()); + expand_command.Printf("%s %s", + expand_tool_spec.GetPath().c_str(), + quoted_cmd_string.c_str()); int status; std::string output; - RunShellCommand(glob_command.GetData(), launch_info.GetWorkingDirectory(), &status, nullptr, &output, 10); + RunShellCommand(expand_command.GetData(), launch_info.GetWorkingDirectory(), &status, nullptr, &output, 10); if (status != 0) { diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp index 669799f..03a5edf 100644 --- a/lldb/source/Target/Platform.cpp +++ b/lldb/source/Target/Platform.cpp @@ -1114,9 +1114,9 @@ Platform::LaunchProcess (ProcessLaunchInfo &launch_info) num_resumes)) return error; } - else if (launch_info.GetFlags().Test(eLaunchFlagGlobArguments)) + else if (launch_info.GetFlags().Test(eLaunchFlagShellExpandArguments)) { - error = GlobArguments(launch_info); + error = ShellExpandArguments(launch_info); if (error.Fail()) return error; } @@ -1132,11 +1132,11 @@ Platform::LaunchProcess (ProcessLaunchInfo &launch_info) } Error -Platform::GlobArguments (ProcessLaunchInfo &launch_info) +Platform::ShellExpandArguments (ProcessLaunchInfo &launch_info) { if (IsHost()) - return Host::GlobArguments(launch_info); - return Error("base lldb_private::Platform class can't glob arguments"); + return Host::ShellExpandArguments(launch_info); + return Error("base lldb_private::Platform class can't expand arguments"); } Error diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index a85613d..30f310a 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -491,14 +491,14 @@ ProcessLaunchCommandOptions::SetOptionValue (uint32_t option_idx, const char *op break; } - case 'G': // Glob args. + case 'X': // shell expand args. { bool success; - const bool glob_args = Args::StringToBoolean (option_arg, true, &success); + const bool expand_args = Args::StringToBoolean (option_arg, true, &success); if (success) - launch_info.SetGlobArguments(glob_args); + launch_info.SetShellExpandArguments(expand_args); else - error.SetErrorStringWithFormat ("Invalid boolean value for glob-args option: '%s'", option_arg ? option_arg : ""); + error.SetErrorStringWithFormat ("Invalid boolean value for shell-expand-args option: '%s'", option_arg ? option_arg : ""); break; } @@ -538,7 +538,7 @@ ProcessLaunchCommandOptions::g_option_table[] = { LLDB_OPT_SET_2 , false, "tty", 't', OptionParser::eNoArgument, NULL, NULL, 0, eArgTypeNone, "Start the process in a terminal (not supported on all platforms)."}, { LLDB_OPT_SET_3 , false, "no-stdio", 'n', OptionParser::eNoArgument, NULL, NULL, 0, eArgTypeNone, "Do not set up for terminal I/O to go to running process."}, -{ LLDB_OPT_SET_4, false, "glob-args", 'G', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeBoolean, "Set whether to glob arguments to the process when launching."}, +{ LLDB_OPT_SET_4, false, "shell-expand-args", 'X', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeBoolean, "Set whether to shell expand arguments to the process when launching."}, { 0 , false, NULL, 0, 0, NULL, NULL, 0, eArgTypeNone, NULL } }; diff --git a/lldb/source/Target/ProcessLaunchInfo.cpp b/lldb/source/Target/ProcessLaunchInfo.cpp index 4360caf..d2e4feb 100644 --- a/lldb/source/Target/ProcessLaunchInfo.cpp +++ b/lldb/source/Target/ProcessLaunchInfo.cpp @@ -211,12 +211,12 @@ ProcessLaunchInfo::SetLaunchInSeparateProcessGroup (bool separate) } void -ProcessLaunchInfo::SetGlobArguments (bool glob) +ProcessLaunchInfo::SetShellExpandArguments (bool expand) { - if (glob) - m_flags.Set(lldb::eLaunchFlagGlobArguments); + if (expand) + m_flags.Set(lldb::eLaunchFlagShellExpandArguments); else - m_flags.Clear(lldb::eLaunchFlagGlobArguments); + m_flags.Clear(lldb::eLaunchFlagShellExpandArguments); } void diff --git a/lldb/test/functionalities/launch_with_glob/Makefile b/lldb/test/functionalities/launch_with_shellexpand/Makefile similarity index 100% rename from lldb/test/functionalities/launch_with_glob/Makefile rename to lldb/test/functionalities/launch_with_shellexpand/Makefile diff --git a/lldb/test/functionalities/launch_with_glob/TestLaunchWithGlob.py b/lldb/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py similarity index 93% rename from lldb/test/functionalities/launch_with_glob/TestLaunchWithGlob.py rename to lldb/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py index 314dc4f..a0bbdbd 100644 --- a/lldb/test/functionalities/launch_with_glob/TestLaunchWithGlob.py +++ b/lldb/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py @@ -9,7 +9,7 @@ import unittest2 from lldbtest import * import lldbutil -class LaunchWithGlobTestCase(TestBase): +class LaunchWithShellExpandTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @@ -21,7 +21,7 @@ class LaunchWithGlobTestCase(TestBase): self.do_test () - @expectedFailureFreeBSD("llvm.org/pr22627 process launch w/ glob not working") + @expectedFailureFreeBSD("llvm.org/pr22627 process launch w/ shell expansion not working") @dwarf_test def test_with_dwarf (self): self.buildDwarf() @@ -39,7 +39,7 @@ class LaunchWithGlobTestCase(TestBase): breakpoint = target.BreakpointCreateBySourceRegex ('break here', lldb.SBFileSpec ("main.cpp", False)) self.assertTrue(breakpoint, VALID_BREAKPOINT) - self.runCmd("process launch -G true -w %s -- fi*.tx?" % (os.getcwd())) + self.runCmd("process launch -X true -w %s -- fi*.tx?" % (os.getcwd())) process = self.process() diff --git a/lldb/test/functionalities/launch_with_glob/file1.txt b/lldb/test/functionalities/launch_with_shellexpand/file1.txt similarity index 100% rename from lldb/test/functionalities/launch_with_glob/file1.txt rename to lldb/test/functionalities/launch_with_shellexpand/file1.txt diff --git a/lldb/test/functionalities/launch_with_glob/file2.txt b/lldb/test/functionalities/launch_with_shellexpand/file2.txt similarity index 100% rename from lldb/test/functionalities/launch_with_glob/file2.txt rename to lldb/test/functionalities/launch_with_shellexpand/file2.txt diff --git a/lldb/test/functionalities/launch_with_glob/file3.txt b/lldb/test/functionalities/launch_with_shellexpand/file3.txt similarity index 100% rename from lldb/test/functionalities/launch_with_glob/file3.txt rename to lldb/test/functionalities/launch_with_shellexpand/file3.txt diff --git a/lldb/test/functionalities/launch_with_glob/file4.txy b/lldb/test/functionalities/launch_with_shellexpand/file4.txy similarity index 100% rename from lldb/test/functionalities/launch_with_glob/file4.txy rename to lldb/test/functionalities/launch_with_shellexpand/file4.txy diff --git a/lldb/test/functionalities/launch_with_glob/file5.tyx b/lldb/test/functionalities/launch_with_shellexpand/file5.tyx similarity index 100% rename from lldb/test/functionalities/launch_with_glob/file5.tyx rename to lldb/test/functionalities/launch_with_shellexpand/file5.tyx diff --git a/lldb/test/functionalities/launch_with_glob/main.cpp b/lldb/test/functionalities/launch_with_shellexpand/main.cpp similarity index 100% rename from lldb/test/functionalities/launch_with_glob/main.cpp rename to lldb/test/functionalities/launch_with_shellexpand/main.cpp