@@ -62,6 +62,7 @@ Debugger::Debugger(QTextEdit *tEdit,
6262 : QObject(parent)
6363{
6464 QSettings settings (" SASM Project" , " SASM" );
65+ gdbRun = false ;
6566 c = 0 ;
6667 pid = 0 ;
6768 firstAction = true ;
@@ -128,6 +129,10 @@ Debugger::Debugger(QTextEdit *tEdit,
128129 bufferTimer = new QTimer;
129130 QObject::connect (bufferTimer, SIGNAL (timeout ()), this , SLOT (processOutput ()), Qt::QueuedConnection);
130131 bufferTimer->start (10 );
132+
133+ checkGdbRunTimer = new QTimer;
134+ QObject::connect (checkGdbRunTimer, SIGNAL (timeout ()), this , SLOT (checkGdbRun ()), Qt::QueuedConnection);
135+ checkGdbRunTimer->start (10000 );
131136}
132137
133138void Debugger::emitStarted ()
@@ -161,6 +166,15 @@ void Debugger::processOutput()
161166 bufferTimer->start (10 );
162167}
163168
169+ void Debugger::checkGdbRun ()
170+ {
171+ checkGdbRunTimer->stop ();
172+ if (!gdbRun) {
173+ emit printLog (tr (" GDB error\n " ), Qt::red);
174+ emit finished ();
175+ }
176+ }
177+
164178void Debugger::processMessage (QString output, QString error)
165179{
166180 if (error.indexOf (" PC register is not available" ) != -1 ) {
@@ -375,6 +389,7 @@ void Debugger::processAction(QString output, QString error)
375389 return ;
376390 } else { // if found highlight and print it
377391 // highlight line number
392+ gdbRun = true ;
378393 emit highlightLine (lineNumber);
379394 stopped = true ;
380395 emit wasStopped ();
0 commit comments