[Lldb-commits] [PATCH] D110027: [lldb] [gdb-remote] Use local regnos for value_regs/invalidate_regs

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 20 00:31:30 PDT 2021


labath added inline comments.


================
Comment at: lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp:4684
+    std::map<uint32_t, uint32_t> remote_to_local_map;
     for (RemoteRegisterInfo& remote_reg_info : registers) {
+      // Assign successive remote regnums if missing.
----------------
drop `local_regnum` and use `llvm::enumerate`


================
Comment at: lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp:4699
+      for (uint32_t &x : remote_reg_info.value_regs) {
+        if (x != LLDB_INVALID_REGNUM)
+          x = remote_to_local_map[x];
----------------
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).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110027/new/

https://reviews.llvm.org/D110027



More information about the lldb-commits mailing list