[PATCH] D77957: [llvm-objdump] Demangle C++ Symbols in branch and call targets
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Apr 18 08:37:20 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rGcacf1b509327: [llvm-objdump] Demangle C++ Symbols in branch and call targets (authored by zero9178, committed by MaskRay).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77957/new/
https://reviews.llvm.org/D77957
Files:
llvm/test/tools/llvm-objdump/X86/demangle.s
llvm/tools/llvm-objdump/llvm-objdump.cpp
Index: llvm/tools/llvm-objdump/llvm-objdump.cpp
===================================================================
--- llvm/tools/llvm-objdump/llvm-objdump.cpp
+++ llvm/tools/llvm-objdump/llvm-objdump.cpp
@@ -1556,7 +1556,10 @@
if (TargetSym != TargetSectionSymbols->begin()) {
--TargetSym;
uint64_t TargetAddress = TargetSym->Addr;
- StringRef TargetName = TargetSym->Name;
+ std::string TargetName = TargetSym->Name.str();
+ if (Demangle)
+ TargetName = demangle(TargetName);
+
outs() << " <" << TargetName;
uint64_t Disp = Target - TargetAddress;
if (Disp)
Index: llvm/test/tools/llvm-objdump/X86/demangle.s
===================================================================
--- llvm/test/tools/llvm-objdump/X86/demangle.s
+++ llvm/test/tools/llvm-objdump/X86/demangle.s
@@ -11,7 +11,7 @@
## Check the case when relocations are inlined into disassembly.
# RUN: llvm-objdump -d -r --demangle %t | FileCheck %s --check-prefix=INLINE
# INLINE: <foo()>:
-# INLINE-NEXT: 0: {{.*}} callq 0x5 <_Z3foov+0x5>
+# INLINE-NEXT: 0: {{.*}} callq 0x5 <foo()+0x5>
# INLINE-NEXT: 0000000000000001: R_X86_64_PLT32 foo()-0x4
.text
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77957.258524.patch
Type: text/x-patch
Size: 1281 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200418/854d4c00/attachment.bin>
More information about the llvm-commits
mailing list