Debugger: use FilePath in stack frames

Change-Id: I98b6aa60e1b72be3482916446b87cee89e6cf2a4
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
David Schulz
2021-10-26 10:48:43 +02:00
parent 67607e4bc6
commit bc55c7cc70
12 changed files with 55 additions and 50 deletions

View File

@@ -1079,7 +1079,7 @@ void CdbEngine::activateFrame(int index)
if (debug || debugLocals)
qDebug("activateFrame idx=%d '%s' %d", index,
qPrintable(frame.file), frame.line);
qPrintable(frame.file.toUserOutput()), frame.line);
stackHandler()->setCurrentIndex(index);
gotoLocation(frame);
if (m_pythonVersion > 0x030000)
@@ -2615,7 +2615,7 @@ static StackFrames parseFrames(const GdbMi &gdbmi, bool *incomplete = nullptr)
frame.level = QString::number(i);
const GdbMi fullName = frameMi["fullname"];
if (fullName.isValid()) {
frame.file = Utils::FileUtils::normalizedPathName(fullName.data());
frame.file = Utils::FilePath::fromString(fullName.data()).normalizedPathName();
frame.line = frameMi["line"].data().toInt();
frame.usable = false; // To be decided after source path mapping.
const GdbMi languageMi = frameMi["language"];
@@ -2661,12 +2661,12 @@ unsigned CdbEngine::parseStackTrace(const GdbMi &data, bool sourceStepInto)
return ParseStackStepOut;
}
if (hasFile) {
const NormalizedSourceFileName fileName = sourceMapNormalizeFileNameFromDebugger(frames.at(i).file);
const NormalizedSourceFileName fileName = sourceMapNormalizeFileNameFromDebugger(frames.at(i).file.toString());
if (!fileName.exists && i == 0 && sourceStepInto) {
showMessage("Step into: Hit frame with no source, step out...", LogMisc);
return ParseStackStepOut;
}
frames[i].file = fileName.fileName;
frames[i].file = FilePath::fromString(fileName.fileName);
frames[i].usable = fileName.exists;
if (current == -1 && frames[i].usable)
current = i;