[PATCH] D102603: [llvm-objdump] Print the DEBUG type under `--section-headers`.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 25 01:07:53 PDT 2021


jhenderson added a comment.

Seems to me like this is two separate patches now: 1) adding generic DEBUG printing support to llvm-objdump, then 2) adding XCOFF recognition of debug section types.



================
Comment at: llvm/test/tools/llvm-objdump/XCOFF/section-headers-truncate.test:2
+# RUN: not llvm-objdump --section-headers 2>&1 \
+# RUN: %p/Inputs/xcoff-section-headers-truncate.o | FileCheck \
+# RUN: --check-prefix=ERROR %s
----------------
You can avoid a new canned binary here by using python to truncate another file. See for example llvm/test/tools/llvm-objcopy/ELF/invalid-e_phoff.test for an example of how to do this.


================
Comment at: llvm/test/tools/llvm-objdump/XCOFF/section-headers.test:24
+  - Name:               .text
+    Size:               0x8
+    Flags:              [ STYP_TEXT ]
----------------
We probably need to add addresses to some of these too. If memory serves correctly, ELF yaml2obj auto-increments addresses for allocatable sections, if an adderss is not explicitly specified. Perhaps a similar feature could be added to XCOFF yaml2obj in a separate patch? What do you think? In the meantime, the addresses can presumably be done manually here.


================
Comment at: llvm/test/tools/llvm-objdump/section-headers.test:145-146
+
+## Check that the `--section-headers/-h` option prints the types of 
+## section headers correctly.
+
----------------
I don't think we need an entirely new dedicated test case here. I think you would be better off expanding the first yaml doc in this file to cover the new DEBUG type and a case with multiple types (to pick up the separator change), and then just updating the first set of checks.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102603



More information about the llvm-commits mailing list