Commit 012924ec authored by hjk's avatar hjk

Debugger: Fix behavior on pressing 'Stop' for LLDB

Task-number: QTCREATORBUG-9634
Change-Id: Iaa8eaf53169d7105e5f0657a06f5c9a780ba996d
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
parent a80bb593
...@@ -567,6 +567,7 @@ class Dumper: ...@@ -567,6 +567,7 @@ class Dumper:
self.charPtrType_ = None self.charPtrType_ = None
self.voidType_ = None self.voidType_ = None
self.isShuttingDown_ = False self.isShuttingDown_ = False
self.isInterrupting_ = False
self.dummyValue = None self.dummyValue = None
def extractTemplateArgument(self, typename, index): def extractTemplateArgument(self, typename, index):
...@@ -1082,6 +1083,7 @@ class Dumper: ...@@ -1082,6 +1083,7 @@ class Dumper:
if self.dummyValue is None: if self.dummyValue is None:
self.dummyValue = value self.dummyValue = value
with SubItem(self, value): with SubItem(self, value):
if value.IsValid():
self.put('iname="%s",' % self.currentIName) self.put('iname="%s",' % self.currentIName)
self.putItem(value) self.putItem(value)
...@@ -1144,13 +1146,9 @@ class Dumper: ...@@ -1144,13 +1146,9 @@ class Dumper:
if self.process is None: if self.process is None:
self.report('msg="No process"') self.report('msg="No process"')
return return
self.isInterrupting_ = True
error = self.process.Stop() error = self.process.Stop()
self.reportError(error) self.reportError(error)
self.consumeEvents()
if error.GetType() == 1:
state = self.process.GetState()
if state != lldb.eStateStopped:
self.report('state="inferiorstopfailed"')
def detachInferior(self, _ = None): def detachInferior(self, _ = None):
if self.process is None: if self.process is None:
...@@ -1167,6 +1165,10 @@ class Dumper: ...@@ -1167,6 +1165,10 @@ class Dumper:
error = self.process.Continue() error = self.process.Continue()
self.reportError(error) self.reportError(error)
def quitDebugger(self, _ = None):
self.report('state="inferiorshutdownrequested"')
self.process.Kill()
def handleEvent(self, event): def handleEvent(self, event):
out = lldb.SBStream() out = lldb.SBStream()
event.GetDescription(out) event.GetDescription(out)
...@@ -1178,7 +1180,6 @@ class Dumper: ...@@ -1178,7 +1180,6 @@ class Dumper:
self.report('event={type="%s",data="%s",msg="%s",flavor="%s",state="%s"}' self.report('event={type="%s",data="%s",msg="%s",flavor="%s",state="%s"}'
% (type, out.GetData(), msg, flavor, state)) % (type, out.GetData(), msg, flavor, state))
if state != self.eventState: if state != self.eventState:
self.report('state="%s"' % stateNames[state])
self.eventState = state self.eventState = state
if state == lldb.eStateExited: if state == lldb.eStateExited:
if self.isShuttingDown_: if self.isShuttingDown_:
...@@ -1187,6 +1188,14 @@ class Dumper: ...@@ -1187,6 +1188,14 @@ class Dumper:
self.report('state="inferiorexited"') self.report('state="inferiorexited"')
self.report('exited={status="%s",desc="%s"}' self.report('exited={status="%s",desc="%s"}'
% (self.process.GetExitStatus(), self.process.GetExitDescription())) % (self.process.GetExitStatus(), self.process.GetExitDescription()))
elif state == lldb.eStateStopped:
if self.isInterrupting_:
self.isInterrupting_ = False
self.report('state="inferiorstopok"')
else:
self.report('state="stopped"')
else:
self.report('state="%s"' % stateNames[state])
if type == lldb.SBProcess.eBroadcastBitStateChanged: if type == lldb.SBProcess.eBroadcastBitStateChanged:
state = self.process.GetState() state = self.process.GetState()
if state == lldb.eStateStopped: if state == lldb.eStateStopped:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment