dlav-sc wrote: > software implemented watchpoint is going to be so slow
Well, yeah, they're quite slow, especially on targets that don't support hardware stepping. I've tested this patch on both riscv and x86 and the software watchpoints work significantly faster on x86 compared to riscv. I believe this difference comes from x86 using hardware stepping while riscv relies on software stepping. However, such performance is specific to software watchpoints. Since gdb already supports software watchpoints, I don't see why we shouldn't add them to lldb as well. > I doubt it will be useful in any real program debug session The original goal of my work was to enable watchpoint functionality at any cost on targets without hardware watchpoint support, in particular riscv. Now, with some limitations and speed tradeoffs of course, software watchpoints are available. Moreover, while hardware watchpoints only work for memory locations, software watchpoints don't have this limitation. In the future, we could use them to monitor registers and other complex expressions, like gdb do. > I do wonder if we can reliably instruction step over every instruction on > every target It's hard to say for sure, but generally there are no guarantees. While developing this patch, I encountered several bugs related to stepping (https://github.com/llvm/llvm-project/pull/127506) and discovered that lldb lacks proper support for stepping through atomic sequences on riscv (https://github.com/llvm/llvm-project/pull/127505). https://github.com/llvm/llvm-project/pull/151195 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits