Fixed continue issues with process attach/detach

- added code for tracking transition from eStateAttaching to eStateStopped in event listener and handling process continuation there.

Patch by Arthur Evstifeev!

llvm-svn: 182806
This commit is contained in:
Daniel Malea 2013-05-28 21:27:03 +00:00
parent 8a1aa518a3
commit bb43721a35

View File

@ -153,11 +153,7 @@ class LLDBController(object):
return
self.ui.activate()
# attach succeeded, store pid and add some event listeners
self.pid = self.process.GetProcessID()
self.process.GetBroadcaster().AddListener(self.processListener, lldb.SBProcess.eBroadcastBitStateChanged)
self.doContinue()
print "Attached to %s (pid=%d)" % (process_name, self.pid)
@ -352,6 +348,10 @@ class LLDBController(object):
self.processListener.GetNextEvent(event)
new_state = lldb.SBProcess.GetStateFromEvent(event)
# continue if stopped after attaching
if old_state == lldb.eStateAttaching and new_state == lldb.eStateStopped:
self.process.Continue()
# If needed, perform any event-specific behaviour here
num_events_handled += 1