This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main OpenOCD repository".
The branch, master has been updated
via cd41947febbeb908e2c0dbf6c3c0e74d799da6c0 (commit)
from a247ff122380a6a6e14878b462785fc209f875b0 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit cd41947febbeb908e2c0dbf6c3c0e74d799da6c0
Author: Tomas Vanek <va...@fb...>
Date: Mon Nov 3 17:33:12 2025 +0100
target/cortex_a: fix HW breakpoint length for gdb kind 3
Gdb uses length 3 to set breakpoint on a 4 byte Thumb-2
instruction. Without this patch a breakpoint on down aligned word
address was set. If the requested address was not word aligned,
the breakpoint triggered at previous instruction and was not
recognised properly by gdb.
Set breakpoint on whole word if aligns with requested address,
otherwise use length 2 and set byte mask.
Change-Id: I12d1c57b7154e64abdf23dd7cd31714f9d8ec6f0
Signed-off-by: Tomas Vanek <va...@fb...>
Reviewed-on: https://review.openocd.org/c/openocd/+/9211
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/src/target/cortex_a.c b/src/target/cortex_a.c
index 016ea175c..a9c034b55 100644
--- a/src/target/cortex_a.c
+++ b/src/target/cortex_a.c
@@ -54,6 +54,7 @@
#include <helper/bits.h>
#include <helper/nvp.h>
#include <helper/time_support.h>
+#include <helper/align.h>
static int cortex_a_poll(struct target *target);
static int cortex_a_debug_entry(struct target *target);
@@ -1341,6 +1342,14 @@ static int cortex_a_set_breakpoint(struct target *target,
return ERROR_TARGET_RESOURCE_NOT_AVAILABLE;
}
breakpoint_hw_set(breakpoint, brp_i);
+ if (breakpoint->length == 3) {
+ /* Thumb-2 breakpoint: fixup to length 4 if word aligned,
+ * set byte mask for length 2 if unaligned */
+ if (IS_ALIGNED(breakpoint->address, 4))
+ breakpoint->length = 4;
+ else
+ breakpoint->length = 2;
+ }
if (breakpoint->length == 2)
byte_addr_select = (3 << (breakpoint->address & 0x02));
control = ((matchmode & 0x7) << 20)
-----------------------------------------------------------------------
Summary of changes:
src/target/cortex_a.c | 9 +++++++++
1 file changed, 9 insertions(+)
hooks/post-receive
--
Main OpenOCD repository
|