This is an archive of the discontinued LLVM Phabricator instance.

[llvm-objdump] Improve newline consistency between different pieces of information
ClosedPublic

Authored by MaskRay on May 3 2021, 4:15 PM.

Details

Summary

When dumping multiple pieces of information (e.g. --all-headers),
there is sometimes no separator between two pieces.
This patch uses the "\nheader:\n" style, which generally improves
compatibility with GNU objdump.

Note: objdump -t/-T does not add a newline before "SYMBOL TABLE:" and "DYNAMIC SYMBOL TABLE:".
We add a newline to be consistent with other information.

objdump -d prints two empty lines before the first 'Disassembly of section'.
We print just one with this patch.

Diff Detail

Event Timeline

MaskRay created this revision.May 3 2021, 4:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 3 2021, 4:15 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
MaskRay requested review of this revision.May 3 2021, 4:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 3 2021, 4:15 PM
jhenderson accepted this revision.May 4 2021, 1:52 AM

Generally looks good to me. Are all the changes covered by testing? I struggled a little to follow the impact of the changes, and didn't necessarily see the sort of testing I'd have expected, given the changes (e.g. "Dynamic Section:" preceded by a CHECK-EMPTY or equivalent).

llvm/test/tools/llvm-objdump/all-headers.test
12–13

Indentation looks a bit off between these two lines.

This revision is now accepted and ready to land.May 4 2021, 1:52 AM
MaskRay updated this revision to Diff 342782.May 4 2021, 9:52 AM
MaskRay marked an inline comment as done.

improve test

This revision was landed with ongoing or failed builds.May 4 2021, 9:56 AM
This revision was automatically updated to reflect the committed changes.