Refactor remote register getters to collect them into a local
std::vector rather than adding them straight into DynamicRegisterInfo.
The purpose of this change is to lay groundwork for switching value_regs
and invalidate_regs to use local LLDB register numbers rather than
remote numbers.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
@labath, please tell me if you like this design. If it's ok, I'm going to convert the other routine to it, then move the conversion to DynamicRegisterInfo into a common function.
(also I haven't reformatted the code yet)
I like it.
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | ||
---|---|---|
4318–4321 | struct process_gdb_remote::RemoteRegisterInfo { should work too. Putting the declaration in the header would also be ok. |
Put the struct into the header. Put the common conversion and finalization code into a helper method. Use llvm::enumerate for local regnums. Convert qRegisterInfo getters.
Looks good, just be careful about sentinels.
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | ||
---|---|---|
571–578 | It looks like you're not doing it here. | |
4460–4461 | Can we avoid pushing the sentinel here? I'd hope this can be done during the conversion to the "RegisterInfo" format... | |
4597 | i.e., add a push(sentinel) here. |
It looks like you're not doing it here.