[Lldb-commits] [PATCH] D110025: [lldb] [gdb-remote] Refactor getting remote regs to use local vector

Michał Górny via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 23 07:07:58 PDT 2021


mgorny marked 3 inline comments as done.
mgorny added inline comments.


================
Comment at: lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp:4461-4464
+        if (!reg_info.value_regs.empty())
+          reg_info.value_regs.push_back(LLDB_INVALID_REGNUM);
+        if (!reg_info.invalidate_regs.empty())
+          reg_info.invalidate_regs.push_back(LLDB_INVALID_REGNUM);
----------------
labath wrote:
> Can we avoid pushing the sentinel here? I'd hope this can be done during the conversion to the "RegisterInfo" format...
Yes, that makes sense and reduces code duplication even more. Thanks!


================
Comment at: lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp:4602
+    uint32_t local_regnum = it.index();
+    RemoteRegisterInfo &remote_reg_info = it.value();
+    // Use remote regnum if available, previous remote regnum + 1 when not.
----------------
labath wrote:
> i.e., add a `push(sentinel)` here.
Hmm, actually you made me realize I'm pushing empty arrays instead of `nullptr` sometimes. Let's fix that as well.


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

https://reviews.llvm.org/D110025



More information about the lldb-commits mailing list