forked from qt-creator/qt-creator
Debugger: Remove the RebuildBreakpointModel command flags
This was useful to trigger collective attemptBreakpointSync() in the gdb engine when gdb did not yet track pending breakpoints by itself. That's not needed anymore. Change-Id: I8afd2955070504c6bd6ae6c028b3f006b6eb4d7c Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -256,7 +256,6 @@ public:
|
|||||||
ExitRequest = DebuggerCommand::ExitRequest,
|
ExitRequest = DebuggerCommand::ExitRequest,
|
||||||
RunRequest = DebuggerCommand::RunRequest,
|
RunRequest = DebuggerCommand::RunRequest,
|
||||||
LosesChild = DebuggerCommand::LosesChild,
|
LosesChild = DebuggerCommand::LosesChild,
|
||||||
RebuildBreakpointModel = DebuggerCommand::RebuildBreakpointModel,
|
|
||||||
InUpdateLocals = DebuggerCommand::InUpdateLocals,
|
InUpdateLocals = DebuggerCommand::InUpdateLocals,
|
||||||
NativeCommand = DebuggerCommand::NativeCommand,
|
NativeCommand = DebuggerCommand::NativeCommand,
|
||||||
Silent = DebuggerCommand::Silent
|
Silent = DebuggerCommand::Silent
|
||||||
|
@@ -84,8 +84,6 @@ public:
|
|||||||
ExitRequest = 32,
|
ExitRequest = 32,
|
||||||
// Auto-set inferior shutdown related states.
|
// Auto-set inferior shutdown related states.
|
||||||
LosesChild = 64,
|
LosesChild = 64,
|
||||||
// Trigger breakpoint model rebuild when no such commands are pending anymore.
|
|
||||||
RebuildBreakpointModel = 128,
|
|
||||||
// This is a native (non-Python) command that's handled directly by the backend.
|
// This is a native (non-Python) command that's handled directly by the backend.
|
||||||
NativeCommand = 256,
|
NativeCommand = 256,
|
||||||
// This is a command that needs to be wrapped into -interpreter-exec console
|
// This is a command that needs to be wrapped into -interpreter-exec console
|
||||||
|
@@ -739,15 +739,6 @@ void GdbEngine::runCommand(const DebuggerCommand &command)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmd.flags & RebuildBreakpointModel) {
|
|
||||||
++m_pendingBreakpointRequests;
|
|
||||||
PENDING_DEBUG(" BREAKPOINT MODEL:" << cmd.function
|
|
||||||
<< "INCREMENTS PENDING TO" << m_pendingBreakpointRequests);
|
|
||||||
} else {
|
|
||||||
PENDING_DEBUG(" OTHER (IN):" << cmd.function
|
|
||||||
<< "LEAVES PENDING BREAKPOINT AT" << m_pendingBreakpointRequests);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cmd.flags & (NeedsTemporaryStop|NeedsFullStop)) {
|
if (cmd.flags & (NeedsTemporaryStop|NeedsFullStop)) {
|
||||||
showMessage("RUNNING NEEDS-STOP COMMAND " + cmd.function);
|
showMessage("RUNNING NEEDS-STOP COMMAND " + cmd.function);
|
||||||
const bool wantContinue = bool(cmd.flags & NeedsTemporaryStop);
|
const bool wantContinue = bool(cmd.flags & NeedsTemporaryStop);
|
||||||
@@ -769,6 +760,7 @@ void GdbEngine::runCommand(const DebuggerCommand &command)
|
|||||||
requestInterruptInferior();
|
requestInterruptInferior();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (state() != InferiorStopOk)
|
||||||
showMessage("UNSAFE STATE FOR QUEUED COMMAND. EXECUTING IMMEDIATELY");
|
showMessage("UNSAFE STATE FOR QUEUED COMMAND. EXECUTING IMMEDIATELY");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1008,18 +1000,6 @@ void GdbEngine::handleResultRecord(DebuggerResponse *response)
|
|||||||
if (cmd.callback)
|
if (cmd.callback)
|
||||||
cmd.callback(*response);
|
cmd.callback(*response);
|
||||||
|
|
||||||
if (flags & RebuildBreakpointModel) {
|
|
||||||
--m_pendingBreakpointRequests;
|
|
||||||
PENDING_DEBUG(" BREAKPOINT" << cmd.function);
|
|
||||||
if (m_pendingBreakpointRequests <= 0) {
|
|
||||||
PENDING_DEBUG("\n\n ... AND TRIGGERS BREAKPOINT MODEL UPDATE\n");
|
|
||||||
attemptBreakpointSynchronization();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
PENDING_DEBUG(" OTHER (OUT):" << cmd.function
|
|
||||||
<< "LEAVES PENDING BREAKPOINT AT" << m_pendingBreakpointRequests);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Continue only if there are no commands wire anymore, so this will
|
// Continue only if there are no commands wire anymore, so this will
|
||||||
// be fully synchronous.
|
// be fully synchronous.
|
||||||
// This is somewhat inefficient, as it makes the last command synchronous.
|
// This is somewhat inefficient, as it makes the last command synchronous.
|
||||||
@@ -2366,7 +2346,7 @@ void GdbEngine::handleBreakInsert1(const DebuggerResponse &response, Breakpoint
|
|||||||
const GdbMi mainbkpt = response.data["bkpt"];
|
const GdbMi mainbkpt = response.data["bkpt"];
|
||||||
bp.notifyBreakpointRemoveProceeding();
|
bp.notifyBreakpointRemoveProceeding();
|
||||||
DebuggerCommand cmd("-break-delete " + mainbkpt["number"].data());
|
DebuggerCommand cmd("-break-delete " + mainbkpt["number"].data());
|
||||||
cmd.flags = NeedsTemporaryStop | RebuildBreakpointModel;
|
cmd.flags = NeedsTemporaryStop;
|
||||||
runCommand(cmd);
|
runCommand(cmd);
|
||||||
bp.notifyBreakpointRemoveOk();
|
bp.notifyBreakpointRemoveOk();
|
||||||
return;
|
return;
|
||||||
@@ -2393,14 +2373,14 @@ void GdbEngine::handleBreakInsert1(const DebuggerResponse &response, Breakpoint
|
|||||||
const int lineNumber = bp.lineNumber();
|
const int lineNumber = bp.lineNumber();
|
||||||
DebuggerCommand cmd("trace \"" + GdbMi::escapeCString(fileName) + "\":"
|
DebuggerCommand cmd("trace \"" + GdbMi::escapeCString(fileName) + "\":"
|
||||||
+ QString::number(lineNumber),
|
+ QString::number(lineNumber),
|
||||||
NeedsTemporaryStop | RebuildBreakpointModel);
|
NeedsTemporaryStop);
|
||||||
runCommand(cmd);
|
runCommand(cmd);
|
||||||
} else {
|
} else {
|
||||||
// Some versions of gdb like "GNU gdb (GDB) SUSE (6.8.91.20090930-2.4)"
|
// Some versions of gdb like "GNU gdb (GDB) SUSE (6.8.91.20090930-2.4)"
|
||||||
// know how to do pending breakpoints using CLI but not MI. So try
|
// know how to do pending breakpoints using CLI but not MI. So try
|
||||||
// again with MI.
|
// again with MI.
|
||||||
DebuggerCommand cmd("break " + breakpointLocation2(bp.parameters()),
|
DebuggerCommand cmd("break " + breakpointLocation2(bp.parameters()),
|
||||||
NeedsTemporaryStop | RebuildBreakpointModel);
|
NeedsTemporaryStop);
|
||||||
cmd.callback = [this, bp](const DebuggerResponse &r) { handleBreakInsert2(r, bp); };
|
cmd.callback = [this, bp](const DebuggerResponse &r) { handleBreakInsert2(r, bp); };
|
||||||
runCommand(cmd);
|
runCommand(cmd);
|
||||||
}
|
}
|
||||||
@@ -2559,7 +2539,7 @@ void GdbEngine::insertBreakpoint(Breakpoint bp)
|
|||||||
} else if (type == BreakpointAtFork) {
|
} else if (type == BreakpointAtFork) {
|
||||||
cmd.function = "catch fork";
|
cmd.function = "catch fork";
|
||||||
cmd.callback = handleCatch;
|
cmd.callback = handleCatch;
|
||||||
cmd.flags = NeedsTemporaryStop | RebuildBreakpointModel;
|
cmd.flags = NeedsTemporaryStop;
|
||||||
runCommand(cmd);
|
runCommand(cmd);
|
||||||
// Another one...
|
// Another one...
|
||||||
cmd.function = "catch vfork";
|
cmd.function = "catch vfork";
|
||||||
@@ -2596,7 +2576,7 @@ void GdbEngine::insertBreakpoint(Breakpoint bp)
|
|||||||
cmd.function += breakpointLocation(bp.parameters());
|
cmd.function += breakpointLocation(bp.parameters());
|
||||||
cmd.callback = [this, bp](const DebuggerResponse &r) { handleBreakInsert1(r, bp); };
|
cmd.callback = [this, bp](const DebuggerResponse &r) { handleBreakInsert1(r, bp); };
|
||||||
}
|
}
|
||||||
cmd.flags = NeedsTemporaryStop | RebuildBreakpointModel;
|
cmd.flags = NeedsTemporaryStop;
|
||||||
runCommand(cmd);
|
runCommand(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2645,7 +2625,7 @@ void GdbEngine::changeBreakpoint(Breakpoint bp)
|
|||||||
bp.notifyBreakpointChangeOk();
|
bp.notifyBreakpointChangeOk();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
cmd.flags = NeedsTemporaryStop | RebuildBreakpointModel;
|
cmd.flags = NeedsTemporaryStop;
|
||||||
runCommand(cmd);
|
runCommand(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2673,7 +2653,7 @@ void GdbEngine::removeBreakpoint(Breakpoint bp)
|
|||||||
// We already have a fully inserted breakpoint.
|
// We already have a fully inserted breakpoint.
|
||||||
bp.notifyBreakpointRemoveProceeding();
|
bp.notifyBreakpointRemoveProceeding();
|
||||||
showMessage(QString("DELETING BP %1 IN %2").arg(br.id.toString()).arg(bp.fileName()));
|
showMessage(QString("DELETING BP %1 IN %2").arg(br.id.toString()).arg(bp.fileName()));
|
||||||
DebuggerCommand cmd("-break-delete " + br.id.toString(), NeedsTemporaryStop | RebuildBreakpointModel);
|
DebuggerCommand cmd("-break-delete " + br.id.toString(), NeedsTemporaryStop);
|
||||||
runCommand(cmd);
|
runCommand(cmd);
|
||||||
|
|
||||||
// Pretend it succeeds without waiting for response. Feels better.
|
// Pretend it succeeds without waiting for response. Feels better.
|
||||||
@@ -4922,8 +4902,6 @@ void GdbEngine::handleCoreRoundTrip(const DebuggerResponse &response)
|
|||||||
|
|
||||||
void GdbEngine::doUpdateLocals(const UpdateParameters ¶ms)
|
void GdbEngine::doUpdateLocals(const UpdateParameters ¶ms)
|
||||||
{
|
{
|
||||||
m_pendingBreakpointRequests = 0;
|
|
||||||
|
|
||||||
watchHandler()->notifyUpdateStarted(params);
|
watchHandler()->notifyUpdateStarted(params);
|
||||||
|
|
||||||
DebuggerCommand cmd("fetchVariables", Discardable|InUpdateLocals);
|
DebuggerCommand cmd("fetchVariables", Discardable|InUpdateLocals);
|
||||||
|
@@ -159,8 +159,6 @@ private: ////////// General Interface //////////
|
|||||||
int m_oldestAcceptableToken = -1;
|
int m_oldestAcceptableToken = -1;
|
||||||
int m_nonDiscardableCount = 0;
|
int m_nonDiscardableCount = 0;
|
||||||
|
|
||||||
int m_pendingBreakpointRequests = 0; // Watch updating commands in flight
|
|
||||||
|
|
||||||
typedef void (GdbEngine::*CommandsDoneCallback)();
|
typedef void (GdbEngine::*CommandsDoneCallback)();
|
||||||
// This function is called after all previous responses have been received.
|
// This function is called after all previous responses have been received.
|
||||||
CommandsDoneCallback m_commandsDoneCallback = nullptr;
|
CommandsDoneCallback m_commandsDoneCallback = nullptr;
|
||||||
|
Reference in New Issue
Block a user