Commit 21df2cc8 authored by hjk's avatar hjk
Browse files

debugger: let the manually corrected bp line number take precedence

Looks like the number from '-break-info' cannot be trusted, even if
'original-line' is present.
parent 81701e08
......@@ -1175,6 +1175,9 @@ QString BreakHandler::BreakpointItem::toToolTip() const
<< "<tr><td>" << tr("Line Number:")
<< "</td><td>" << data.lineNumber
<< "</td><td>" << response.lineNumber << "</td></tr>"
<< "<tr><td>" << tr("Corrected Line Number:")
<< "</td><td>-"
<< "</td><td>" << response.correctedLineNumber << "</td></tr>"
<< "<tr><td>" << tr("Breakpoint Address:")
<< "</td><td>";
formatAddress(str, data.address);
......
......@@ -2066,7 +2066,10 @@ void GdbEngine::updateBreakpointDataFromOutput(BreakpointId id, const GdbMi &bkp
} else if (child.hasName("fullname")) {
fullName = child.data();
} else if (child.hasName("line")) {
response.lineNumber = child.data().toInt();
// The line numbers here are the uncorrected ones. So don't
// change it if we know better already.
if (response.correctedLineNumber == 0)
response.lineNumber = child.data().toInt();
} else if (child.hasName("cond")) {
// gdb 6.3 likes to "rewrite" conditions. Just accept that fact.
response.condition = child.data();
......@@ -2475,6 +2478,7 @@ void GdbEngine::handleInfoLine(const GdbResponse &response)
const int line = ba.mid(5, pos - 5).toInt();
BreakpointResponse br = breakHandler()->response(id);
br.lineNumber = line;
br.correctedLineNumber = line;
breakHandler()->setResponse(id, br);
}
}
......
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