[Lldb-commits] [PATCH] Fix race condition with -o "process launch" on linux
labath at google.com
Thu Mar 5 05:03:54 PST 2015
Hi jingham, clayborg, vharron,
starting a debug session on linux with -o "process launch" lldb parameter was failing since
Target::Launch (in sychronous mode) is expecting to be able to receive public process events.
However, PlatformLinux did not set up event hijacking on process launch, which caused these
events to be processed elsewhere and left Target::Launch hanging. This patch enables event
interception in PlatformLinux (which was commented out).
Upon enabling event interception, I noticed an issue, which I traced back to the inconsistent
state of public run lock, which remained false even though public and private process states were
"stopped". I addressed this by making sure the run lock is "stopped" upon exit from
WaitForProcessToStop (which already had similar provisions for other return paths).
@@ -765,7 +765,6 @@
// Adjust launch for a hijacker.
if (!launch_info.GetHijackListener ())
@@ -775,7 +774,6 @@
process_sp->HijackProcessEvents (listener_sp.get ());
// Log file actions.
@@ -801,7 +799,6 @@
const StateType state = process_sp->WaitForProcessToStop (NULL, NULL, false, listener_sp.get());
if (state == eStateStopped)
@@ -1011,6 +1011,10 @@
log->Printf("Process::%s returning without waiting for events; process private and public states are already 'stopped'.",
+ // We need to toggle the run lock as this won't get done in
+ // SetPublicState() if the process is hijacked.
+ if (hijack_listener)
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1470 bytes
Desc: not available
More information about the lldb-commits