[PATCH] D102603: [llvm-objdump] Print the DEBUG type under `--section-headers`.
EsmeYi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 26 21:54:08 PDT 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGd82f2a123f9c: [llvm-objdump] Print the DEBUG type under `--section-headers`. (authored by Esme).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102603/new/
https://reviews.llvm.org/D102603
Files:
llvm/test/tools/llvm-objdump/section-headers.test
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
@@ -1764,9 +1764,11 @@
std::string Type = Section.isText() ? "TEXT" : "";
if (Section.isData())
- Type += Type.empty() ? "DATA" : " DATA";
+ Type += Type.empty() ? "DATA" : ", DATA";
if (Section.isBSS())
- Type += Type.empty() ? "BSS" : " BSS";
+ Type += Type.empty() ? "BSS" : ", BSS";
+ if (Section.isDebugSection())
+ Type += Type.empty() ? "DEBUG" : ", DEBUG";
if (HasLMAColumn)
outs() << format("%3" PRIu64 " %-*s %08" PRIx64 " ", Idx, NameWidth,
Index: llvm/test/tools/llvm-objdump/section-headers.test
===================================================================
--- llvm/test/tools/llvm-objdump/section-headers.test
+++ llvm/test/tools/llvm-objdump/section-headers.test
@@ -15,6 +15,8 @@
# WHITESPACE-NEXT: {{^}} 2 .data 00000000 0000000000000000 0000000000000000 DATA{{$}}
# WHITESPACE-NEXT: {{^}} 3 .bss 00000000 0000000000000000 0000000000000000 BSS{{$}}
# WHITESPACE-NEXT: {{^}} 4 .other 00000000 0000000000000000 0000000000000000 {{$}}
+# WHITESPACE-NEXT: {{^}} 5 .debug_abbrev 00000000 0000000000000000 0000000000000000 DEBUG{{$}}
+# WHITESPACE-NEXT: {{^}} 6 .debug_info 00000000 0000000000000000 0000000000000000 DATA, DEBUG{{$}}
# WHITESPACE-NO-LMA: {{^}}Sections:{{$}}
# WHITESPACE-NO-LMA-NEXT: {{^}}Idx Name Size VMA Type{{$}}
@@ -23,6 +25,8 @@
# WHITESPACE-NO-LMA-NEXT: {{^}} 2 .data 00000000 0000000000000000 DATA{{$}}
# WHITESPACE-NO-LMA-NEXT: {{^}} 3 .bss 00000000 0000000000000000 BSS{{$}}
# WHITESPACE-NO-LMA-NEXT: {{^}} 4 .other 00000000 0000000000000000 {{$}}
+# WHITESPACE-NO-LMA-NEXT: {{^}} 5 .debug_abbrev 00000000 0000000000000000 DEBUG{{$}}
+# WHITESPACE-NO-LMA-NEXT: {{^}} 6 .debug_info 00000000 0000000000000000 DATA, DEBUG{{$}}
--- !ELF
FileHeader:
@@ -42,6 +46,11 @@
Flags: [SHF_ALLOC, SHF_WRITE]
- Name: .other
Type: SHT_REL
+ - Name: .debug_abbrev
+ Type: SHT_PROGBITS
+ - Name: .debug_info
+ Type: SHT_PROGBITS
+ Flags: [ SHF_WRITE, SHF_ALLOC ]
## The name field automatically expands past the default 13 columns when a
## section name is longer than that.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102603.348159.patch
Type: text/x-patch
Size: 2408 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210527/b409fd4c/attachment.bin>
More information about the llvm-commits
mailing list