Commit 0f4765b8 authored by hjk's avatar hjk
Browse files

debugger: revert the decision to not update the location marker early.

parent 9c1c720d
...@@ -1166,8 +1166,13 @@ void GdbEngine::handleStopResponse(const GdbMi &data) ...@@ -1166,8 +1166,13 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
const int bkptno = data.findChild("bkptno").data().toInt(); const int bkptno = data.findChild("bkptno").data().toInt();
const GdbMi frame = data.findChild("frame"); const GdbMi frame = data.findChild("frame");
const int lineNumber = frame.findChild("line").data().toInt();
QString fullName = QString::fromUtf8(frame.findChild("fullname").data());
if (fullName.isEmpty())
fullName = QString::fromUtf8(frame.findChild("file").data());
if (bkptno && frame.isValid()) { if (bkptno && frame.isValid()) {
// Use opportunity to update the marker position. // Use opportunity to update the breakpoint marker position.
BreakHandler *handler = breakHandler(); BreakHandler *handler = breakHandler();
BreakpointId id = handler->findBreakpointByNumber(bkptno); BreakpointId id = handler->findBreakpointByNumber(bkptno);
const BreakpointResponse &response = handler->response(id); const BreakpointResponse &response = handler->response(id);
...@@ -1175,15 +1180,15 @@ void GdbEngine::handleStopResponse(const GdbMi &data) ...@@ -1175,15 +1180,15 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
if (fileName.isEmpty()) if (fileName.isEmpty())
fileName = handler->fileName(id); fileName = handler->fileName(id);
if (fileName.isEmpty()) if (fileName.isEmpty())
fileName = QString::fromUtf8(frame.findChild("fullname").data()); fileName = fullName;
if (fileName.isEmpty()) if (!fileName.isEmpty())
fileName = QString::fromUtf8(frame.findChild("file").data());
if (!fileName.isEmpty()) {
int lineNumber = frame.findChild("line").data().toInt();
handler->setMarkerFileAndLine(id, fileName, lineNumber); handler->setMarkerFileAndLine(id, fileName, lineNumber);
}
} }
// Quickly set the location marker.
if (lineNumber && QFileInfo(fullName).exists())
debuggerCore()->gotoLocation(fullName, lineNumber, true);
if (!m_commandsToRunOnTemporaryBreak.isEmpty()) { if (!m_commandsToRunOnTemporaryBreak.isEmpty()) {
QTC_ASSERT(state() == InferiorStopRequested, qDebug() << state()) QTC_ASSERT(state() == InferiorStopRequested, qDebug() << state())
notifyInferiorStopOk(); notifyInferiorStopOk();
...@@ -1296,7 +1301,6 @@ void GdbEngine::handleStop0(const GdbMi &data) ...@@ -1296,7 +1301,6 @@ void GdbEngine::handleStop0(const GdbMi &data)
static int stepCounter = 0; static int stepCounter = 0;
if (debuggerCore()->boolSetting(SkipKnownFrames)) { if (debuggerCore()->boolSetting(SkipKnownFrames)) {
if (reason == "end-stepping-range" || reason == "function-finished") { if (reason == "end-stepping-range" || reason == "function-finished") {
GdbMi frame = data.findChild("frame");
//showMessage(frame.toString()); //showMessage(frame.toString());
QString funcName = _(frame.findChild("func").data()); QString funcName = _(frame.findChild("func").data());
QString fileName = QString::fromLocal8Bit(frame.findChild("file").data()); QString fileName = QString::fromLocal8Bit(frame.findChild("file").data());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment