GDB: Avoid running internal commands for breakpoints with 'c' command

Do not try to read locals and threads when hitting a breakpoint with
"continue" command, as it doesn't really stop.

Change-Id: I2adc02d9f94375c390a874122afe2a82a764dc64
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Orgad Shaneh
2018-08-03 15:49:06 +03:00
committed by Orgad Shaneh
parent 9c24aa5875
commit a5533fefd1

View File

@@ -72,6 +72,7 @@
#include <QMessageBox> #include <QMessageBox>
#include <QProcess> #include <QProcess>
#include <QPushButton> #include <QPushButton>
#include <QRegularExpression>
#include <QJsonArray> #include <QJsonArray>
using namespace Core; using namespace Core;
@@ -1434,9 +1435,19 @@ void GdbEngine::handleStop2(const GdbMi &data)
gNumber = data["number"]; gNumber = data["number"];
const QString rid = gNumber.data(); const QString rid = gNumber.data();
const QString threadId = data["thread-id"].data(); const QString threadId = data["thread-id"].data();
if (const Breakpoint bp = breakHandler()->findBreakpointByResponseId(rid))
showStatusMessage(bp->msgBreakpointTriggered(threadId));
m_currentThread = threadId; m_currentThread = threadId;
if (const Breakpoint bp = breakHandler()->findBreakpointByResponseId(rid)) {
showStatusMessage(bp->msgBreakpointTriggered(threadId));
const QString commands = bp->command().trimmed();
// Can be either c or cont[inue]
const QRegularExpression contExp("(^|\\n)\\s*c(ont(i(n(ue?)?)?)?)?$");
QTC_CHECK(contExp.isValid());
if (contExp.match(commands).hasMatch()) {
notifyInferiorRunRequested();
notifyInferiorRunOk();
return;
}
}
} else { } else {
QString reasontr = msgStopped(reason); QString reasontr = msgStopped(reason);
if (reason == "signal-received") { if (reason == "signal-received") {