Debugger: Prevent adding invalid breakpoints.

Check on session restore and add.
In particular, suppress watchpoints at 0x0,
which hang gdb.

Change-Id: I648f53a709fabdebe641e478f367f1354a315ab1
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
Friedemann Kleint
2011-10-20 10:45:59 +02:00
committed by hjk
parent 7348291514
commit 6da15db62c
3 changed files with 38 additions and 2 deletions

View File

@@ -396,7 +396,11 @@ void BreakHandler::loadBreakpoints()
v = map.value(_("message"));
if (v.isValid())
data.message = v.toString();
appendBreakpoint(data);
if (data.isValid()) {
appendBreakpoint(data);
} else {
qWarning("Not restoring invalid breakpoint: %s", qPrintable(data.toString()));
}
}
//qDebug() << "LOADED BREAKPOINTS" << this << list.size();
}
@@ -1036,7 +1040,11 @@ static int currentId = 0;
void BreakHandler::appendBreakpoint(const BreakpointParameters &data)
{
QTC_ASSERT(data.type != UnknownType, return);
if (!data.isValid()) {
qWarning("Not adding invalid breakpoint: %s", qPrintable(data.toString()));
return;
}
BreakpointModelId id(++currentId);
const int row = m_storage.size();
beginInsertRows(QModelIndex(), row, row);