|
From: openocd-gerrit <ope...@us...> - 2025-10-11 15:57:35
|
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 8b43a967e59de4eacb65627ea0ff6665dcdb0ac4 (commit)
from 04da6e2c624658d2c2c5c81f49be2e396bd30490 (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 8b43a967e59de4eacb65627ea0ff6665dcdb0ac4
Author: Antonio Borneo <bor...@gm...>
Date: Mon Sep 22 09:53:43 2025 +0200
target: cortex_m: add comment for breakpoint of length 3
Add a comment in the breakpoint code to clarify the check for the
odd breakpoint length of 3 bytes, introduced by [1].
[1]: commit 0a5e03c12aff ("cortex_m.c: Use two byte breakpoint for
32bit Thumb-2 request").
Change-Id: I024863d10078b5d9062c876aa59ccf70a81bf641
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/9139
Reviewed-by: Tomas Vanek <va...@fb...>
Tested-by: jenkins
diff --git a/src/target/cortex_m.c b/src/target/cortex_m.c
index bfcbbc289..42e957260 100644
--- a/src/target/cortex_m.c
+++ b/src/target/cortex_m.c
@@ -2041,6 +2041,15 @@ int cortex_m_unset_breakpoint(struct target *target, struct breakpoint *breakpoi
int cortex_m_add_breakpoint(struct target *target, struct breakpoint *breakpoint)
{
+ /*
+ * GDB packets Z0 and z0 provide the 'kind' parameter that is target-specific
+ * and typically indicates the size in bytes of the breakpoint.
+ * But for 32-bit Thumb mode (Thumb-2) breakpoint, GDB provides 'kind = 3' to
+ * be used to derive the length information. See:
+ * https://sourceware.org/gdb/current/onlinedocs/gdb.html/ARM-Breakpoint-Kinds.html
+ * Since there isn't a four byte Thumb-2 breakpoint instruction, always use
+ * the two bytes breakpoint instruction.
+ */
if (breakpoint->length == 3) {
LOG_TARGET_DEBUG(target, "Using a two byte breakpoint for 32bit Thumb-2 request");
breakpoint->length = 2;
-----------------------------------------------------------------------
Summary of changes:
src/target/cortex_m.c | 9 +++++++++
1 file changed, 9 insertions(+)
hooks/post-receive
--
Main OpenOCD repository
|