[Lldb-commits] [PATCH] D14633: [LLDB][MIPS] Clear bug 25194 - LLDB-Server Assertion raised when single stepping on MIPS

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Mon Nov 16 11:17:19 PST 2015


clayborg requested changes to this revision.
This revision now requires changes to proceed.

================
Comment at: source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp:1378
@@ -1377,2 +1377,3 @@
     GPR_linux_mips regs;
+    lldb_private::ArchSpec arch;
     ::memset(&regs, 0, sizeof(GPR_linux_mips));
----------------
tberghammer wrote:
> You use this variable without initializing it. You can call SetBytes with an explicit byte order value (e.g. eByteOrderLittle) as it isn't matter during 0 initialization.
Remove this.

================
Comment at: source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp:1382
@@ -1379,1 +1381,3 @@
+    // Clear all bits in RegisterValue before writing actual value read from ptrace to avoid garbage value in 32-bit MSB 
+    value.SetBytes((void *)(((unsigned char *)&regs) + offset), 8, arch.GetByteOrder());
     Error error = NativeProcessLinux::PtraceWrapper(PTRACE_GETREGS, m_thread.GetID(), NULL, &regs, sizeof regs);
----------------
Just call the member function GetByteOrder() that is built into NativeRegisterContextLinux:

```
value.SetBytes((void *)(((unsigned char *)&regs) + offset), 8, GetByteOrder());
```


Repository:
  rL LLVM

http://reviews.llvm.org/D14633





More information about the lldb-commits mailing list