summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Linux
diff options
context:
space:
mode:
authorSagar Thakur <sagar.thakur@imgtec.com>2015-12-01 05:44:18 +0000
committerSagar Thakur <sagar.thakur@imgtec.com>2015-12-01 05:44:18 +0000
commitd4eb7cc3f3d3c4c6dad711221bb2a86f5dc03eb6 (patch)
treec998f64640c0b1b5777e587c0fab5e7dec9fa55c /lldb/source/Plugins/Process/Linux
parent05402671b89e66447876ba7c2d345e86a2e88b1a (diff)
downloadbcm5719-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.cpp3
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(&regs, 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 *)&regs) + offset), 8, GetByteOrder());
Error error = NativeProcessLinux::PtraceWrapper(PTRACE_GETREGS, m_thread.GetID(), NULL, &regs, sizeof regs);
if (error.Success())
{
OpenPOWER on IntegriCloud