From 510222e9c646a8e50f0ecd88ad384f25873df089 Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 4 Mar 2011 19:49:03 +0100 Subject: [PATCH] debugger: mention changed values in the status bar on watchpoint hit --- src/plugins/debugger/gdb/gdbengine.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index ffe0230cbb8..d8e53361ea0 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -1498,7 +1498,16 @@ void GdbEngine::handleStop1(const GdbMi &data) const int bpNumber = wpt.findChild("number").data().toInt(); const BreakpointId id = breakHandler()->findBreakpointByNumber(bpNumber); const quint64 bpAddress = wpt.findChild("exp").data().mid(1).toULongLong(0, 0); - showStatusMessage(msgWatchpointTriggered(id, bpNumber, bpAddress)); + QString msg = msgWatchpointTriggered(id, bpNumber, bpAddress); + GdbMi value = data.findChild("value"); + GdbMi oldValue = value.findChild("old"); + GdbMi newValue = value.findChild("new"); + if (oldValue.isValid() && newValue.isValid()) { + msg += QLatin1Char(' '); + msg += tr("Value changed from %1 to %2.") + .arg(_(oldValue.data())).arg(_(newValue.data())); + } + showStatusMessage(msg); } else if (reason == "breakpoint-hit") { GdbMi gNumber = data.findChild("bkptno"); // 'number' or 'bkptno'? if (!gNumber.isValid())