From 52ca5d198e3b4a0565e810ff4b5545dfac39cec9 Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Mon, 31 Jan 2022 09:23:38 -0800 Subject: Ask the RTOS which target to set swbp on. (#673) This lets the RTOS pick the "current" target, which matters if address translation differs between threads. Change-Id: I5b5510ab6a06621589c902f42a91562055817dc4 Signed-off-by: Tim Newsome --- src/rtos/rtos.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/rtos/rtos.h') diff --git a/src/rtos/rtos.h b/src/rtos/rtos.h index 2e41c14..0cad6ee 100644 --- a/src/rtos/rtos.h +++ b/src/rtos/rtos.h @@ -20,6 +20,7 @@ #define OPENOCD_RTOS_RTOS_H #include "server/server.h" +#include "target/breakpoints.h" #include "target/target.h" #include @@ -103,6 +104,12 @@ struct rtos_type { uint8_t *buffer); int (*write_buffer)(struct rtos *rtos, target_addr_t address, uint32_t size, const uint8_t *buffer); + /* When a software breakpoint is set, it is set on only one target, + * because we assume memory is shared across them. By default this is the + * first target in the SMP group. Override this function to have + * breakpoint_add() use a different target. */ + struct target * (*swbp_target)(struct rtos *rtos, target_addr_t address, + uint32_t length, enum breakpoint_type type); }; struct stack_register_offset { @@ -166,5 +173,7 @@ int rtos_read_buffer(struct target *target, target_addr_t address, uint32_t size, uint8_t *buffer); int rtos_write_buffer(struct target *target, target_addr_t address, uint32_t size, const uint8_t *buffer); +struct target *rtos_swbp_target(struct target *target, target_addr_t address, + uint32_t length, enum breakpoint_type type); #endif /* OPENOCD_RTOS_RTOS_H */ -- cgit v1.1