1
0
Fork 0

Add checks to prevent tracing when the program is already running

Closes #3120
pull/3133/head
Duncan Ogilvie 2023-07-13 11:33:04 +02:00
parent 9746dee02f
commit 5fcdb8478d
2 changed files with 24 additions and 0 deletions

View File

@ -19,6 +19,11 @@ static bool genericConditionalTraceCommand(TITANCBSTEP callback, STEPFUNCTION st
dputs(QT_TRANSLATE_NOOP("DBG", "Trace already active"));
return false;
}
if(dbgisrunning())
{
dputs(QT_TRANSLATE_NOOP("DBG", "Cannot start a trace when running, pause execution first."));
return false;
}
duint maxCount;
if(!BridgeSettingGetUint("Engine", "MaxTraceCount", &maxCount) || !maxCount)
maxCount = 50000;
@ -100,6 +105,11 @@ bool cbDebugTraceOverIntoTraceRecord(int argc, char* argv[])
bool cbDebugRunToParty(int argc, char* argv[])
{
if(dbgisrunning())
{
dputs(QT_TRANSLATE_NOOP("DBG", "Cannot start a trace when running, pause execution first."));
return false;
}
EXCLUSIVE_ACQUIRE(LockRunToUserCode);
if(!RunToUserCodeBreakpoints.empty())
{

View File

@ -1173,6 +1173,13 @@ void MainWindow::execTicnd()
{
if(!DbgIsDebugging())
return;
if(DbgIsRunning())
{
SimpleErrorBox(this, tr("Error"), tr("Cannot start a trace when running, pause execution first."));
return;
}
mSimpleTraceDialog->setTraceCommand("TraceIntoConditional");
mSimpleTraceDialog->setWindowTitle(tr("Trace into..."));
mSimpleTraceDialog->setWindowIcon(DIcon("traceinto"));
@ -1183,6 +1190,13 @@ void MainWindow::execTocnd()
{
if(!DbgIsDebugging())
return;
if(DbgIsRunning())
{
SimpleErrorBox(this, tr("Error"), tr("Cannot start a trace when running, pause execution first."));
return;
}
mSimpleTraceDialog->setTraceCommand("TraceOverConditional");
mSimpleTraceDialog->setWindowTitle(tr("Trace over..."));
mSimpleTraceDialog->setWindowIcon(DIcon("traceover"));