Page MenuHomePhabricator

Modify all register values whose byte size matches the address size to be formatter as eFormatAddressInfo.
ClosedPublic

Authored by clayborg on Jul 11 2022, 5:53 PM.

Details

Summary

This allows users to see similar output to what the "register read" command emits in LLDB's command line.

Added a test to verify that the PC has the correct value with contains a pointer followed by the module + function name and the source line info. Something like:

0x0000000100000a64 a.out`main + 132 at main.cpp:17:11

Diff Detail

Event Timeline

clayborg created this revision.Jul 11 2022, 5:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 11 2022, 5:53 PM
clayborg requested review of this revision.Jul 11 2022, 5:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 11 2022, 5:53 PM
yinghuitan added inline comments.Jul 11 2022, 9:44 PM
lldb/tools/lldb-vscode/lldb-vscode.cpp
1939–1950

The change looks good. But I do not think we should pay this cost during each stop. Can we only call this when user expands "registers" scope?

JDevlieghere added inline comments.Jul 12 2022, 3:31 PM
lldb/test/API/tools/lldb-vscode/variables/TestVSCode_variables.py
490–495
lldb/tools/lldb-vscode/lldb-vscode.cpp
1939

I'd make this const too, like num_reg_sets, otherwise it looks like this is meant to change.

clayborg updated this revision to Diff 444092.Jul 12 2022, 3:45 PM

Only change the format for registers in the first register set and only change the format if the format was eFormatDefault or eFormatHex.

clayborg marked 2 inline comments as done.Jul 12 2022, 3:46 PM
yinghuitan accepted this revision.Jul 12 2022, 5:17 PM
This revision is now accepted and ready to land.Jul 12 2022, 5:17 PM