[PATCH] D130359: [llvm-objdump, ARM] Make dumpARMELFData line up with instructions.
Simon Tatham via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 26 01:35:56 PDT 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1bc7b06ffd9b: [llvm-objdump,ARM] Make dumpARMELFData line up with instructions. (authored by simon_tatham).
Changed prior to commit:
https://reviews.llvm.org/D130359?vs=446825&id=447621#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D130359/new/
https://reviews.llvm.org/D130359
Files:
llvm/test/tools/llvm-objdump/ELF/AArch64/disassemble-align.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
@@ -994,12 +994,14 @@
uint64_t End, const ObjectFile &Obj,
ArrayRef<uint8_t> Bytes,
ArrayRef<MappingSymbolPair> MappingSymbols,
- raw_ostream &OS) {
+ const MCSubtargetInfo &STI, raw_ostream &OS) {
support::endianness Endian =
Obj.isLittleEndian() ? support::little : support::big;
- OS << format("%8" PRIx64 ":\t", SectionAddr + Index);
+ size_t Start = OS.tell();
+ OS << format("%8" PRIx64 ": ", SectionAddr + Index);
if (Index + 4 <= End) {
dumpBytes(Bytes.slice(Index, 4), OS);
+ AlignToInstStartColumn(Start, STI, OS);
OS << "\t.word\t"
<< format_hex(support::endian::read32(Bytes.data() + Index, Endian),
10);
@@ -1007,13 +1009,14 @@
}
if (Index + 2 <= End) {
dumpBytes(Bytes.slice(Index, 2), OS);
- OS << "\t\t.short\t"
- << format_hex(support::endian::read16(Bytes.data() + Index, Endian),
- 6);
+ AlignToInstStartColumn(Start, STI, OS);
+ OS << "\t.short\t"
+ << format_hex(support::endian::read16(Bytes.data() + Index, Endian), 6);
return 2;
}
dumpBytes(Bytes.slice(Index, 1), OS);
- OS << "\t\t.byte\t" << format_hex(Bytes[Index], 4);
+ AlignToInstStartColumn(Start, STI, OS);
+ OS << "\t.byte\t" << format_hex(Bytes[Index], 4);
return 1;
}
@@ -1606,7 +1609,7 @@
if (DumpARMELFData) {
Size = dumpARMELFData(SectionAddr, Index, End, Obj, Bytes,
- MappingSymbols, FOS);
+ MappingSymbols, *STI, FOS);
} else {
// When -z or --disassemble-zeroes are given we always dissasemble
// them. Otherwise we might want to skip zero bytes we see.
Index: llvm/test/tools/llvm-objdump/ELF/AArch64/disassemble-align.s
===================================================================
--- llvm/test/tools/llvm-objdump/ELF/AArch64/disassemble-align.s
+++ llvm/test/tools/llvm-objdump/ELF/AArch64/disassemble-align.s
@@ -7,7 +7,7 @@
# CHECK-NEXT: 4: d503201f |nop
# CHECK-EMPTY:
# CHECK-NEXT:0000000000000008 <$d.1>:
-# CHECK-NEXT: 8:|ff ff 00 00|.word|0x0000ffff
+# CHECK-NEXT: 8: ff ff 00 00 |.word|0x0000ffff
add x2, x3, #4
nop
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130359.447621.patch
Type: text/x-patch
Size: 2588 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220726/d2b63493/attachment.bin>
More information about the llvm-commits
mailing list