forked from qt-creator/qt-creator
Debugger: Avoid race condition on setting initial LLDB breakpoints
Breakpoints inserting is async, so they did end up when the process was running already. This adds an extra roundtrip. Better, but more intrusive solution might be to set the initial breakpoints synchronously, but that would touch all engines. Change-Id: Ia728a9c5ae8f1d6d29d3cc02b9e2d04952091fe9 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -124,7 +124,6 @@ class Dumper(DumperBase):
|
|||||||
self.interpreterBreakpointResolvers = []
|
self.interpreterBreakpointResolvers = []
|
||||||
|
|
||||||
self.report('lldbversion=\"%s\"' % lldb.SBDebugger.GetVersionString())
|
self.report('lldbversion=\"%s\"' % lldb.SBDebugger.GetVersionString())
|
||||||
self.reportState('enginesetupok')
|
|
||||||
|
|
||||||
def fromNativeFrameValue(self, nativeValue):
|
def fromNativeFrameValue(self, nativeValue):
|
||||||
return self.fromNativeValue(nativeValue)
|
return self.fromNativeValue(nativeValue)
|
||||||
@@ -1732,6 +1731,9 @@ class Dumper(DumperBase):
|
|||||||
error = str(result.GetError())
|
error = str(result.GetError())
|
||||||
self.report('success="%d",output="%s",error="%s"' % (success, output, error))
|
self.report('success="%d",output="%s",error="%s"' % (success, output, error))
|
||||||
|
|
||||||
|
def executeRoundtrip(self, args):
|
||||||
|
self.reportResult('', args)
|
||||||
|
|
||||||
def fetchDisassembler(self, args):
|
def fetchDisassembler(self, args):
|
||||||
functionName = args.get('function', '')
|
functionName = args.get('function', '')
|
||||||
flavor = args.get('flavor', '')
|
flavor = args.get('flavor', '')
|
||||||
|
|||||||
@@ -314,6 +314,13 @@ void LldbEngine::setupEngine()
|
|||||||
const bool success = response.data["success"].toInt();
|
const bool success = response.data["success"].toInt();
|
||||||
if (success) {
|
if (success) {
|
||||||
BreakpointManager::claimBreakpointsForEngine(this);
|
BreakpointManager::claimBreakpointsForEngine(this);
|
||||||
|
// Some extra roundtrip to make sure we end up behind all commands triggered
|
||||||
|
// from claimBreakpointsForEngine().
|
||||||
|
QTimer::singleShot(0, this, [this] {
|
||||||
|
DebuggerCommand cmd3("executeRoundtrip");
|
||||||
|
cmd3.callback = [this](const DebuggerResponse &) { notifyEngineSetupOk(); };
|
||||||
|
runCommand(cmd3);
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
notifyEngineSetupFailed();
|
notifyEngineSetupFailed();
|
||||||
}
|
}
|
||||||
@@ -903,8 +910,6 @@ void LldbEngine::handleStateNotification(const GdbMi &item)
|
|||||||
notifyInferiorStopFailed();
|
notifyInferiorStopFailed();
|
||||||
else if (newState == "inferiorill")
|
else if (newState == "inferiorill")
|
||||||
notifyInferiorIll();
|
notifyInferiorIll();
|
||||||
else if (newState == "enginesetupok")
|
|
||||||
notifyEngineSetupOk();
|
|
||||||
else if (newState == "enginesetupfailed") {
|
else if (newState == "enginesetupfailed") {
|
||||||
Core::AsynchronousMessageBox::critical(adapterStartFailed(),
|
Core::AsynchronousMessageBox::critical(adapterStartFailed(),
|
||||||
item["error"].data());
|
item["error"].data());
|
||||||
|
|||||||
Reference in New Issue
Block a user