[Lldb-commits] [PATCH] Move the shell expansion code to Host/common

Greg Clayton clayborg at gmail.com
Wed Feb 25 10:22:39 PST 2015


A few changes, see inlined comments.


================
Comment at: include/lldb/Host/Host.h:263
@@ -262,4 +262,3 @@
     //------------------------------------------------------------------
-    static Error
-    ShellExpandArguments (ProcessLaunchInfo &launch_info);
-    
+    static Error ShellExpandArguments(llvm::StringRef input, llvm::StringRef working_dir, std::vector<std::string> &expanded);
+
----------------
Use lldb_private::Args instead of std::vector<std::string>.

================
Comment at: include/lldb/Target/Platform.h:395
@@ -394,4 +394,3 @@
         //------------------------------------------------------------------
-        virtual Error
-        ShellExpandArguments (ProcessLaunchInfo &launch_info);
-        
+        virtual Error ShellExpandArguments(llvm::StringRef original, llvm::StringRef working_dir, std::vector<std::string> &expanded);
+
----------------
Use lldb_private::Args instead of std::vector<std::string>.

================
Comment at: source/Host/common/Host.cpp:529
@@ -526,8 +528,3 @@
 Error
-Host::RunShellCommand (const char *command,
-                       const char *working_dir,
-                       int *status_ptr,
-                       int *signo_ptr,
-                       std::string *command_output_ptr,
-                       uint32_t timeout_sec,
-                       bool run_in_default_shell)
+Host::ShellExpandArguments(llvm::StringRef original, llvm::StringRef working_dir, std::vector<std::string> &expanded)
+{
----------------
Use lldb_private::Args instead of std::vector<std::string>.

================
Comment at: source/Target/Platform.cpp:1119
@@ -1118,2 +1118,3 @@
         {
-            error = ShellExpandArguments(launch_info);
+            std::vector<std::string> expanded_args;
+            std::string original_args;
----------------
Remove this and use launch_info.GetArguments() below, or change to Args type then copy back into launch_info.GetArguments() if all goes well.

================
Comment at: source/Target/Platform.cpp:1122
@@ -1120,1 +1121,3 @@
+            launch_info.GetArguments().GetQuotedCommandString(original_args);
+            error = ShellExpandArguments(original_args.c_str(), launch_info.GetWorkingDirectory(), expanded_args);
             if (error.Fail())
----------------
Pass launch_info.GetArguments() instead of expanded_args, or a temp Args variable.

================
Comment at: source/Target/Platform.cpp:1141
@@ -1134,3 +1140,3 @@
 Error
-Platform::ShellExpandArguments (ProcessLaunchInfo &launch_info)
+Platform::ShellExpandArguments(llvm::StringRef original, llvm::StringRef working_dir, std::vector<std::string> &expanded)
 {
----------------
Change "vector<string" over to Args.

http://reviews.llvm.org/D7805

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the lldb-commits mailing list