summaryrefslogtreecommitdiffstats
path: root/app/perfsymboltable.h
diff options
context:
space:
mode:
authorMilian Wolff <milian.wolff@kdab.com>2018-10-20 12:20:29 +0200
committerMilian Wolff <milian.wolff@kdab.com>2018-10-23 18:35:35 +0000
commitc1c830abb5e87cf0441f6732f5cbd953d59f1c5b (patch)
tree59828bca7c65bd1af675b756c4ef836c9a85f95c /app/perfsymboltable.h
parent573f54d94c7f476d9604e037a7763cab627662a6 (diff)
Report base mapping to dwfl when we need the module for an pgoff mmap
Previously, we would just error out when we encounter an address in an mmaped elf with pgoff != 0. E.g. for the following mmap events: 0x7f5d69432000 to 0x7f5d6957d000, len = 0x14b000, offset = 0, virt start = 0x7f5d69432000 r--p /usr/lib/libQt5Widgets.so.5.11.2 0x7f5d6957d000 to 0x7f5d6990e000, len = 0x391000, offset = 0x14b000, virt start = 0x7f5d69432000 r-xp /usr/lib/libQt5Widgets.so.5.11.2 0x7f5d6990e000 to 0x7f5d69a61000, len = 0x153000, offset = 0x4dc000, virt start = 0x7f5d69432000 r--p /usr/lib/libQt5Widgets.so.5.11.2 0x7f5d69a61000 to 0x7f5d69a93000, len = 0x32000, offset = 0x62e000, virt start = 0x7f5d69433000 r--p /usr/lib/libQt5Widgets.so.5.11.2 0x7f5d69a93000 to 0x7f5d69a94000, len = 0x1000, offset = 0x660000, virt start = 0x7f5d69433000 rw-p /usr/lib/libQt5Widgets.so.5.11.2 We sometimes requested the module for the second to last mmap from memoryRead/accessDsoMem, leading to the dreaded "failed to report" error message due to pgoff != 0. This patch now introduces a trivial time-based association to the base map with pgoff = 0 when the originalPath matches. This allows us to use the address of the first mmap event above when we encounter an address in the second to last mmap, fixing the notorious error and unbreaking some broken backtraces. Task-number: QTCREATORBUG-21260 Change-Id: I4bc5b4e5b23973e4ba8cf68389fa813208d20867 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'app/perfsymboltable.h')
-rw-r--r--app/perfsymboltable.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/perfsymboltable.h b/app/perfsymboltable.h
index c85edaa..b01268a 100644
--- a/app/perfsymboltable.h
+++ b/app/perfsymboltable.h
@@ -58,9 +58,6 @@ public:
PerfElfMap::ElfInfo findElf(quint64 ip) const;
- // Report an mmap to dwfl and parse it for symbols and inlines, or simply return it if dwfl has
- // it already
- Dwfl_Module *reportElf(const PerfElfMap::ElfInfo& elf);
// Find the module for the given address and report it if needed
Dwfl_Module *module(quint64 addr);
Dwfl_Module *module(quint64 addr, const PerfElfMap::ElfInfo &elf);
@@ -80,6 +77,9 @@ public:
bool cacheIsDirty() const { return m_cacheIsDirty; }
private:
+ // Report an mmap to dwfl and parse it for symbols and inlines, or simply return it if dwfl has
+ // it already
+ Dwfl_Module *reportElf(const PerfElfMap::ElfInfo& elf);
QFileInfo findFile(const char *path, const QString &fileName,
const QByteArray &buildId = QByteArray()) const;