delay during continue after attach on Mac OS X

Hi Arthur,

I'm afraid I haven't run into the problem you describe specifically. Might
it be similar to this open (Linux) bug though?

Also, I'm copying lldb-dev list with your question; maybe someone there
has more experience on Mac OS X..


One issue we have to watch out for is that the process has the notion of a public state (stopped/running/exited). The process state doesn't update until your consume the process events that say "process has stopped". So if you do code like:

pid_t pid = 123;
SBAttachInfo attach_info(pid);
SBError error;
SBProcess process = target.Attach (attach_info, error);

even in the process is stopped, internally, the public facade of "SBProcess" won't update its state until you consume the process event that says the process is stopped.

There are two ways to fix this:
1 - Make sure to consume the process events so the public process state gets updated.
2 - Set the async debugging to false to enable synchronous debugging and the events will be consumed for you.

If you are telling LLDB to continue after attaching and the public state is still "eStateAttaching", the continue will just get ignored.

Greg Clayton

Hi Greg,

Thanks for the clarification about async events, it works for me now.