[0/2] gdb: LoongArch: Add support for hardware watchpoint & breakpoint

Message ID 20240524095512.16692-1-lihui@loongson.cn
Headers
Series gdb: LoongArch: Add support for hardware watchpoint & breakpoint |

Message

Hui Li May 24, 2024, 9:55 a.m. UTC
  LoongArch defines hardware watchpoint functions for fetch and load/store
operations. After the software configures the watchpoints for fetch and
load/store, the processor hardware will monitor the access addresses of
the fetch and load/store operations and trigger a watchpoint exception
when the watchpoint setting conditions are met.

After this series, hardware watchpoint & breakpoint are supported.

Refer to the following document for hardware watchpoint and breakpoint:
https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html#control-and-status-registers-related-to-watchpoints

Hui Li (2):
  gdb: LoongArch: Add support for hardware watchpoint
  gdb: LoongArch: Add support for hardware breakpoint

 gdb/Makefile.in                    |   3 +
 gdb/configure.nat                  |   4 +-
 gdb/loongarch-linux-nat.c          | 351 +++++++++++++++++++++++++++++
 gdb/loongarch-tdep.c               |   1 +
 gdb/nat/loongarch-hw-point.c       | 320 ++++++++++++++++++++++++++
 gdb/nat/loongarch-hw-point.h       | 103 +++++++++
 gdb/nat/loongarch-linux-hw-point.c | 252 +++++++++++++++++++++
 gdb/nat/loongarch-linux-hw-point.h | 126 +++++++++++
 gdb/nat/loongarch-linux.c          | 100 ++++++++
 gdb/nat/loongarch-linux.h          |  42 ++++
 include/elf/common.h               |   4 +
 11 files changed, 1305 insertions(+), 1 deletion(-)
 create mode 100644 gdb/nat/loongarch-hw-point.c
 create mode 100644 gdb/nat/loongarch-hw-point.h
 create mode 100644 gdb/nat/loongarch-linux-hw-point.c
 create mode 100644 gdb/nat/loongarch-linux-hw-point.h
 create mode 100644 gdb/nat/loongarch-linux.c
 create mode 100644 gdb/nat/loongarch-linux.h
  

Comments

Tiezhu Yang June 4, 2024, 8:30 a.m. UTC | #1
On 05/24/2024 05:55 PM, Hui Li wrote:
> LoongArch defines hardware watchpoint functions for fetch and load/store
> operations. After the software configures the watchpoints for fetch and
> load/store, the processor hardware will monitor the access addresses of
> the fetch and load/store operations and trigger a watchpoint exception
> when the watchpoint setting conditions are met.
>
> After this series, hardware watchpoint & breakpoint are supported.
>
> Refer to the following document for hardware watchpoint and breakpoint:
> https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html#control-and-status-registers-related-to-watchpoints
>
> Hui Li (2):
>   gdb: LoongArch: Add support for hardware watchpoint
>   gdb: LoongArch: Add support for hardware breakpoint

There are some related Linux kernel patches under review, let us wait
for some days, I think it is better to merge this series or new version
after the kernel patches are merged.

Thanks,
Tiezhu