================
@@ -50,6 +50,19 @@
 #define REG_CONTEXT_SIZE                                                       
\
   (GetGPRSize() + GetFPRSize() + sizeof(m_lsx) + sizeof(m_lasx))
 
+// In order to avoid undefined or redefined error, just add a new struct
+// loongarch_user_watch_state in LLDB which is same with the uapi struct
+// user_watch_state_v2.
----------------
DavidSpickett wrote:

This should reference `user_watch_state` version 1 and say that all that 
changed is the size of dbg_regs. Something like:
```
// ptrace has a type user_watch_state, which was replaced by 
user_watch_state_v2 when more watchpoints
// were added. So this file may be built on systems with one or both in the 
headers. The type below has the same
// layout as user_watch_v2 but will not clash with that name if it exists. We 
can use the v2 layout even on old
// kernels as we will only see 8 watchpoints and the kernel will truncate any 
extra data we send to it.
```

https://github.com/llvm/llvm-project/pull/126204
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to