forked from qt-creator/qt-creator
Debugger: Re-work breakpoint storage handling
The actual data is now in a TreeModel. As interface to individual breakpoints there's a new Breakpoint class essentially providing a checked handle. On the user code side breakHandler()->foo(bpId) is replaced by bp.foo(). Change-Id: I82f435bad6301fce85a1d82bf6bf39e9ddba511e Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
@@ -332,9 +332,8 @@ void DisassemblerAgent::updateBreakpointMarkers()
|
||||
if (!d->document)
|
||||
return;
|
||||
|
||||
BreakHandler *handler = breakHandler();
|
||||
BreakpointModelIds ids = handler->engineBreakpointIds(d->engine);
|
||||
if (ids.isEmpty())
|
||||
Breakpoints bps = breakHandler()->engineBreakpoints(d->engine);
|
||||
if (bps.isEmpty())
|
||||
return;
|
||||
|
||||
const DisassemblerLines contents = d->contentsAtCurrentLocation();
|
||||
@@ -342,15 +341,15 @@ void DisassemblerAgent::updateBreakpointMarkers()
|
||||
d->document->removeMark(marker);
|
||||
qDeleteAll(d->breakpointMarks);
|
||||
d->breakpointMarks.clear();
|
||||
foreach (BreakpointModelId id, ids) {
|
||||
const quint64 address = handler->response(id).address;
|
||||
foreach (Breakpoint bp, bps) {
|
||||
const quint64 address = bp.response().address;
|
||||
if (!address)
|
||||
continue;
|
||||
const int lineNumber = contents.lineForAddress(address);
|
||||
if (!lineNumber)
|
||||
continue;
|
||||
TextMark *marker = new TextMark(QString(), lineNumber);
|
||||
marker->setIcon(handler->icon(id));
|
||||
marker->setIcon(bp.icon());
|
||||
marker->setPriority(TextMark::NormalPriority);
|
||||
d->breakpointMarks.append(marker);
|
||||
d->document->addMark(marker);
|
||||
|
||||
Reference in New Issue
Block a user