[Lldb-commits] [PATCH] [LLDB][MIPS] Handle false positives for MIPS hardware watchpoints

Greg Clayton clayborg at gmail.com
Fri Jun 26 10:57:11 PDT 2015


Can we clean up the value in lldb-server prior to sending it up to the debugger so that the debugger doesn't have to worry about architecture specific bits in Watchpoint.cpp? That would be a better way to fix this.


REPOSITORY
  rL LLVM

================
Comment at: source/Breakpoint/Watchpoint.cpp:158-172
@@ +157,17 @@
+
+    // In MIPS while storing the address of watchpoint, last 3 bits are anded with watch flags,so its possible 
+    // to get a false positive from processor for a variable with same address that of watched variable except
+    // last 3 bits. So to check such false positive we check if value of watched variable is actually changed.
+    // For now mips-lldb supports hardware watches with 'write' type only. 
+    if (m_target.GetArchitecture().GetMachine() == llvm::Triple::mips ||
+        m_target.GetArchitecture().GetMachine() == llvm::Triple::mipsel ||
+        m_target.GetArchitecture().GetMachine() == llvm::Triple::mips64 ||
+        m_target.GetArchitecture().GetMachine() == llvm::Triple::mips64el)
+    {
+        if (m_old_value_sp)
+        {
+            if (m_old_value_sp->GetValueAsSigned(NULL,NULL) == m_new_value_sp->GetValueAsSigned(NULL,NULL))
+                return false;
+        }
+    }
+
----------------
Can this not be done anywhere before it gets to this point? Like maybe down in lldb-server when it is reporting the watchpoint hit? Then this can be done with "#if define(__MIPS__)" since lldb-server is compiled for each architecture natively.

================
Comment at: source/Target/StopInfo.cpp:840
@@ -840,1 +839,3 @@
+                        output_sp->Flush();
+                    }
                 }
----------------
mohit.bhakkad wrote:
> Sorry, I missed else part here.
> it will make m_should_stop = false
> 
Add

```
else
{
    m_should_stop = false;
}
```

http://reviews.llvm.org/D10761

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the lldb-commits mailing list