[lldb-dev] Platform::DebugProcess vs Target::CreateProcess + Process->Launch

Jean-Daniel Dupas devlists at shadowlab.org
Mon Dec 9 10:41:24 PST 2013


Hello,

While working on a Mach native process, I saw there is actually two code paths to launch a process in the debugger.

One that query the platform using CanDebugProcess() and then call Platform::DebugProcess, which end up doing:
- Launch Process.
- Ask target to Create a Process instance.
- Use the process instance to Attach to the freshly launched process.

and a second code path that:
- Ask the target to create a process instance.
- Use the process instance to Launch the process to debug.

Why do we need two code paths to do basically the same thing, especially as all processes, included the GDBRemote one supports Launch, but no platform but the Darwin one supports the first code path.

Wouldn't it be simpler to just let the process take care of the Launch part in all cases ? 

-- Jean-Daniel








More information about the lldb-dev mailing list