[Lldb-commits] [lldb] r151867 - in /lldb/trunk: include/lldb/Target/Process.h source/API/SBTarget.cpp

Han Ming Ong hanming at apple.com
Thu Mar 1 17:02:04 PST 2012


Author: hanming
Date: Thu Mar  1 19:02:04 2012
New Revision: 151867

URL: http://llvm.org/viewvc/llvm-project?rev=151867&view=rev
Log:
<rdar://problem/10967188>

When using launch_info for launching with a target already set, we should just prepend the target's path as the first argument.

Modified:
    lldb/trunk/include/lldb/Target/Process.h
    lldb/trunk/source/API/SBTarget.cpp

Modified: lldb/trunk/include/lldb/Target/Process.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Process.h?rev=151867&r1=151866&r2=151867&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Process.h (original)
+++ lldb/trunk/include/lldb/Target/Process.h Thu Mar  1 19:02:04 2012
@@ -165,17 +165,14 @@
             m_executable = exe_file;
             if (add_exe_file_as_first_arg)
             {
-                m_arguments.Clear();
                 char filename[PATH_MAX];
                 if (exe_file.GetPath(filename, sizeof(filename)))
-                    m_arguments.AppendArgument (filename);
+                    m_arguments.InsertArgumentAtIndex (0, filename);
             }
         }
         else
         {
             m_executable.Clear();
-            if (add_exe_file_as_first_arg)
-                m_arguments.Clear();
         }
     }
 

Modified: lldb/trunk/source/API/SBTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTarget.cpp?rev=151867&r1=151866&r2=151867&view=diff
==============================================================================
--- lldb/trunk/source/API/SBTarget.cpp (original)
+++ lldb/trunk/source/API/SBTarget.cpp Thu Mar  1 19:02:04 2012
@@ -720,10 +720,9 @@
             sb_process.SetSP (process_sp);
             lldb_private::ProcessLaunchInfo &launch_info = sb_launch_info.ref();
 
-            bool add_exe_as_first_argv = true; //launch_info.GetArguments().GetArgumentCount() == 0;
             Module *exe_module = target_sp->GetExecutableModulePointer();
             if (exe_module)
-                launch_info.SetExecutableFile(exe_module->GetPlatformFileSpec(), add_exe_as_first_argv);
+                launch_info.SetExecutableFile(exe_module->GetPlatformFileSpec(), true);
 
             const ArchSpec &arch_spec = target_sp->GetArchitecture();
             if (arch_spec.IsValid())





More information about the lldb-commits mailing list