[Lldb-commits] [PATCH] D20357: [LLDB][MIPS] Fix FPU Size Based on Dynamic FR

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Fri Jul 8 06:51:04 PDT 2016


labath added inline comments.

================
Comment at: source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp:98
@@ +97,3 @@
+    const ArchSpec &arch = m_thread.GetProcess()->GetTarget().GetArchitecture();
+    RegisterInfo* reg_info = const_cast<RegisterInfo *>(m_reg_info.GetRegisterInfoAtIndex (reg));
+    if(reg_info->dynamic_size_dwarf_len)
----------------
nitesh.jain wrote:
> labath wrote:
> > Can we get rid of these const_casts? It looks like UpdateDynamicRegisterSize does not actually need this to be non-const.
> No, it require so that we can modify the reg_info->byte_size member.
In that case, there is something else wrong with the design here. Well behaved code should never need to call const_cast.

m_reg_info is non-const, so maybe you just need a non-const version of DynamicRegisterInfo::GetRegisterInfoAtIndex or something like that...


Repository:
  rL LLVM

http://reviews.llvm.org/D20357





More information about the lldb-commits mailing list