1
0
Fork 0

GUI: always delete breakpoints by identifier if possible

This commit is contained in:
Duncan Ogilvie 2020-04-01 16:29:32 +02:00
parent 5a6817680a
commit 3308fbfc22
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
2 changed files with 15 additions and 7 deletions

View File

@ -577,10 +577,7 @@ void BreakpointsView::removeBreakpointSlot()
if(isValidBp(i))
{
const BRIDGEBP & bp = selectedBp(i);
if(bp.active)
Breakpoints::removeBP(bp);
else
DbgCmdExec(QString().sprintf("bc \"%s\":$%X", bp.mod, bp.addr));
Breakpoints::removeBP(bp);
}
}
}

View File

@ -178,6 +178,17 @@ void Breakpoints::disableBP(BPXTYPE type, duint va)
BridgeFree(wBPList.bp);
}
static QString getBpIdentifier(const BRIDGEBP & bp)
{
if(*bp.mod)
{
auto modbase = DbgModBaseFromName(bp.mod);
if(!modbase)
return QString("\"%1\":$%2").arg(bp.mod).arg(ToHexString(bp.addr));
}
return ToPtrString(bp.addr);
}
/**
* @brief Remove breakpoint according to the given breakpoint descriptor.
*
@ -192,15 +203,15 @@ void Breakpoints::removeBP(const BRIDGEBP & bp)
switch(bp.type)
{
case bp_normal:
wCmd = QString("bc \"%1\"").arg(ToPtrString(bp.addr));
wCmd = QString("bc \"%1\"").arg(getBpIdentifier(bp));
break;
case bp_hardware:
wCmd = QString("bphc \"%1\"").arg(ToPtrString(bp.addr));
wCmd = QString("bphc \"%1\"").arg(getBpIdentifier(bp));
break;
case bp_memory:
wCmd = QString("bpmc \"%1\"").arg(ToPtrString(bp.addr));
wCmd = QString("bpmc \"%1\"").arg(getBpIdentifier(bp));
break;
case bp_dll: