summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilian Wolff <milian.wolff@kdab.com>2018-04-12 12:40:02 +0200
committerUlf Hermann <ulf.hermann@qt.io>2019-05-03 12:42:57 +0000
commit123e9bd37a133ab5c085a83f50e06da565cf924f (patch)
tree95e0d1756936676fb238f50f887d2727fc874c21
parent996e2006dd0b76aff7e601fe3d1386186ef998bd (diff)
Also check for debug link files next to the executable directly
The old code only checked for the folder layout in the ~/.debug cache, where the files get cached by their build-id. If that does not happen, then we failed to find the debug link file when it lies next to the actual file. This patch fixes that. Change-Id: I7411a6d8803c1787a3c76db77aeec30400208565 Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
-rw-r--r--app/perfsymboltable.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/app/perfsymboltable.cpp b/app/perfsymboltable.cpp
index 73bb3e9..9f81a62 100644
--- a/app/perfsymboltable.cpp
+++ b/app/perfsymboltable.cpp
@@ -535,19 +535,38 @@ static QFileInfo findDebugInfoFile(const QString &root, const QString &file,
const QString &debugLinkString)
{
auto dir = QFileInfo(root).dir();
+ const auto folder = QFileInfo(file).path();
+
QFileInfo debugLinkFile;
+
+ if (!folder.isEmpty()) {
+ debugLinkFile.setFile(dir, folder + QDir::separator() + debugLinkString);
+ if (debugLinkFile.isFile())
+ return debugLinkFile;
+ }
+
debugLinkFile.setFile(dir, file + QDir::separator() + debugLinkString);
if (debugLinkFile.isFile())
return debugLinkFile;
+
// try again in .debug folder
+ if (!folder.isEmpty()) {
+ debugLinkFile.setFile(dir, folder + QDir::separator() + QLatin1String(".debug")
+ + QDir::separator() + debugLinkString);
+ if (debugLinkFile.isFile())
+ return debugLinkFile;
+ }
+
debugLinkFile.setFile(dir, file + QDir::separator() + QLatin1String(".debug")
+ QDir::separator() + debugLinkString);
if (debugLinkFile.isFile())
return debugLinkFile;
+
// try again in /usr/lib/debug folder
debugLinkFile.setFile(dir, QLatin1String("usr") + QDir::separator() + QLatin1String("lib")
- + QDir::separator() + QLatin1String("debug") + QDir::separator() + QFileInfo(file).path()
+ + QDir::separator() + QLatin1String("debug") + QDir::separator() + folder
+ QDir::separator() + debugLinkString);
+
return debugLinkFile;
}