[PATCH] D113106: demangle xcoff label symbol for llvm-nm

Digger Lin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 7 12:44:23 PST 2021


DiggerLin marked 5 inline comments as done.
DiggerLin added inline comments.


================
Comment at: llvm/test/tools/llvm-nm/XCOFF/demangle.test:17
+
+# NM-DEMANGLE:      00000000 t
+# NM-DEMANGLE-NEXT: 00000040 T .func1(int)
----------------
jhenderson wrote:
> I'd suggest doing one of the following:
> 1) adding --match-full-lines to your FileCheck command here
> 2) omitting the symbol value and adding `{{$}}` to the end of the symbol (omitting the symbol value removes noise from the test).
> 
> This will prevent this line accidentally matching another symbol with a name. It will also ensure the demangling output looks right on other lines.
 there is no symbol value in the test . it is symbol address.


================
Comment at: llvm/test/tools/llvm-nm/XCOFF/demangle.test:20
+# NM-DEMANGLE-NEXT: 00000000 t .func0()
+# NM-DEMANGLE-NEXT: 00000120 b .bss
+# NM-DEMANGLE-NEXT: 00000100 d .data
----------------
jhenderson wrote:
> This test is purely about demangling functionality. Aside from having a single test-case where a symbol isn't demangled, I don't think you need all these other cases that don't demangle.
> 
> Similarly, you can omit most of the test cases where demangling does occur, as long as you have one per code path.
> 
> I think the following set of test cases is all you should have - ignore the other symbols (or more preferably just rebase this patch on top of @Esme's yaml2obj work, so that you can use yaml2obj to generate exactly the right set of symbols):
> # Empty name
> # Name consisting solely of `.`
> # Name starting with `.` that can't be demangled
> # Name starting with `.` that can be demangled
> # Name not starting with `.` that can't be demangled
> # Name not starting with `.` that can be demangled
1. as I mentioned before, yaml2obj do not support an empty symbol.
2. I will reuse the test_xlclang.o which provided in the  https://reviews.llvm.org/D112450 to test empty symbol
3. when yam22obj, I will create to delete the test and add the empty name to test demangle_sym_name.test


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113106/new/

https://reviews.llvm.org/D113106



More information about the llvm-commits mailing list