diff options
| author | Sagar Thakur <sagar.thakur@imgtec.com> | 2015-10-19 11:21:20 +0000 |
|---|---|---|
| committer | Sagar Thakur <sagar.thakur@imgtec.com> | 2015-10-19 11:21:20 +0000 |
| commit | b997792cc6ed531966e59515a389c98d176a93e2 (patch) | |
| tree | 6d59b0510d1e71f3930e18d62efafee2af4556ff /lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp | |
| parent | 48ea8efd59537adf0338c3bd6236a22cb005a155 (diff) | |
| download | bcm5719-llvm-b997792cc6ed531966e59515a389c98d176a93e2.tar.gz bcm5719-llvm-b997792cc6ed531966e59515a389c98d176a93e2.zip | |
[LLDB][MIPS] Use the correct ptrace buffer for writing register value for o32 applications
For o32 applications on mips we were getting segmentation fault while launching lldb-server because of overwritting stack when using elf_gregset_t in DoWriteRegisterValue.
We are now using the GPR_mips_linux buffer in DoWriteRegisterValue as done in DoReadRegisterValue also, which solves the above issue.
llvm-svn: 250696
Diffstat (limited to 'lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp')
| -rw-r--r-- | lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp index 0d48091da43..7549802733f 100644 --- a/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp @@ -927,7 +927,7 @@ GetWatchHi (struct pt_watch_regs *regs, uint32_t index) return regs->mips32.watchhi[index]; else if (regs->style == pt_watch_style_mips64) return regs->mips64.watchhi[index]; - else + if(log) log->Printf("Invalid watch register style"); return 0; } @@ -940,7 +940,7 @@ SetWatchHi (struct pt_watch_regs *regs, uint32_t index, uint16_t value) regs->mips32.watchhi[index] = value; else if (regs->style == pt_watch_style_mips64) regs->mips64.watchhi[index] = value; - else + if(log) log->Printf("Invalid watch register style"); return; } @@ -953,7 +953,7 @@ GetWatchLo (struct pt_watch_regs *regs, uint32_t index) return regs->mips32.watchlo[index]; else if (regs->style == pt_watch_style_mips64) return regs->mips64.watchlo[index]; - else + if(log) log->Printf("Invalid watch register style"); return LLDB_INVALID_ADDRESS; } @@ -966,7 +966,7 @@ SetWatchLo (struct pt_watch_regs *regs, uint32_t index, uint64_t value) regs->mips32.watchlo[index] = (uint32_t) value; else if (regs->style == pt_watch_style_mips64) regs->mips64.watchlo[index] = value; - else + if(log) log->Printf("Invalid watch register style"); return; } @@ -979,7 +979,7 @@ GetIRWMask (struct pt_watch_regs *regs, uint32_t index) return regs->mips32.watch_masks[index] & IRW; else if (regs->style == pt_watch_style_mips64) return regs->mips64.watch_masks[index] & IRW; - else + if(log) log->Printf("Invalid watch register style"); return 0; } @@ -992,7 +992,7 @@ GetRegMask (struct pt_watch_regs *regs, uint32_t index) return regs->mips32.watch_masks[index] & ~IRW; else if (regs->style == pt_watch_style_mips64) return regs->mips64.watch_masks[index] & ~IRW; - else + if(log) log->Printf("Invalid watch register style"); return 0; } @@ -1361,7 +1361,8 @@ NativeRegisterContextLinux_mips64::NumSupportedHardwareWatchpoints () num_valid = regs.mips64.num_valid; return num_valid; default: - log->Printf("NativeRegisterContextLinux_mips64::%s Error: Unrecognized watch register style", __FUNCTION__); + if(log) + log->Printf("NativeRegisterContextLinux_mips64::%s Error: Unrecognized watch register style", __FUNCTION__); } return 0; } @@ -1392,7 +1393,7 @@ NativeRegisterContextLinux_mips64::DoWriteRegisterValue(uint32_t offset, const char* reg_name, const RegisterValue &value) { - elf_gregset_t regs; + GPR_linux_mips regs; Error error = NativeProcessLinux::PtraceWrapper(PTRACE_GETREGS, m_thread.GetID(), NULL, ®s, sizeof regs); if (error.Success()) { |

