This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Add -m option to 'target modules dump symtab' to disable demangling
ClosedPublic

Authored by teemperor on Nov 7 2019, 5:08 AM.

Details

Summary

This option was added downstream in swift-lldb. This upstreams this option as it seems useful and also adds the missing tests.

Diff Detail

Event Timeline

teemperor created this revision.Nov 7 2019, 5:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 7 2019, 5:09 AM
teemperor added a project: Restricted Project.Nov 7 2019, 5:09 AM

I'll add a Windows-specific test as a follow-up (because that test will probably involve fixing the Windows bot and I don't want this reverted).

kwk accepted this revision.Nov 7 2019, 5:19 AM
kwk added a subscriber: kwk.

LGTM with the exception of a local variable name.

lldb/source/Commands/CommandObjectTarget.cpp
2008

How about calling this variable name_preference?

This revision is now accepted and ready to land.Nov 7 2019, 5:19 AM
labath added a subscriber: labath.Nov 7 2019, 5:20 AM

You could just make a YAML file with some symbols inside. That would isolate you from any host mangling specifics (which I think is a good thing, as this test is really about the command line option, and not mangling).

kwk added inline comments.Nov 7 2019, 5:20 AM
lldb/source/Commands/Options.td
8

Does it make sense to tell what the default is here?

teemperor updated this revision to Diff 228229.Nov 7 2019, 6:23 AM
  • Renamed variable.
  • Now using yaml2obj
teemperor requested review of this revision.Nov 7 2019, 6:29 AM
teemperor marked an inline comment as done.
teemperor added inline comments.
lldb/source/Commands/Options.td
8

It seems to me this is implied because this option is only offering to turn it off.

labath accepted this revision.Nov 7 2019, 6:35 AM

BTW, is it possible to prune the yaml to remove the stuff irrelevant for the test? I'm not that familiar with how macho2yaml works, but the equivalent elf representation of this can be as short as:

--- !ELF
FileHeader:
  Class:           ELFCLASS64
  Data:            ELFDATA2LSB
  Type:            ET_REL
  Machine:         EM_X86_64
Sections:
  - Name:            .text
    Type:            SHT_PROGBITS
    Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
    AddressAlign:    0x0000000000000010
    Content:         554889E5897DFC5DC3
Symbols:
  - Name:            _ZN3foo3barEi
    Type:            STT_FUNC
    Section:         .text
    Size:            0x0000000000000009
...
This revision is now accepted and ready to land.Nov 7 2019, 6:35 AM
teemperor updated this revision to Diff 228235.Nov 7 2019, 6:46 AM
  • Blatantly steal Pavel's yaml file as MachO seems very verbose.
This revision was automatically updated to reflect the committed changes.