This is an archive of the discontinued LLVM Phabricator instance.

[lldb][test] TestDataFormatterCpp.py: add test-case for member function pointer format
ClosedPublic

Authored by Michael137 on Mar 7 2023, 4:12 AM.

Details

Summary

This patch adds a test for formatting of member function pointers.
This was split from D145242 and D145241, which caused
this test case to fail on Windows buildbots.

I split this out in order to make sure that this indeed works on Windows
without the above patches.

Diff Detail

Event Timeline

Michael137 created this revision.Mar 7 2023, 4:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 7 2023, 4:12 AM
Michael137 requested review of this revision.Mar 7 2023, 4:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 7 2023, 4:12 AM
Michael137 edited the summary of this revision. (Show Details)Mar 7 2023, 4:13 AM
labath added inline comments.Mar 7 2023, 4:43 AM
lldb/test/API/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
301

If this godbolt is right, then this won't work. Encoding of member pointers is abi-dependant, and it seems that MSVC encodes them as regular pointers to thunk functions (instead of these fancy tagged unions).

Come to think of it... I'm not sure why everyone doesn't do it that way...

Michael137 added inline comments.Mar 7 2023, 4:52 AM
lldb/test/API/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
301

Ah good point. Testing this here in this patch isn't necessary anyway. I'll add it back in the follow-up patches

Michael137 updated this revision to Diff 502993.Mar 7 2023, 4:53 AM
  • Remove virtual function pointer test for now
labath accepted this revision.Mar 7 2023, 5:44 AM
  • Remove virtual function pointer test for now

You can keep it in, I think. Just don't assert the value of the last byte of the pointer.

This revision is now accepted and ready to land.Mar 7 2023, 5:44 AM
Michael137 updated this revision to Diff 503021.Mar 7 2023, 6:17 AM
  • Add back simplified virtual function ptr assertion
This revision was landed with ongoing or failed builds.Mar 7 2023, 6:18 AM
This revision was automatically updated to reflect the committed changes.

Ok it looks like this is still failing on Windows...
I can't repro it on my Windows machine either so I'll split this test out and skip it