1
0
Fork 0

Merge pull request #3790 from bbugdigger/multi-breakpoint-selection

Toggle software breakpoints across all selected instructions in the disassembly view
This commit is contained in:
Marko Mladenovic 2026-04-10 23:53:48 +02:00 committed by GitHub
parent ae073d13fd
commit 8968b79e72
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 40 additions and 0 deletions

View File

@ -10,6 +10,7 @@
#include "WordEditDialog.h"
#include "GotoDialog.h"
#include "DisplayTypeDialog.h"
#include <BasicView/Disassembly.h>
CommonActions::CommonActions(QWidget* parent, ActionHelperFuncs funcs, GetSelectionFunc getSelection)
: QObject(parent), ActionHelperProxy(funcs), mGetSelection(getSelection)
@ -340,6 +341,45 @@ void CommonActions::toggleInt3BPActionSlot()
{
if(!DbgIsDebugging())
return;
if(auto disasm = qobject_cast<Disassembly*>(parent()))
{
auto selectionStart = disasm->getSelectionStart();
auto selectionEnd = disasm->getSelectionEnd();
duint warningVa = 0;
disasm->prepareDataRange(selectionStart, selectionEnd, [&](int, const Instruction_t & inst)
{
duint va = disasm->rvaToVa(inst.rva);
BPXTYPE bpType = DbgGetBpxTypeAt(va);
if((bpType & bp_normal) != bp_normal && !DbgFunctions()->MemIsCodePage(va, true))
{
warningVa = va;
return false;
}
return true;
});
if(warningVa)
{
if(!WarningBoxNotExecutable(tr("Setting software breakpoint here may result in crash. Do you really want to continue?"), warningVa))
return;
}
disasm->prepareDataRange(selectionStart, selectionEnd, [&](int, const Instruction_t & inst)
{
duint va = disasm->rvaToVa(inst.rva);
BPXTYPE bpType = DbgGetBpxTypeAt(va);
QString cmd;
if((bpType & bp_normal) == bp_normal)
cmd = "bc " + ToPtrString(va);
else
cmd = "bp " + ToPtrString(va);
DbgCmdExec(cmd);
return true;
});
return;
}
duint va = mGetSelection();
BPXTYPE bpType = DbgGetBpxTypeAt(va);
QString cmd;