diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2022-12-05 10:04:36 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2022-12-05 10:18:27 +0000 |
commit | 0e9d09e73279d0e1d9052810b1aea4fcc7915a72 (patch) | |
tree | 422070e90155de7f1b31784ae46553d0983ea354 | |
parent | ab22c8582c9edec450a30edf316b078cfb10b09f (diff) |
Make findDebugInfoFile() accessible from the test9.0
If it's static in perfsymboltable.cpp's file scope, we cannot use it
from anywhere else.
Change-Id: I60ac203120b7c88feff2acb26b224a8761469bf8
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
-rw-r--r-- | app/perfsymboltable.cpp | 5 | ||||
-rw-r--r-- | app/perfsymboltable.h | 3 | ||||
-rw-r--r-- | tests/auto/finddebugsym/tst_finddebugsym.cpp | 5 |
3 files changed, 8 insertions, 5 deletions
diff --git a/app/perfsymboltable.cpp b/app/perfsymboltable.cpp index bdadf0c..e3737d5 100644 --- a/app/perfsymboltable.cpp +++ b/app/perfsymboltable.cpp @@ -343,8 +343,9 @@ Dwfl_Module *PerfSymbolTable::module(quint64 addr, const PerfElfMap::ElfInfo &el return reportElf(elf); } -static QFileInfo findDebugInfoFile(const QString &root, const QString &file, - const QString &debugLinkString) +QFileInfo PerfSymbolTable::findDebugInfoFile( + const QString &root, const QString &file, + const QString &debugLinkString) { auto dir = QFileInfo(root).dir(); const auto folder = QFileInfo(file).path(); diff --git a/app/perfsymboltable.h b/app/perfsymboltable.h index 366c9f5..27ba205 100644 --- a/app/perfsymboltable.h +++ b/app/perfsymboltable.h @@ -44,6 +44,9 @@ public: PerfSymbolTable(qint32 pid, Dwfl_Callbacks *callbacks, PerfUnwind *parent); ~PerfSymbolTable(); + static QFileInfo findDebugInfoFile( + const QString& root, const QString& file, const QString& debugLinkString); + struct PerfMapSymbol { PerfMapSymbol(quint64 start = 0, quint64 length = 0, QByteArray name = QByteArray()) : start(start), length(length), name(name) {} diff --git a/tests/auto/finddebugsym/tst_finddebugsym.cpp b/tests/auto/finddebugsym/tst_finddebugsym.cpp index c298749..fb45852 100644 --- a/tests/auto/finddebugsym/tst_finddebugsym.cpp +++ b/tests/auto/finddebugsym/tst_finddebugsym.cpp @@ -29,8 +29,6 @@ #include "perfsymboltable.h" -QFileInfo findDebugInfoFile(const QString& root, const QString& file, const QString& debugLinkString); - class TestFindDebugSymbols : public QObject { Q_OBJECT @@ -86,7 +84,8 @@ private slots: QFETCH(QString, file); QFETCH(QString, debugLinkString); - auto debugFile = findDebugInfoFile(tempDir.path() + QDir::separator(), root, file); + auto debugFile = PerfSymbolTable::findDebugInfoFile( + tempDir.path() + QDir::separator(), root, file); QCOMPARE(debugFile.absoluteFilePath(), QFileInfo(tempDir.path() + debugLinkString).absoluteFilePath()); } |