This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Add setting to override PE/COFF ABI by module name
ClosedPublic

Authored by alvinhochun on Jun 7 2022, 10:37 AM.

Details

Summary

The setting plugin.object-file.pe-coff.module-abi is a string-to-enum
map that allows specifying an ABI to a module name. For example:

ucrtbase.dll=msvc
libstdc++-6.dll=gnu

This allows for debugging a process which mixes both modules built using
the MSVC ABI and modules built using the MinGW ABI.

Depends on D127048

Diff Detail

Event Timeline

alvinhochun created this revision.Jun 7 2022, 10:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 7 2022, 10:37 AM
Herald added a subscriber: mstorsjo. · View Herald Transcript
alvinhochun requested review of this revision.Jun 7 2022, 10:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 7 2022, 10:37 AM
mstorsjo added a reviewer: omjavaid.EditedJun 9 2022, 3:35 AM

(I guess this one might need some updates after D127048 is finalized?)

Edit: Doesn't seem so, there hadn't been any further updates to the preceding patch - sorry for the noise.

Rebased patch

DavidSpickett added a subscriber: DavidSpickett.
DavidSpickett added inline comments.
lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFFProperties.td
13

What are the values accepted for this?

lldb/test/Shell/ObjectFile/PECOFF/settings-abi.yaml
40

You should test that UPPER_CASE and UPPER_CASE.debug still find the module abi.

I think you could test the priority order too.

Start with 1 setting foo=msvc, check it gets msvc.
Add the next highest priority Foo=gnu, check it gets gnu.
Remove foo=msvc, add the next highest priority as foo.debug=msvc, check it gets msvc.
Remove Foo=gnu and add Foo.debug=gnu, check it gets gnu.

At each stage you're proving that it'll choose one of a pair, put that all together you've proved the order overall.

alvinhochun added inline comments.Jun 20 2022, 9:26 AM
lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFFProperties.td
13

It's the same enum as the setting plugin.object-file.pe-coff.abi added in D127048 - default, msvc and gnu.

DavidSpickett added inline comments.Jun 21 2022, 12:48 AM
lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFFProperties.td
13

Which makes sense but the user isn't always going to see both descriptions so I'd repeat that information here.

Added test and improved setting description as suggested.

This revision is now accepted and ready to land.Jun 22 2022, 1:49 AM
This revision was automatically updated to reflect the committed changes.