This is an archive of the discontinued LLVM Phabricator instance.

[LLDB] Support GDB remote g packet partial read
ClosedPublic

Authored by omjavaid on Feb 25 2021, 1:50 PM.

Details

Summary

GDB remote protocol does not specify length of g packet for register read. It depends on remote to include all or exclude certain registers from g packet. In case a register or set of registers is not included as part of g packet then we should fall back to p packet for reading all registers excluded from g packet by remote. This patch adds support for above feature and adds a test-case for the same.

Diff Detail

Event Timeline

omjavaid requested review of this revision.Feb 25 2021, 1:50 PM
omjavaid created this revision.
labath accepted this revision.Mar 2 2021, 12:29 AM

Seems reasonable. I think the names like m_read_all_at_once and ReadAllRegisters will now be somewhat confusing. Maybe it would be worth (in a separate patch) renaming them to something which does not include "all" in the name.
Maybe we could use m_use_g_packet_for_reading/writing instead of m_read/write_all_at_once. I'm not sure what would be a good name for ReadAllRegisters... Gdb docs describe the g packet as "Read general registers" so maybe just ReadGeneralRegisters with some comment that this may in fact include all of them?

This revision is now accepted and ready to land.Mar 2 2021, 12:29 AM
This revision was landed with ongoing or failed builds.Mar 2 2021, 4:24 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 2 2021, 4:24 AM