From 3579996399bb2b53f21313ed527896b99bd24b50 Mon Sep 17 00:00:00 2001 From: "Mohit K. Bhakkad" Date: Thu, 18 Jun 2015 04:53:18 +0000 Subject: [LLDB][MIPS] Hardware Watchpoints for MIPS Reviewers: clayborg, jingham. Subscribers: jaydeep, bhushan, dsanders, sagar, lldb-commits. Differential Revision: http://reviews.llvm.org/D9142 llvm-svn: 239991 --- .../Plugins/Process/Linux/NativeProcessLinux.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp') diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp index f6cefa9e001c..be07b4365803 100644 --- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -2011,6 +2011,27 @@ NativeProcessLinux::MonitorSIGTRAP(const siginfo_t *info, lldb::pid_t pid) break; case SI_KERNEL: +#if defined __mips__ + // For mips there is no special signal for watchpoint + // So we check for watchpoint in kernel trap + if (thread_sp) + { + // If a watchpoint was hit, report it + uint32_t wp_index; + Error error = thread_sp->GetRegisterContext()->GetWatchpointHitIndex(wp_index, NULL); + if (error.Fail() && log) + log->Printf("NativeProcessLinux::%s() " + "received error while checking for watchpoint hits, " + "pid = %" PRIu64 " error = %s", + __FUNCTION__, pid, error.AsCString()); + if (wp_index != LLDB_INVALID_INDEX32) + { + MonitorWatchpoint(pid, thread_sp, wp_index); + break; + } + } + // NO BREAK +#endif case TRAP_BRKPT: MonitorBreakpoint(pid, thread_sp); break; -- cgit v1.2.3