[PATCH] D45477: AMDGPU/MC: Allow disassembling without symbol info
Nicolai Hähnle via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 10 01:45:28 PDT 2018
nhaehnle created this revision.
nhaehnle added reviewers: arsenm, rampitec, artem.tamazov, dp.
Herald added subscribers: t-tye, tpr, dstuttard, yaxunl, wdng, kzhuravl.
We would like the UMR debugging tool[0] to be able to provide
disassembly for currently live waves based on plain memory
dumps, and we want to leverage the LLVM disassembler for this.
This mostly works, except that UMR clearly can't provide real
symbol info, so it wants to set DisInfo == nullptr.
[0] https://cgit.freedesktop.org/amd/umr/
Repository:
rL LLVM
https://reviews.llvm.org/D45477
Files:
lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
Index: lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
===================================================================
--- lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
+++ lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
@@ -882,6 +882,9 @@
}
auto *Symbols = static_cast<SectionSymbolsTy *>(DisInfo);
+ if (!Symbols)
+ return false;
+
auto Result = std::find_if(Symbols->begin(), Symbols->end(),
[Value](const SymbolInfoTy& Val) {
return std::get<0>(Val) == static_cast<uint64_t>(Value)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45477.141806.patch
Type: text/x-patch
Size: 589 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180410/de777c27/attachment.bin>
More information about the llvm-commits
mailing list