From f635af8908b865635326f828c2606a1e684f4510 Mon Sep 17 00:00:00 2001 From: Aaron Barany Date: Mon, 10 Dec 2018 21:08:38 -0800 Subject: [PATCH] GDB: Don't reset breakpoint when line numbers differ When the breakpoint is put on a non-code line, it will be moved to the next line that has debuggable code on it. When attempting to reset the breakpoint to the originally requested line, this causes an infinite loop of removing and re-adding the breakpoint. Fixes: QTCREATORBUG-21611 Fixes: QTCREATORBUG-21616 Change-Id: I8943de0eae991644eb6728f491010599f62192ff Reviewed-by: Orgad Shaneh Reviewed-by: hjk --- src/plugins/debugger/gdb/gdbengine.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index b4d104509e8..2ecbf285349 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -2488,15 +2488,17 @@ void GdbEngine::updateBreakpoint(const Breakpoint &bp) QTC_ASSERT(state2 == BreakpointUpdateProceeding, qDebug() << state2); DebuggerCommand cmd; - if (!bp->isPending() && requested.threadSpec != bp->threadSpec()) { - // The only way to change this seems to be to re-set the bp completely. - cmd.function = "-break-delete " + bpnr; - cmd.callback = [this, bp](const DebuggerResponse &r) { handleBreakThreadSpec(r, bp); }; - } else if (!bp->isPending() && requested.lineNumber != bp->lineNumber()) { - // The only way to change this seems to be to re-set the bp completely. - cmd.function = "-break-delete " + bpnr; - cmd.callback = [this, bp](const DebuggerResponse &r) { handleBreakLineNumber(r, bp); }; - } else if (requested.command != bp->command()) { + // FIXME: See QTCREATORBUG-21611, QTCREATORBUG-21616 +// if (!bp->isPending() && requested.threadSpec != bp->threadSpec()) { +// // The only way to change this seems to be to re-set the bp completely. +// cmd.function = "-break-delete " + bpnr; +// cmd.callback = [this, bp](const DebuggerResponse &r) { handleBreakThreadSpec(r, bp); }; +// } else if (!bp->isPending() && requested.lineNumber != bp->lineNumber()) { +// // The only way to change this seems to be to re-set the bp completely. +// cmd.function = "-break-delete " + bpnr; +// cmd.callback = [this, bp](const DebuggerResponse &r) { handleBreakLineNumber(r, bp); }; +// } else if + if (requested.command != bp->command()) { cmd.function = "-break-commands " + bpnr; for (QString command : requested.command.split('\n')) { if (!command.isEmpty()) {