[Lldb-commits] [PATCH] D147820: debugserver: move AArch64 watchpoint traps within a watchpointed region, parse ESR flags and send them to lldb

David Spickett via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Apr 12 00:46:46 PDT 2023


DavidSpickett added inline comments.


================
Comment at: lldb/test/API/commands/watchpoints/unaligned-watchpoint/main.c:8-11
+   printf("%lld %lld\n", (*u64_p)++, (*u64_p)++);
+   printf("%lld %lld\n", (*u64_p)++, (*u64_p)++);
+   printf("%lld %lld\n", (*u64_p)++, (*u64_p)++);
+   printf("%lld %lld\n", (*u64_p)++, (*u64_p)++);
----------------
jasonmolenda wrote:
> DavidSpickett wrote:
> > These do what exactly?
> These are doing 64-bit writes to `u64_p` which is pointing to the start of the `uint8_t buf[8]`, while I'm watching 1 byte in the middle, so the FAR address I get is the start of the buffer (and outside of the address range I'm watching).  This is the one that lldb currently skips over silently on AArch64 Linux/FreeBSD.  Doing two of these writes on each source line was something I did while testing something else, I didn't really need to write it this way for this test case.
So can we have the minimum writes here then?

I guess that another `*u64_p = 5;` would be enough.


================
Comment at: lldb/tools/debugserver/source/DNBDefs.h:284-297
+      bool esr_fields_set;
+      struct {
+        uint32_t
+            iss; // "ISS encoding for an exception from a Watchpoint exception"
+        uint32_t wpt;  // Watchpoint number
+        bool wptv;     // Watchpoint number Valid
+        bool wpf;      // Watchpoint might be false-positive
----------------
JDevlieghere wrote:
> Instead of a boolean and a field, you could make it a `std::optional<esr_field>`. 
+1


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147820/new/

https://reviews.llvm.org/D147820



More information about the lldb-commits mailing list