Commit 0ea0977c authored by hjk's avatar hjk
Browse files

debugger: introduce a new category for commands that are always immediately executed

used for -exec-interrupt right now
parent d8cc842d
...@@ -759,7 +759,12 @@ void GdbEngine::postCommandHelper(const GdbCommand &cmd) ...@@ -759,7 +759,12 @@ void GdbEngine::postCommandHelper(const GdbCommand &cmd)
<< "LEAVES PENDING BREAKPOINT AT" << m_pendingBreakpointRequests); << "LEAVES PENDING BREAKPOINT AT" << m_pendingBreakpointRequests);
} }
if ((cmd.flags & NeedsStop) || !m_commandsToRunOnTemporaryBreak.isEmpty()) { // FIXME: clean up logic below
if (cmd.flags & Immediate) {
// This should always be sent.
flushCommand(cmd);
} else if ((cmd.flags & NeedsStop)
|| !m_commandsToRunOnTemporaryBreak.isEmpty()) {
if (state() == InferiorStopped || state() == InferiorUnrunnable if (state() == InferiorStopped || state() == InferiorUnrunnable
|| state() == InferiorStarting || state() == AdapterStarted) { || state() == InferiorStarting || state() == AdapterStarted) {
// Can be safely sent now. // Can be safely sent now.
......
...@@ -193,6 +193,8 @@ private: ////////// Gdb Command Management ////////// ...@@ -193,6 +193,8 @@ private: ////////// Gdb Command Management //////////
LosesChild = 64, LosesChild = 64,
// Trigger breakpoint model rebuild when no such commands are pending anymore. // Trigger breakpoint model rebuild when no such commands are pending anymore.
RebuildBreakpointModel = 128, RebuildBreakpointModel = 128,
// This command needs to be send immediately.
Immediate = 256,
}; };
Q_DECLARE_FLAGS(GdbCommandFlags, GdbCommandFlag) Q_DECLARE_FLAGS(GdbCommandFlags, GdbCommandFlag)
private: private:
......
...@@ -227,7 +227,7 @@ void RemoteGdbAdapter::startInferiorPhase2() ...@@ -227,7 +227,7 @@ void RemoteGdbAdapter::startInferiorPhase2()
void RemoteGdbAdapter::interruptInferior() void RemoteGdbAdapter::interruptInferior()
{ {
m_engine->postCommand("-exec-interrupt"); m_engine->postCommand("-exec-interrupt", GdbEngine::Immediate);
} }
void RemoteGdbAdapter::shutdown() void RemoteGdbAdapter::shutdown()
......
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