From d4eb7cc3f3d3c4c6dad711221bb2a86f5dc03eb6 Mon Sep 17 00:00:00 2001 From: Sagar Thakur Date: Tue, 1 Dec 2015 05:44:18 +0000 Subject: [LLDB][MIPS] Clear bug 25194 - LLDB-Server Assertion raised when single stepping on MIPS This patch will clear bug 25194 - LLDB-Server Assertion raised when single stepping on MIPS. The problem was that while emulating instructions, old and new pc values would have garbage value in their upper 32 bits. Therefore checking if pc was changed (old_pc == new_pc) would always return false, because of which pc was not getting updated. /* If we haven't changed the PC, change it here */ if (old_pc == new_pc) { new_pc += 4; Context context; return false; } Reviewers: tberghammer, clayborg Subscribers: dsanders, lldb-commits, mohit.bhakkad, bhushan, jaydeep, nitesh.jain Differential: http://reviews.llvm.org/D14633 llvm-svn: 254379 --- .../source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lldb/source/Plugins/Process/Linux') diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp index 500aa96d2d3..91e0b9be923 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp @@ -1376,6 +1376,9 @@ NativeRegisterContextLinux_mips64::DoReadRegisterValue(uint32_t offset, { GPR_linux_mips regs; ::memset(®s, 0, sizeof(GPR_linux_mips)); + + // 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 *)®s) + offset), 8, GetByteOrder()); Error error = NativeProcessLinux::PtraceWrapper(PTRACE_GETREGS, m_thread.GetID(), NULL, ®s, sizeof regs); if (error.Success()) { -- cgit v1.2.3