1
0
Fork 0

Edit inactive breakpoint

This commit is contained in:
torusrxxx 2018-06-20 00:20:45 +08:00 committed by Duncan Ogilvie
parent c2f999c6ea
commit 58825d4522
1 changed files with 56 additions and 3 deletions

View File

@ -585,7 +585,7 @@ void BreakpointsView::removeBreakpointSlot()
if(bp.active)
Breakpoints::removeBP(bp);
else
DbgCmdExec(QString("bc \"%1\":$%2").arg(bp.mod).arg(ToHexString(bp.addr)));
DbgCmdExec(QString().sprintf("bc \"%s\":$%X", bp.mod, bp.addr));
}
}
}
@ -601,7 +601,7 @@ void BreakpointsView::editBreakpointSlot()
{
if(!isValidBp())
return;
auto & bp = selectedBp();
const BRIDGEBP & bp = selectedBp();
if(bp.type == bp_dll)
{
Breakpoints::editBP(bp_dll, bp.mod, this);
@ -609,7 +609,60 @@ void BreakpointsView::editBreakpointSlot()
else if(bp.active || bp.type == bp_exception)
{
Breakpoints::editBP(bp.type, ToPtrString(bp.addr), this);
} //TODO: edit inactive breakpoints
}
else
{
QString addrText = QString().sprintf("\"%s\":$%X", bp.mod, bp.addr);
EditBreakpointDialog dialog(this, bp);
if(dialog.exec() != QDialog::Accepted)
return;
auto exec = [](const QString & command)
{
DbgCmdExecDirect(command.toUtf8().constData());
};
const BRIDGEBP & newBp = dialog.getBp();
switch(bp.type)
{
case bp_normal:
exec(QString("SetBreakpointName %1, \"%2\"").arg(addrText).arg(newBp.name));
exec(QString("SetBreakpointCondition %1, \"%2\"").arg(addrText).arg(newBp.breakCondition));
exec(QString("SetBreakpointLog %1, \"%2\"").arg(addrText).arg(newBp.logText));
exec(QString("SetBreakpointLogCondition %1, \"%2\"").arg(addrText).arg(newBp.logCondition));
exec(QString("SetBreakpointCommand %1, \"%2\"").arg(addrText).arg(newBp.commandText));
exec(QString("SetBreakpointCommandCondition %1, \"%2\"").arg(addrText).arg(newBp.commandCondition));
exec(QString("ResetBreakpointHitCount %1, %2").arg(addrText).arg(ToPtrString(newBp.hitCount)));
exec(QString("SetBreakpointFastResume %1, %2").arg(addrText).arg(newBp.fastResume));
exec(QString("SetBreakpointSilent %1, %2").arg(addrText).arg(newBp.silent));
exec(QString("SetBreakpointSingleshoot %1, %2").arg(addrText).arg(newBp.singleshoot));
break;
case bp_hardware:
exec(QString("SetHardwareBreakpointName %1, \"%2\"").arg(addrText).arg(newBp.name));
exec(QString("SetHardwareBreakpointCondition %1, \"%2\"").arg(addrText).arg(newBp.breakCondition));
exec(QString("SetHardwareBreakpointLog %1, \"%2\"").arg(addrText).arg(newBp.logText));
exec(QString("SetHardwareBreakpointLogCondition %1, \"%2\"").arg(addrText).arg(newBp.logCondition));
exec(QString("SetHardwareBreakpointCommand %1, \"%2\"").arg(addrText).arg(newBp.commandText));
exec(QString("SetHardwareBreakpointCommandCondition %1, \"%2\"").arg(addrText).arg(newBp.commandCondition));
exec(QString("ResetHardwareBreakpointHitCount %1, %2").arg(addrText).arg(ToPtrString(newBp.hitCount)));
exec(QString("SetHardwareBreakpointFastResume %1, %2").arg(addrText).arg(newBp.fastResume));
exec(QString("SetHardwareBreakpointSilent %1, %2").arg(addrText).arg(newBp.silent));
exec(QString("SetHardwareBreakpointSingleshoot %1, %2").arg(addrText).arg(newBp.singleshoot));
break;
case bp_memory:
exec(QString("SetMemoryBreakpointName %1, \"\"%2\"\"").arg(addrText).arg(newBp.name));
exec(QString("SetMemoryBreakpointCondition %1, \"%2\"").arg(addrText).arg(newBp.breakCondition));
exec(QString("SetMemoryBreakpointLog %1, \"%2\"").arg(addrText).arg(newBp.logText));
exec(QString("SetMemoryBreakpointLogCondition %1, \"%2\"").arg(addrText).arg(newBp.logCondition));
exec(QString("SetMemoryBreakpointCommand %1, \"%2\"").arg(addrText).arg(newBp.commandText));
exec(QString("SetMemoryBreakpointCommandCondition %1, \"%2\"").arg(addrText).arg(newBp.commandCondition));
exec(QString("ResetMemoryBreakpointHitCount %1, %2").arg(addrText).arg(ToPtrString(newBp.hitCount)));
exec(QString("SetMemoryBreakpointFastResume %1, %2").arg(addrText).arg(newBp.fastResume));
exec(QString("SetMemoryBreakpointSilent %1, %2").arg(addrText).arg(newBp.silent));
exec(QString("SetMemoryBreakpointSingleshoot %1, %2").arg(addrText).arg(newBp.singleshoot));
break;
default:
break;
}
}
}
void BreakpointsView::resetHitCountBreakpointSlot()