[Lldb-commits] [PATCH] Extend SBPlatform with capability to launch/terminate a process remotely. Integrate this change into test framework in order to spawn processes on a remote target.

Oleksiy Vyalov ovyalov at google.com
Thu Jan 29 17:51:57 PST 2015

Comment at: test/functionalities/process_attach/TestProcessAttach.py:59
@@ -57,1 +58,3 @@
+        else:
+            self.runCmd("process attach -p " + str(popen.pid))
vharron wrote:
> Hi Greg,
> In lldb, when I create a target, it is created in the context of the selected platform.  Currently, when I launch a process, it is launched in the context of the selected target.
> I would prefer 'process attach' to be done in the context of the currently selected platform.  That way, whether you don't need to remember attaching to  local/remote processes.
It makes sense since "process launch " allows to launch remote process in case of connected platform.
I hacked a quick change for CommandObjectProcess to make it use platform:

               if (platform_sp->CanDebugProcess())
                    process_sp = platform_sp->Attach(m_options.attach_info, m_interpreter.GetDebugger(), nullptr, error); // PlatformRemoteGDBServer needs to call HijackProcessEvents on process.
                    const char *plugin_name = m_options.attach_info.GetProcessPluginName();
                    process_sp = target->CreateProcess (m_interpreter.GetDebugger().GetListener(), plugin_name, NULL);
                    if (process_sp)
                        error = process_sp->Attach (m_options.attach_info);

It's working remotely but crashing locally for me.
So, I can revert TestProcessAttach.py in this CL and then follow-up with CL for CommandObjectProcess.



More information about the lldb-commits mailing list