diff options
| author | Sagar Thakur <sagar.thakur@imgtec.com> | 2015-12-01 05:44:18 +0000 |
|---|---|---|
| committer | Sagar Thakur <sagar.thakur@imgtec.com> | 2015-12-01 05:44:18 +0000 |
| commit | d4eb7cc3f3d3c4c6dad711221bb2a86f5dc03eb6 (patch) | |
| tree | c998f64640c0b1b5777e587c0fab5e7dec9fa55c /lldb/source/Plugins/Process/Linux | |
| parent | 05402671b89e66447876ba7c2d345e86a2e88b1a (diff) | |
| download | bcm5719-llvm-d4eb7cc3f3d3c4c6dad711221bb2a86f5dc03eb6.tar.gz bcm5719-llvm-d4eb7cc3f3d3c4c6dad711221bb2a86f5dc03eb6.zip | |
[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
Diffstat (limited to 'lldb/source/Plugins/Process/Linux')
| -rw-r--r-- | lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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()) { |

