This is an archive of the discontinued LLVM Phabricator instance.

[llvm-objdump] Support llvm-objdump -sj.foo
ClosedPublic

Authored by rupprecht on Mar 20 2019, 3:05 PM.

Details

Summary

r354375 added support for most objdump groupings, but didn't add support for -j|--sections, because that wasn't possible.
r355185 supported values for grouped options.

This just puts the two of them together. This supports -j in modes like -s -j .foo, -sj .foo, -sj=.foo, or -sj.foo.

Event Timeline

rupprecht created this revision.Mar 20 2019, 3:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 20 2019, 3:05 PM
jhenderson accepted this revision.Mar 21 2019, 3:11 AM

LGTM. I imagine that there might be more options like this, both in llvm-objdump and the other tools?

llvm/test/tools/llvm-objdump/section-filter.test
1

While you're modifying this test, would you mind normalising its use of '//' versus '#'? I actually don't think you need either, since nothing is using this file as an input apart from FileCheck, but I don't mind using one, as long as it's the same one.

This revision is now accepted and ready to land.Mar 21 2019, 3:11 AM
ikudrin accepted this revision.Mar 21 2019, 4:40 AM

LGTM.

rupprecht marked an inline comment as done.
  • Use // comments consistently

LGTM. I imagine that there might be more options like this, both in llvm-objdump and the other tools?

The only other alias in objdump that doesn't map to opt<bool> is --dissassembler-options (or -M), which is also a list<string>, so that should be fine to also include, although it's also comma delimited (-j is not), so I'll have to double check that it still works fine.

Ack - I'll also look to see if other tools need this, in a separate patch.

  • Also allow grouping of --disassembler-options
This revision was automatically updated to reflect the committed changes.