This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [gdb-remote] Use local regnos for value_regs/invalidate_regs
ClosedPublic

Authored by mgorny on Sep 18 2021, 1:49 PM.

Details

Summary

Switch the gdb-remote client logic to use local (LLDB) register numbers
in value_regs/invalidate_regs rather than remote regnos. This involves
translating regnos received from lldb-server.

Diff Detail

Event Timeline

mgorny requested review of this revision.Sep 18 2021, 1:49 PM
mgorny created this revision.
labath added inline comments.Sep 20 2021, 12:31 AM
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
4667–4668

drop local_regnum and use llvm::enumerate

4681

Why should we have LLDB_INVALID_REGNUM in this list?

I think that a more interesting question is what to do if the value is not located in the remote_to_local_map. This will map it to zero, which isn't very useful. I suppose we could just drop this value -- this is something that was probably happening already (if we weren't just crashing).

mgorny updated this revision to Diff 373538.Sep 20 2021, 3:33 AM
mgorny marked 2 inline comments as done.

Rebase. Apply suggested changes.

labath added inline comments.Sep 21 2021, 1:35 AM
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
4614

auto :)

4621–4624

Make this a lambda and then do llvm::transform(remote_reg_info.invalidate_regs, remote_reg_info.invalidate_regs.begin(), lambda)

mgorny updated this revision to Diff 373814.Sep 21 2021, 2:24 AM
mgorny marked 2 inline comments as done.

Both requests implemented.

labath accepted this revision.Sep 23 2021, 3:49 AM

cool

This revision is now accepted and ready to land.Sep 23 2021, 3:49 AM
This revision was landed with ongoing or failed builds.Sep 23 2021, 8:22 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptSep 23 2021, 8:22 AM