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.
This commit is contained in:
hjk
2011-01-05 19:30:24 +01:00
parent 81701e080a
commit 21df2cc843
2 changed files with 8 additions and 1 deletions

View File

@@ -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);
}
}