labath added inline comments.

================
Comment at: 
lldb/source/Plugins/Process/FreeBSDRemote/NativeRegisterContextFreeBSD_x86_64.cpp:563-569
     ::memcpy(m_gpr.data() + reg_info->byte_offset, reg_value.GetBytes(),
              reg_value.GetByteSize());
     return WriteRegisterSet(set);
   case FPRegSet:
+    ::memcpy(m_fpr.data() + reg_info->byte_offset - GetFPROffset(),
+             reg_value.GetBytes(), reg_value.GetByteSize());
+    return WriteRegisterSet(set);
----------------
mgorny wrote:
> labath wrote:
> > what if m_gpr and m_fpr were actually a single concatenated buffer? Could 
> > we then ditch GetFPROffset and just have a single memcpy here?
> We'd need `GetFPROffset()` for ptrace calls then ;-). I've got an another 
> idea ready, just need to wait for some free RAM to test it. That said, we 
> might reach the point where combining all these diffs is easier than 
> reviewing them separately.
> We'd need GetFPROffset() for ptrace calls then ;-)
To get the address of the regset buffer, right?

I'd imagine that could be handled by some function like `GetFPRBuffer()` 
(similar one exists in linux), or even `GetBuffer(regset)`. I'd imagine that 
would be useful for the generic caching infrastructure as well.


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

https://reviews.llvm.org/D91248

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to