Add a convenience method to add supplementary registers that takes care
of adding invalidate_regs to all (potentially) overlapping registers.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Currently it's still using process plugin regnums in value_regs/invalidate_regs; I'm going to try changing that next.
lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp | ||
---|---|---|
448 | How about by making sure that LLDB_INVALID_REGNUM is not present in the firstplace (by adding it only during finalization)? |
Rebased. Updated the code to assume dedupe and cleanup happens in Finalize(), and to use new test assertions.
I think this is fine. The tricky thing will be deciding what to do with the x86 and arm registers which start at non-zero offsets (ah et al.)
One thing I was considering was doing this addition while were still in the original "vector of strings" form instead of this C thingy. The tricky part there is that (since this in would be the ABI classes which do this manipulation) we would need to expose the gdb-remote struct to the outside world. I don't think that would be necessarily bad (we just wouldn't call it "RemoteRegisterInfo, but something else), but it's not clear to me whether its worth the churn. Still, I think it's worth keeping this in the back of your mind as you work on this.
lldb/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp | ||
---|---|---|
439 | Maybe call this new_invalidates? I've found it hard to track what to_add means, with all the mixing of value_regs and invalidates... | |
441–442 | Is this still needed? | |
455 | This would be a good use case for (const) auto, as value_type does not say much anyway. | |
lldb/unittests/Process/Utility/DynamicRegisterInfoTest.cpp | ||
159–165 | Could we remove ah from this test, as its offset is going to be wrong? |
Maybe call this new_invalidates? I've found it hard to track what to_add means, with all the mixing of value_regs and invalidates...