git: 0adc959a3730 - main - sys/gdb: Support hardware breakpoints
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 12 Apr 2024 09:37:42 UTC
The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=0adc959a37303939e6c64cbeea47a62670bfaf58 commit 0adc959a37303939e6c64cbeea47a62670bfaf58 Author: Andrew Turner <andrew@FreeBSD.org> AuthorDate: 2024-03-14 15:09:03 +0000 Commit: Andrew Turner <andrew@FreeBSD.org> CommitDate: 2024-04-12 09:32:55 +0000 sys/gdb: Support hardware breakpoints Support the use of hardware breakpoints in the kernel gdb stub. Reviewed by: jhb (earlier version) Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D44354 --- sys/gdb/gdb_main.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sys/gdb/gdb_main.c b/sys/gdb/gdb_main.c index 5567c12c2a9f..3e8ada42adac 100644 --- a/sys/gdb/gdb_main.c +++ b/sys/gdb/gdb_main.c @@ -267,6 +267,11 @@ nofeatures: gdb_tx_str(";qXfer:threads:read+"); +#ifdef HAS_HW_BREAKPOINT + if ((*feat & GDB_HWBREAK) != 0) + gdb_tx_str(";hwbreak+"); +#endif + /* * If the debugport is a reliable transport, request No Ack mode from * the server. The server may or may not choose to enter No Ack mode. @@ -648,6 +653,10 @@ gdb_z_insert(void) (vm_size_t)length, KDB_DBG_ACCESS_RW); break; case '1': /* hardware breakpoint */ +#ifdef HAS_HW_BREAKPOINT + error = kdb_cpu_set_breakpoint((vm_offset_t)addr); + break; +#endif case '0': /* software breakpoint */ /* Not implemented. */ gdb_tx_empty(); @@ -692,6 +701,10 @@ gdb_z_remove(void) (vm_size_t)length); break; case '1': /* hardware breakpoint */ +#ifdef HAS_HW_BREAKPOINT + error = kdb_cpu_clr_breakpoint((vm_offset_t)addr); + break; +#endif case '0': /* software breakpoint */ /* Not implemented. */ gdb_tx_empty();