aboutsummaryrefslogtreecommitdiff
path: root/src/rtos/rtos.h
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2022-01-31 09:23:38 -0800
committerGitHub <noreply@github.com>2022-01-31 09:23:38 -0800
commit52ca5d198e3b4a0565e810ff4b5545dfac39cec9 (patch)
tree232d12494d65e2a8d615223af78014f87295dde6 /src/rtos/rtos.h
parent6f3daf38c76db24422023c42f66d128cedb32813 (diff)
downloadriscv-openocd-52ca5d198e3b4a0565e810ff4b5545dfac39cec9.zip
riscv-openocd-52ca5d198e3b4a0565e810ff4b5545dfac39cec9.tar.gz
riscv-openocd-52ca5d198e3b4a0565e810ff4b5545dfac39cec9.tar.bz2
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 <tim@sifive.com>
Diffstat (limited to 'src/rtos/rtos.h')
-rw-r--r--src/rtos/rtos.h9
1 files changed, 9 insertions, 0 deletions
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 <helper/jim-nvp.h>
@@ -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 */