This is an archive of the discontinued LLVM Phabricator instance.

[lldb][TypeSystemClang] Use the CXXFunctionPointerSummaryProvider for member-function pointers
ClosedPublic

Authored by Michael137 on Mar 3 2023, 6:29 AM.

Details

Summary

With this patch member-function pointers are formatted using
CXXFunctionPointerSummaryProvider.

This turns,

(lldb) v pointer_to_member_func
(void (Foo::*)()) ::pointer_to_member_func = 0x00000000000000000000000100003f94

into

(lldb) v pointer_to_member_func
(void (Foo::*)()) ::pointer_to_member_func = 0x00000000000000000000000100003f94 (a.out`Foo::member_func() at main.cpp:3)

Diff Detail

Event Timeline

Michael137 created this revision.Mar 3 2023, 6:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 3 2023, 6:29 AM
Michael137 requested review of this revision.Mar 3 2023, 6:29 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 3 2023, 6:29 AM
aprantl accepted this revision.Mar 3 2023, 8:30 AM

Nice.

lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
1394

The more often you are using this construct the more comfortable I'm getting with it :-)

This revision is now accepted and ready to land.Mar 3 2023, 8:30 AM
This revision was landed with ongoing or failed builds.Mar 3 2023, 9:45 AM
This revision was automatically updated to reflect the committed changes.

Looks like either this change or D125241 broke the Windows lldb bot: https://lab.llvm.org/buildbot/#/builders/83/builds/29800. Since it's been broken for a few days, if you can't address the failure soon, I'll go ahead and revert the changes to bring it back to green.

Michael137 added a comment.EditedMar 6 2023, 5:03 PM

Looks like either this change or D125241 broke the Windows lldb bot: https://lab.llvm.org/buildbot/#/builders/83/builds/29800. Since it's been broken for a few days, if you can't address the failure soon, I'll go ahead and revert the changes to bring it back to green.

Ah thanks for pointing it out. Thought I had fixed it with https://reviews.llvm.org/rG96e39fdbb90b26191fc79b6226f299e3c10e559b

Will check on my Windows machine. But feel free to revert, since I'm only going to be able to look at it tomorrow

Looks like either this change or D125241 broke the Windows lldb bot: https://lab.llvm.org/buildbot/#/builders/83/builds/29800. Since it's been broken for a few days, if you can't address the failure soon, I'll go ahead and revert the changes to bring it back to green.

Ah thanks for pointing it out. Thought I had fixed it with https://reviews.llvm.org/rG96e39fdbb90b26191fc79b6226f299e3c10e559b

Will check on my Windows machine. But feel free to revert, since I'm only going to be able to look at it tomorrow

The lldb bot I pointed you is not an arm buildbot, it's x64. Also the test you fixed is ast-types, but there were actually two failing tests - TestDataFormatterCpp.py is still failing.

This comment was removed by Michael137.
labath added a subscriber: labath.Mar 7 2023, 3:10 AM

You may want to check that pointers to virtual functions get printed here. In particular, that 0x00000000000000010000000000000000 (pointer to the first virtual function) does not get printed as nullptr or something like that (due to the truncation of the 128-bit value to zero).

Michael137 reopened this revision.Mar 7 2023, 7:56 AM
This revision is now accepted and ready to land.Mar 7 2023, 7:56 AM
Michael137 updated this revision to Diff 503055.Mar 7 2023, 8:14 AM
  • Rebase on latest test changes