debugger: fix manual changing of breakpoint line numbers

Task-number: QTCREATORBUG-6178
Change-Id: I3e0a3cae0ee5df02ad8ceee7222bc667e61774c8
Reviewed-by: Robert Löhning <robert.loehning@nokia.com>
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
hjk
2011-11-04 14:03:48 +01:00
committed by hjk
parent b0ca56109e
commit ccfc4e032a
3 changed files with 26 additions and 10 deletions

View File

@@ -2713,6 +2713,18 @@ void GdbEngine::handleBreakThreadSpec(const GdbResponse &response)
insertBreakpoint(id);
}
void GdbEngine::handleBreakLineNumber(const GdbResponse &response)
{
QTC_CHECK(response.resultClass == GdbResultDone)
const BreakpointModelId id = response.cookie.value<BreakpointModelId>();
BreakHandler *handler = breakHandler();
BreakpointResponse br = handler->response(id);
br.lineNumber = handler->lineNumber(id);
handler->setResponse(id, br);
handler->notifyBreakpointNeedsReinsertion(id);
insertBreakpoint(id);
}
void GdbEngine::handleBreakIgnore(const GdbResponse &response)
{
// gdb 6.8:
@@ -3022,6 +3034,13 @@ void GdbEngine::changeBreakpoint(BreakpointModelId id)
CB(handleBreakThreadSpec), vid);
return;
}
if (data.lineNumber != response.lineNumber) {
// The only way to change this seems to be to re-set the bp completely.
postCommand("-break-delete " + bpnr,
NeedsStop | RebuildBreakpointModel,
CB(handleBreakLineNumber), vid);
return;
}
if (data.command != response.command) {
QByteArray breakCommand = "-break-commands " + bpnr;
foreach (const QString &command, data.command.split(QLatin1String("\\n"))) {

View File

@@ -504,6 +504,7 @@ private: ////////// View & Data Stuff //////////
void handleTraceInsert2(const GdbResponse &response);
void handleBreakCondition(const GdbResponse &response);
void handleBreakThreadSpec(const GdbResponse &response);
void handleBreakLineNumber(const GdbResponse &response);
void handleWatchInsert(const GdbResponse &response);
void handleCatchInsert(const GdbResponse &response);
void handleInfoLine(const GdbResponse &response);