You can subscribe to this list here.
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(75) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2009 |
Jan
(70) |
Feb
(20) |
Mar
(52) |
Apr
(149) |
May
(387) |
Jun
(466) |
Jul
(133) |
Aug
(87) |
Sep
(122) |
Oct
(140) |
Nov
(185) |
Dec
(105) |
| 2010 |
Jan
(85) |
Feb
(45) |
Mar
(75) |
Apr
(17) |
May
(41) |
Jun
(52) |
Jul
(33) |
Aug
(29) |
Sep
(36) |
Oct
(15) |
Nov
(26) |
Dec
(34) |
| 2011 |
Jan
(26) |
Feb
(25) |
Mar
(26) |
Apr
(29) |
May
(20) |
Jun
(27) |
Jul
(15) |
Aug
(32) |
Sep
(13) |
Oct
(64) |
Nov
(60) |
Dec
(10) |
| 2012 |
Jan
(64) |
Feb
(63) |
Mar
(39) |
Apr
(43) |
May
(54) |
Jun
(11) |
Jul
(30) |
Aug
(45) |
Sep
(11) |
Oct
(70) |
Nov
(24) |
Dec
(23) |
| 2013 |
Jan
(17) |
Feb
(8) |
Mar
(35) |
Apr
(40) |
May
(20) |
Jun
(24) |
Jul
(36) |
Aug
(25) |
Sep
(42) |
Oct
(40) |
Nov
(9) |
Dec
(21) |
| 2014 |
Jan
(29) |
Feb
(24) |
Mar
(60) |
Apr
(22) |
May
(22) |
Jun
(46) |
Jul
(11) |
Aug
(23) |
Sep
(26) |
Oct
(10) |
Nov
(14) |
Dec
(2) |
| 2015 |
Jan
(28) |
Feb
(47) |
Mar
(33) |
Apr
(58) |
May
(5) |
Jun
(1) |
Jul
|
Aug
(8) |
Sep
(12) |
Oct
(25) |
Nov
(58) |
Dec
(21) |
| 2016 |
Jan
(12) |
Feb
(40) |
Mar
(2) |
Apr
(1) |
May
(67) |
Jun
(2) |
Jul
(5) |
Aug
(36) |
Sep
|
Oct
(24) |
Nov
(17) |
Dec
(50) |
| 2017 |
Jan
(14) |
Feb
(16) |
Mar
(2) |
Apr
(35) |
May
(14) |
Jun
(16) |
Jul
(3) |
Aug
(3) |
Sep
|
Oct
(19) |
Nov
|
Dec
(16) |
| 2018 |
Jan
(55) |
Feb
(11) |
Mar
(34) |
Apr
(14) |
May
(4) |
Jun
(20) |
Jul
(39) |
Aug
(16) |
Sep
(17) |
Oct
(16) |
Nov
(20) |
Dec
(30) |
| 2019 |
Jan
(29) |
Feb
(24) |
Mar
(37) |
Apr
(26) |
May
(19) |
Jun
(21) |
Jul
(2) |
Aug
(3) |
Sep
(9) |
Oct
(12) |
Nov
(12) |
Dec
(12) |
| 2020 |
Jan
(47) |
Feb
(36) |
Mar
(54) |
Apr
(44) |
May
(37) |
Jun
(19) |
Jul
(32) |
Aug
(13) |
Sep
(16) |
Oct
(24) |
Nov
(32) |
Dec
(11) |
| 2021 |
Jan
(14) |
Feb
(5) |
Mar
(40) |
Apr
(32) |
May
(42) |
Jun
(31) |
Jul
(29) |
Aug
(47) |
Sep
(38) |
Oct
(17) |
Nov
(74) |
Dec
(33) |
| 2022 |
Jan
(11) |
Feb
(15) |
Mar
(40) |
Apr
(21) |
May
(39) |
Jun
(44) |
Jul
(19) |
Aug
(46) |
Sep
(79) |
Oct
(35) |
Nov
(21) |
Dec
(15) |
| 2023 |
Jan
(56) |
Feb
(13) |
Mar
(43) |
Apr
(28) |
May
(60) |
Jun
(15) |
Jul
(29) |
Aug
(28) |
Sep
(32) |
Oct
(21) |
Nov
(42) |
Dec
(39) |
| 2024 |
Jan
(35) |
Feb
(17) |
Mar
(28) |
Apr
(7) |
May
(14) |
Jun
(35) |
Jul
(30) |
Aug
(35) |
Sep
(30) |
Oct
(28) |
Nov
(38) |
Dec
(18) |
| 2025 |
Jan
(21) |
Feb
(28) |
Mar
(36) |
Apr
(35) |
May
(34) |
Jun
(58) |
Jul
(9) |
Aug
(54) |
Sep
(47) |
Oct
(15) |
Nov
(44) |
Dec
|
|
From: openocd-gerrit <ope...@us...> - 2025-06-07 08:17:49
|
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 98ed83e2782bfd242b653bd3190c34d091b3d7b6 (commit)
from 92287c1a2afa93f2f20d2249827a57ffac6760c6 (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 98ed83e2782bfd242b653bd3190c34d091b3d7b6
Author: Tim Newsome <ti...@si...>
Date: Wed Sep 7 11:55:52 2022 -0700
rtos/hwthread: Hide unavailable targets from thread list.
Imported from
https://github.com/riscv-collab/riscv-openocd/pull/767
Change-Id: I53c6e2876d9bab70800a0f080e72a2abe0499120
Signed-off-by: Tim Newsome <ti...@si...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8919
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/src/rtos/hwthread.c b/src/rtos/hwthread.c
index 76571c6b6..cc43a07b4 100644
--- a/src/rtos/hwthread.c
+++ b/src/rtos/hwthread.c
@@ -105,7 +105,8 @@ static int hwthread_update_threads(struct rtos *rtos)
foreach_smp_target(head, target->smp_targets) {
struct target *curr = head->target;
- if (!target_was_examined(curr))
+ if (!target_was_examined(curr) ||
+ curr->state == TARGET_UNAVAILABLE)
continue;
++thread_list_size;
@@ -130,7 +131,8 @@ static int hwthread_update_threads(struct rtos *rtos)
foreach_smp_target(head, target->smp_targets) {
struct target *curr = head->target;
- if (!target_was_examined(curr))
+ if (!target_was_examined(curr) ||
+ curr->state == TARGET_UNAVAILABLE)
continue;
threadid_t tid = threadid_from_target(curr);
-----------------------------------------------------------------------
Summary of changes:
src/rtos/hwthread.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2025-06-07 08:16:06
|
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 92287c1a2afa93f2f20d2249827a57ffac6760c6 (commit)
from 4fe57a0c197158958c7cc295002504d6434d4777 (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 92287c1a2afa93f2f20d2249827a57ffac6760c6
Author: Tim Newsome <ti...@si...>
Date: Thu Oct 27 15:21:31 2022 -0700
target: Add TARGET_UNAVAILABLE state
This is added for future RISC-V changes. The RISC-V debug interface can
explicitly tell a debugger when a hart is unavailable. This is used for
instance when that hart is powered down (or yet to be powered up out of
reset).
Imported from
https://github.com/riscv-collab/riscv-openocd/pull/752
Change-Id: I8a062d59eea1e5b3c788281a75159592db024683
Signed-off-by: Tim Newsome <ti...@si...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8911
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
Reviewed-by: Bernhard Rosenkränzer <be...@ba...>
diff --git a/src/target/target.c b/src/target/target.c
index 6653c381c..fd0e0116b 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -220,6 +220,7 @@ static const struct nvp nvp_target_state[] = {
{ .name = "halted", .value = TARGET_HALTED },
{ .name = "reset", .value = TARGET_RESET },
{ .name = "debug-running", .value = TARGET_DEBUG_RUNNING },
+ { .name = "unavailable", .value = TARGET_UNAVAILABLE },
{ .name = NULL, .value = -1 },
};
diff --git a/src/target/target.h b/src/target/target.h
index b698f250c..b850b49cf 100644
--- a/src/target/target.h
+++ b/src/target/target.h
@@ -46,6 +46,8 @@ struct gdb_fileio_info;
* not sure how this is used with all the recent changes)
* TARGET_DEBUG_RUNNING = 4: the target is running, but it is executing code on
* behalf of the debugger (e.g. algorithm for flashing)
+ * TARGET_UNAVAILABLE = 5: The target is unavailable for some reason. It might
+ * be powered down, for instance.
*
* also see: target_state_name();
*/
@@ -56,6 +58,7 @@ enum target_state {
TARGET_HALTED = 2,
TARGET_RESET = 3,
TARGET_DEBUG_RUNNING = 4,
+ TARGET_UNAVAILABLE = 5
};
enum target_reset_mode {
-----------------------------------------------------------------------
Summary of changes:
src/target/target.c | 1 +
src/target/target.h | 3 +++
2 files changed, 4 insertions(+)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2025-05-25 12:46:37
|
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 4fe57a0c197158958c7cc295002504d6434d4777 (commit)
from bde7e86e8eb74097880af2cab81444b250712b18 (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 4fe57a0c197158958c7cc295002504d6434d4777
Author: Antonio Borneo <bor...@gm...>
Date: Mon May 19 15:23:23 2025 +0200
server: gdb_server: use a macro for CTRL-C value
The numeric value '3' for the ASCII character CTRL-C is not
immediately readable, even if the lines that follow explicitly
mention CTRL-C.
Use the same macro present in `telnet_server.c` to replace the
numeric value.
Change-Id: Iaf4296b1f0e384f8122d8a4875cad17e8ddaf66a
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8922
Reviewed-by: Tomas Vanek <va...@fb...>
Tested-by: jenkins
diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c
index bd00feb49..085058f4f 100644
--- a/src/server/gdb_server.c
+++ b/src/server/gdb_server.c
@@ -50,6 +50,8 @@
* found in most modern embedded processors.
*/
+#define CTRL(c) ((c) - '@')
+
enum gdb_output_flag {
/* GDB doesn't accept 'O' packets */
GDB_OUTPUT_NO,
@@ -434,7 +436,7 @@ static int gdb_put_packet_inner(struct connection *connection,
gdb_putback_char(connection, reply);
LOG_DEBUG("Unexpected start of new packet");
break;
- } else if (reply == 0x3) {
+ } else if (reply == CTRL('C')) {
/* do not discard Ctrl-C */
gdb_putback_char(connection, reply);
break;
@@ -486,7 +488,7 @@ static int gdb_put_packet_inner(struct connection *connection,
gdb_con->output_flag = GDB_OUTPUT_NO;
gdb_log_incoming_packet(connection, "-");
LOG_WARNING("negative reply, retrying");
- } else if (reply == 0x3) {
+ } else if (reply == CTRL('C')) {
gdb_con->ctrl_c = true;
gdb_log_incoming_packet(connection, "<Ctrl-C>");
retval = gdb_get_char(connection, &reply);
@@ -696,7 +698,7 @@ static int gdb_get_packet_inner(struct connection *connection,
gdb_log_incoming_packet(connection, "-");
LOG_WARNING("negative acknowledgment, but no packet pending");
break;
- case 0x3:
+ case CTRL('C'):
gdb_log_incoming_packet(connection, "<Ctrl-C>");
gdb_con->ctrl_c = true;
*len = 0;
-----------------------------------------------------------------------
Summary of changes:
src/server/gdb_server.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2025-05-25 12:46:15
|
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 bde7e86e8eb74097880af2cab81444b250712b18 (commit)
via 9b30e051379bffaec0928c3e6447b1d54becdb45 (commit)
from 8b47a0736b249e0c2574578a184d962294e03b90 (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 bde7e86e8eb74097880af2cab81444b250712b18
Author: Tomas Vanek <va...@fb...>
Date: Sun May 18 21:25:35 2025 +0200
server/gdb_server: do not discard Ctrl-C if _DEBUG_GDB_IO_
GDB server debug logging eat Ctrl-C when gdb user issues interrupt
in time of communication between OpenOCD and gdb.
E.g. Ctrl-C after `next` gdb command taking many
gdb remote protocol $vCont;s (steps)
Change-Id: I4a65446a9bb25a28e50566607b3dec116fa7d2cd
Suggested-by: Tim Newsome <ti...@si...>
Signed-off-by: Tomas Vanek <va...@fb...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8920
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c
index 71b7c7764..bd00feb49 100644
--- a/src/server/gdb_server.c
+++ b/src/server/gdb_server.c
@@ -434,6 +434,10 @@ static int gdb_put_packet_inner(struct connection *connection,
gdb_putback_char(connection, reply);
LOG_DEBUG("Unexpected start of new packet");
break;
+ } else if (reply == 0x3) {
+ /* do not discard Ctrl-C */
+ gdb_putback_char(connection, reply);
+ break;
}
LOG_WARNING("Discard unexpected char %c", reply);
commit 9b30e051379bffaec0928c3e6447b1d54becdb45
Author: Tomas Vanek <va...@fb...>
Date: Sun May 18 11:49:31 2025 +0200
flash, target: avoid logging of numeric target state
Replace it by target_state_name() helper.
Change-Id: I720f2bf121e6fd2c6987a7e8fa9e52593888ee6c
Signed-off-by: Tomas Vanek <va...@fb...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8918
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/src/flash/nor/ambiqmicro.c b/src/flash/nor/ambiqmicro.c
index bb893778c..67cc6b68a 100644
--- a/src/flash/nor/ambiqmicro.c
+++ b/src/flash/nor/ambiqmicro.c
@@ -309,9 +309,9 @@ static int ambiqmicro_exec_command(struct target *target,
*/
target_poll(target);
alive_sleep(100);
- LOG_DEBUG("state = %d", target->state);
} else {
- LOG_ERROR("Target not halted or running %d", target->state);
+ LOG_ERROR("Target not halted or running (state is %s)",
+ target_state_name(target));
break;
}
}
diff --git a/src/target/espressif/esp32.c b/src/target/espressif/esp32.c
index 399ba8e7c..5e2490a22 100644
--- a/src/target/espressif/esp32.c
+++ b/src/target/espressif/esp32.c
@@ -192,8 +192,8 @@ static int esp32_soc_reset(struct target *target)
alive_sleep(10);
xtensa_poll(target);
if (timeval_ms() >= timeout) {
- LOG_TARGET_ERROR(target, "Timed out waiting for CPU to be reset, target state=%d",
- target->state);
+ LOG_TARGET_ERROR(target, "Timed out waiting for CPU to be reset, target state %s",
+ target_state_name(target));
get_timeout = true;
break;
}
diff --git a/src/target/espressif/esp32s2.c b/src/target/espressif/esp32s2.c
index b86e43e62..e32893a6b 100644
--- a/src/target/espressif/esp32s2.c
+++ b/src/target/espressif/esp32s2.c
@@ -272,8 +272,8 @@ static int esp32s2_soc_reset(struct target *target)
alive_sleep(10);
xtensa_poll(target);
if (timeval_ms() >= timeout) {
- LOG_TARGET_ERROR(target, "Timed out waiting for CPU to be reset, target state=%d",
- target->state);
+ LOG_TARGET_ERROR(target, "Timed out waiting for CPU to be reset, target state %s",
+ target_state_name(target));
return ERROR_TARGET_TIMEOUT;
}
}
diff --git a/src/target/espressif/esp32s3.c b/src/target/espressif/esp32s3.c
index 82413f77f..14f7a7bb6 100644
--- a/src/target/espressif/esp32s3.c
+++ b/src/target/espressif/esp32s3.c
@@ -193,8 +193,8 @@ static int esp32s3_soc_reset(struct target *target)
xtensa_poll(target);
if (timeval_ms() >= timeout) {
LOG_TARGET_ERROR(target,
- "Timed out waiting for CPU to be reset, target state=%d",
- target->state);
+ "Timed out waiting for CPU to be reset, target state %s",
+ target_state_name(target));
get_timeout = true;
break;
}
diff --git a/src/target/stm8.c b/src/target/stm8.c
index 81c41f2b2..7785d40ef 100644
--- a/src/target/stm8.c
+++ b/src/target/stm8.c
@@ -870,7 +870,7 @@ static int stm8_poll(struct target *target)
uint8_t csr1, csr2;
#ifdef LOG_STM8
- LOG_DEBUG("target->state=%d", target->state);
+ LOG_DEBUG("target->state %s", target_state_name(target));
#endif
/* read dm_csrx control regs */
diff --git a/src/target/xtensa/xtensa.c b/src/target/xtensa/xtensa.c
index 3a877edfa..3366623d6 100644
--- a/src/target/xtensa/xtensa.c
+++ b/src/target/xtensa/xtensa.c
@@ -949,7 +949,8 @@ int xtensa_smpbreak_set(struct target *target, uint32_t set)
xtensa->smp_break = set;
if (target_was_examined(target))
res = xtensa_smpbreak_write(xtensa, xtensa->smp_break);
- LOG_TARGET_DEBUG(target, "set smpbreak=%" PRIx32 ", state=%i", set, target->state);
+ LOG_TARGET_DEBUG(target, "set smpbreak=%" PRIx32 ", state %s", set,
+ target_state_name(target));
return res;
}
-----------------------------------------------------------------------
Summary of changes:
src/flash/nor/ambiqmicro.c | 4 ++--
src/server/gdb_server.c | 4 ++++
src/target/espressif/esp32.c | 4 ++--
src/target/espressif/esp32s2.c | 4 ++--
src/target/espressif/esp32s3.c | 4 ++--
src/target/stm8.c | 2 +-
src/target/xtensa/xtensa.c | 3 ++-
7 files changed, 15 insertions(+), 10 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2025-05-25 12:43:15
|
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 8b47a0736b249e0c2574578a184d962294e03b90 (commit)
via 4c1e2105c4e5ad3188dae6e62ce019df15c7e52a (commit)
from 3c7725ea703e186c9d9ced3b0e03231982abdbfd (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 8b47a0736b249e0c2574578a184d962294e03b90
Author: Antonio Borneo <bor...@gm...>
Date: Sat May 10 23:52:30 2025 +0200
target: arm_cti: fix return values in handle_cti_dump()
Since the initial commit f444c57bf2d6 ("arm_cti: add cti command
group") the helper handle_cti_dump() return JIM error codes.
Fix it by returning standard OpenOCD error codes.
Change-Id: Ia36b82083d213aff90fe22fcfe7fbe26172806a3
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8904
Tested-by: jenkins
diff --git a/src/target/arm_cti.c b/src/target/arm_cti.c
index 830956e5c..032e5ac37 100644
--- a/src/target/arm_cti.c
+++ b/src/target/arm_cti.c
@@ -232,13 +232,13 @@ COMMAND_HANDLER(handle_cti_dump)
retval = dap_run(ap->dap);
if (retval != ERROR_OK)
- return JIM_ERR;
+ return retval;
for (size_t i = 0; i < ARRAY_SIZE(cti_names); i++)
command_print(CMD, "%8.8s (0x%04"PRIx32") 0x%08"PRIx32,
cti_names[i].label, cti_names[i].offset, values[i]);
- return JIM_OK;
+ return ERROR_OK;
}
COMMAND_HANDLER(handle_cti_enable)
commit 4c1e2105c4e5ad3188dae6e62ce019df15c7e52a
Author: Antonio Borneo <bor...@gm...>
Date: Sat May 10 14:14:05 2025 +0200
target: drop struct target_type::target_jim_commands()
The API was introduced in 2008 by commit 8d73c2a9b0c0 ("duan ellis
target tcl work in progress") and never used.
Drop it!
Change-Id: Icbc5789f59696bd28f9d1151bc3e29f4adb74670
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8903
Tested-by: jenkins
diff --git a/src/target/target_type.h b/src/target/target_type.h
index eddedbf34..5b0dc5a6c 100644
--- a/src/target/target_type.h
+++ b/src/target/target_type.h
@@ -201,10 +201,6 @@ struct target_type {
/* otherwise: JIM_OK, or JIM_ERR, */
int (*target_jim_configure)(struct target *target, struct jim_getopt_info *goi);
- /* target commands specifically handled by the target */
- /* returns JIM_OK, or JIM_ERR, or JIM_CONTINUE - if option not understood */
- int (*target_jim_commands)(struct target *target, struct jim_getopt_info *goi);
-
/**
* This method is used to perform target setup that requires
* JTAG access.
-----------------------------------------------------------------------
Summary of changes:
src/target/arm_cti.c | 4 ++--
src/target/target_type.h | 4 ----
2 files changed, 2 insertions(+), 6 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2025-05-25 12:42:57
|
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 3c7725ea703e186c9d9ced3b0e03231982abdbfd (commit)
via 6cec67251d29a4a62d330ff6289807babee04fda (commit)
from e9c78512b30b13fc6a9714e3fad0074bc2387bb5 (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 3c7725ea703e186c9d9ced3b0e03231982abdbfd
Author: Antonio Borneo <bor...@gm...>
Date: Thu Dec 22 12:34:41 2022 +0100
checkpatch: drop camelcase symbols not used anymore
With the rewrite of jim_handler commands as COMMAND_HANDLER, some
camelcase symbol from jimtcl are not referenced anymore in OpenOCD
code.
Drop such symbols from the camelcase whitelist.
Change-Id: I723be1820f13fe2cec7e4f0512a5e9da12889199
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8902
Tested-by: jenkins
diff --git a/tools/scripts/camelcase.txt b/tools/scripts/camelcase.txt
index 6c6c28daa..058df4d80 100644
--- a/tools/scripts/camelcase.txt
+++ b/tools/scripts/camelcase.txt
@@ -87,20 +87,14 @@ Jim_AppendString
Jim_AppendStrings
Jim_Cmd
Jim_CmdPrivData
-Jim_CmdProc
-Jim_CompareStringImmediate
-Jim_ConcatObj
Jim_CreateCommand
Jim_CreateInterp
Jim_DecrRefCount
-Jim_DelCmdProc
Jim_DeleteAssocData
Jim_DeleteCommand
-Jim_DictAddElement
Jim_DictPairs
Jim_DuplicateObj
Jim_Eval
-Jim_EvalExpression
Jim_EvalObj
Jim_EvalObjPrefix
Jim_EvalSource
@@ -113,46 +107,31 @@ Jim_GetDouble
Jim_GetEnum
Jim_GetExitCode
Jim_GetGlobalVariableStr
-Jim_GetIntRepPtr
-Jim_GetLong
Jim_GetResult
Jim_GetString
-Jim_GetVariable
Jim_GetWide
Jim_IncrRefCount
Jim_InitStaticExtensions
Jim_Interp
-Jim_Length
-Jim_ListAppendElement
Jim_ListGetIndex
Jim_ListLength
Jim_MakeErrorMessage
-Jim_NewDictObj
Jim_NewEmptyStringObj
Jim_NewIntObj
-Jim_NewListObj
Jim_NewStringObj
-Jim_NewWideObj
Jim_Obj
Jim_ProcessEvents
Jim_RegisterCoreCommands
Jim_SetAssocData
Jim_SetEmptyResult
Jim_SetResult
-Jim_SetResultBool
Jim_SetResultFormatted
-Jim_SetResultInt
Jim_SetResultString
-Jim_SetVariable
Jim_String
Jim_WrongNumArgs
cmdProc
-currentScriptObj
-delProc
-emptyObj
privData
returnCode
-typePtr
# from elf.h
Elf32_Addr
commit 6cec67251d29a4a62d330ff6289807babee04fda
Author: Antonio Borneo <bor...@gm...>
Date: Sat Dec 16 17:39:12 2023 +0100
command: drop Jim Command handler, at last
With all OpenOCD commands converted to COMMAND_HANDLER, we can
drop the management of jim_handler commands.
Drop also from documentation the subsection on Jim Command
Registration.
Change-Id: I4d13abc7e384e64ecb155cb40bbbd52bb79ec672
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8901
Tested-by: jenkins
diff --git a/doc/manual/helper.txt b/doc/manual/helper.txt
index 6cf3c977b..29e84e6f0 100644
--- a/doc/manual/helper.txt
+++ b/doc/manual/helper.txt
@@ -97,18 +97,6 @@ registration, while the @c unregister_command() and
These may be called at any time, allowing the command set to change in
response to system actions.
-@subsection helpercmdjim Jim Command Registration
-
-The command_registration structure provides support for registering
-native Jim command handlers (@c jim_handler) too. For these handlers,
-the module can provide help and usage support; however, this mechanism
-allows Jim handlers to be called as sub-commands of other commands.
-These commands may be registered with a private data value (@c
-jim_handler_data) that will be available when called, as with low-level
-Jim command registration.
-
-A command may have a normal @c handler or a @c jim_handler, but not both.
-
@subsection helpercmdregisterchains Command Chaining
When using register_commands(), the array of commands may reference
diff --git a/src/helper/command.c b/src/helper/command.c
index 218f0581e..b70081a4d 100644
--- a/src/helper/command.c
+++ b/src/helper/command.c
@@ -130,13 +130,13 @@ static struct command *command_new(struct command_context *cmd_ctx,
assert(cr->name);
/*
- * If it is a non-jim command with no .usage specified,
+ * If it is a command with no .usage specified,
* log an error.
*
* strlen(.usage) == 0 means that the command takes no
* arguments.
*/
- if (!cr->jim_handler && !cr->usage)
+ if (!cr->usage)
LOG_ERROR("BUG: command '%s' does not have the "
"'.usage' field filled out",
full_name);
@@ -152,7 +152,6 @@ static struct command *command_new(struct command_context *cmd_ctx,
}
c->handler = cr->handler;
- c->jim_handler = cr->jim_handler;
c->mode = cr->mode;
if (cr->help || cr->usage)
@@ -425,9 +424,6 @@ static bool command_can_run(struct command_context *cmd_ctx, struct command *c,
static int exec_command(Jim_Interp *interp, struct command_context *context,
struct command *c, int argc, Jim_Obj * const *argv)
{
- if (c->jim_handler)
- return c->jim_handler(interp, argc, argv);
-
/* use c->handler */
const char **words = malloc(argc * sizeof(char *));
if (!words) {
@@ -841,7 +837,7 @@ static int jim_command_dispatch(Jim_Interp *interp, int argc, Jim_Obj * const *a
script_debug(interp, argc, argv);
struct command *c = jim_to_command(interp);
- if (!c->jim_handler && !c->handler) {
+ if (!c->handler) {
Jim_EvalObjPrefix(interp, Jim_NewStringObj(interp, "usage", -1), 1, argv);
return JIM_ERR;
}
diff --git a/src/helper/command.h b/src/helper/command.h
index 18fe56178..8bd2430e0 100644
--- a/src/helper/command.h
+++ b/src/helper/command.h
@@ -197,7 +197,6 @@ typedef __COMMAND_HANDLER((*command_handler_t));
struct command {
char *name;
command_handler_t handler;
- Jim_CmdProc *jim_handler;
void *jim_handler_data;
/* Command handlers can use it for any handler specific data */
struct target *jim_override_target;
@@ -234,7 +233,6 @@ static inline struct command *jim_to_command(Jim_Interp *interp)
struct command_registration {
const char *name;
command_handler_t handler;
- Jim_CmdProc *jim_handler;
enum command_mode mode;
const char *help;
/** a string listing the options and arguments, required or optional */
diff --git a/src/server/telnet_server.c b/src/server/telnet_server.c
index 2c3f76980..3634a2a59 100644
--- a/src/server/telnet_server.c
+++ b/src/server/telnet_server.c
@@ -671,7 +671,7 @@ static void telnet_auto_complete(struct connection *connection)
} else if (jimcmd_is_oocd_command(jim_cmd)) {
struct command *cmd = jimcmd_privdata(jim_cmd);
- if (cmd && !cmd->handler && !cmd->jim_handler) {
+ if (cmd && !cmd->handler) {
/* Initial part of a multi-word command. Ignore it! */
ignore_cmd = true;
} else if (cmd && cmd->mode == COMMAND_CONFIG) {
-----------------------------------------------------------------------
Summary of changes:
doc/manual/helper.txt | 12 ------------
src/helper/command.c | 10 +++-------
src/helper/command.h | 2 --
src/server/telnet_server.c | 2 +-
tools/scripts/camelcase.txt | 21 ---------------------
5 files changed, 4 insertions(+), 43 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2025-05-25 12:42:30
|
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 e9c78512b30b13fc6a9714e3fad0074bc2387bb5 (commit)
via 114385280ae59fa0788b0077ba6d9596660cc714 (commit)
from c8979f6441eb62bb261827daa252c4e5596c4a39 (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 e9c78512b30b13fc6a9714e3fad0074bc2387bb5
Author: Antonio Borneo <bor...@gm...>
Date: Sat Dec 16 17:29:43 2023 +0100
target/arm_tpiu_swo: rewrite commands 'configure' and 'cget' as COMMAND_HANDLER
Rewrite only the command, but still use the old jimtcl specific
code in arm_tpiu_swo_configure(), shared with command 'create'.
Change-Id: If2258f048403f54faf229e602d9b395b71894f97
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8900
Tested-by: jenkins
diff --git a/src/target/arm_tpiu_swo.c b/src/target/arm_tpiu_swo.c
index f2cb1a0fd..afdd8ce91 100644
--- a/src/target/arm_tpiu_swo.c
+++ b/src/target/arm_tpiu_swo.c
@@ -554,20 +554,28 @@ err_no_params:
return JIM_ERR;
}
-static int jim_arm_tpiu_swo_configure(Jim_Interp *interp, int argc, Jim_Obj * const *argv)
+COMMAND_HANDLER(handle_arm_tpiu_swo_configure)
{
- struct command *c = jim_to_command(interp);
+ struct arm_tpiu_swo_object *obj = CMD_DATA;
+
+ if (!CMD_ARGC)
+ return ERROR_COMMAND_SYNTAX_ERROR;
+
struct jim_getopt_info goi;
+ jim_getopt_setup(&goi, CMD_CTX->interp, CMD_ARGC, CMD_JIMTCL_ARGV);
+ goi.is_configure = !strcmp(CMD_NAME, "configure");
- jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
- goi.is_configure = !strcmp(c->name, "configure");
- if (goi.argc < 1) {
- Jim_WrongNumArgs(goi.interp, goi.argc, goi.argv,
- "missing: -option ...");
- return JIM_ERR;
- }
- struct arm_tpiu_swo_object *obj = c->jim_handler_data;
- return arm_tpiu_swo_configure(&goi, obj);
+ int e = arm_tpiu_swo_configure(&goi, obj);
+
+ int reslen;
+ const char *result = Jim_GetString(Jim_GetResult(CMD_CTX->interp), &reslen);
+ if (reslen > 0)
+ command_print(CMD, "%s", result);
+
+ if (e != JIM_OK)
+ return ERROR_FAIL;
+
+ return ERROR_OK;
}
static int wrap_write_u32(struct target *target, struct adiv5_ap *tpiu_ap,
@@ -872,14 +880,14 @@ static const struct command_registration arm_tpiu_swo_instance_command_handlers[
{
.name = "configure",
.mode = COMMAND_ANY,
- .jim_handler = jim_arm_tpiu_swo_configure,
+ .handler = handle_arm_tpiu_swo_configure,
.help = "configure a new TPIU/SWO for use",
.usage = "[attribute value ...]",
},
{
.name = "cget",
.mode = COMMAND_ANY,
- .jim_handler = jim_arm_tpiu_swo_configure,
+ .handler = handle_arm_tpiu_swo_configure,
.help = "returns the specified TPIU/SWO attribute",
.usage = "attribute",
},
commit 114385280ae59fa0788b0077ba6d9596660cc714
Author: Antonio Borneo <bor...@gm...>
Date: Sun May 26 12:34:58 2024 +0200
target/arm_tpiu_swo: rewrite command 'swo create' as COMMAND_HANDLER
Rewrite only the command, but still use the old jimtcl specific
code in arm_tpiu_swo_configure(), shared with commands 'configure'
and 'cget'.
Change-Id: I39c69b1cdc23f7b5f875df3e15be987c715b0bcf
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8899
Tested-by: jenkins
diff --git a/src/target/arm_tpiu_swo.c b/src/target/arm_tpiu_swo.c
index e20cd5927..f2cb1a0fd 100644
--- a/src/target/arm_tpiu_swo.c
+++ b/src/target/arm_tpiu_swo.c
@@ -907,56 +907,25 @@ static const struct command_registration arm_tpiu_swo_instance_command_handlers[
COMMAND_REGISTRATION_DONE
};
-static int arm_tpiu_swo_create(Jim_Interp *interp, struct arm_tpiu_swo_object *obj)
+COMMAND_HANDLER(handle_arm_tpiu_swo_create)
{
- struct command_context *cmd_ctx;
- Jim_Cmd *cmd;
- int e;
+ int retval = ERROR_FAIL;
- cmd_ctx = current_command_context(interp);
- assert(cmd_ctx);
+ if (!CMD_ARGC)
+ return ERROR_COMMAND_SYNTAX_ERROR;
/* does this command exist? */
- cmd = Jim_GetCommand(interp, Jim_NewStringObj(interp, obj->name, -1), JIM_NONE);
- if (cmd) {
- Jim_SetResultFormatted(interp, "cannot create TPIU object because a command with name '%s' already exists",
- obj->name);
- return JIM_ERR;
- }
-
- /* now - create the new tpiu/swo name command */
- const struct command_registration obj_commands[] = {
- {
- .name = obj->name,
- .mode = COMMAND_ANY,
- .help = "tpiu/swo instance command group",
- .usage = "",
- .chain = arm_tpiu_swo_instance_command_handlers,
- },
- COMMAND_REGISTRATION_DONE
- };
- e = register_commands_with_data(cmd_ctx, NULL, obj_commands, obj);
- if (e != ERROR_OK)
- return JIM_ERR;
-
- list_add_tail(&obj->lh, &all_tpiu_swo);
-
- return JIM_OK;
-}
-
-static int jim_arm_tpiu_swo_create(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
-{
- struct jim_getopt_info goi;
- jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
- if (goi.argc < 1) {
- Jim_WrongNumArgs(interp, 1, argv, "name ?option option ...?");
- return JIM_ERR;
+ Jim_Cmd *jimcmd = Jim_GetCommand(CMD_CTX->interp, CMD_JIMTCL_ARGV[0], JIM_NONE);
+ if (jimcmd) {
+ command_print(CMD, "cannot create TPIU object because a command with name '%s' already exists",
+ CMD_ARGV[0]);
+ return ERROR_FAIL;
}
struct arm_tpiu_swo_object *obj = calloc(1, sizeof(struct arm_tpiu_swo_object));
if (!obj) {
LOG_ERROR("Out of memory");
- return JIM_ERR;
+ return ERROR_FAIL;
}
INIT_LIST_HEAD(&obj->connections);
adiv5_mem_ap_spot_init(&obj->spot);
@@ -968,36 +937,55 @@ static int jim_arm_tpiu_swo_create(Jim_Interp *interp, int argc, Jim_Obj *const
goto err_exit;
}
- Jim_Obj *n;
- jim_getopt_obj(&goi, &n);
- obj->name = strdup(Jim_GetString(n, NULL));
+ obj->name = strdup(CMD_ARGV[0]);
if (!obj->name) {
LOG_ERROR("Out of memory");
goto err_exit;
}
/* Do the rest as "configure" options */
- goi.is_configure = true;
+ struct jim_getopt_info goi;
+ jim_getopt_setup(&goi, CMD_CTX->interp, CMD_ARGC - 1, CMD_JIMTCL_ARGV + 1);
+ goi.is_configure = 1;
int e = arm_tpiu_swo_configure(&goi, obj);
+
+ int reslen;
+ const char *result = Jim_GetString(Jim_GetResult(CMD_CTX->interp), &reslen);
+ if (reslen > 0)
+ command_print(CMD, "%s", result);
+
if (e != JIM_OK)
goto err_exit;
if (!obj->spot.dap || obj->spot.ap_num == DP_APSEL_INVALID) {
- Jim_SetResultString(goi.interp, "-dap and -ap-num required when creating TPIU", -1);
+ command_print(CMD, "-dap and -ap-num required when creating TPIU");
goto err_exit;
}
- e = arm_tpiu_swo_create(goi.interp, obj);
- if (e != JIM_OK)
+ /* now - create the new tpiu/swo name command */
+ const struct command_registration obj_commands[] = {
+ {
+ .name = obj->name,
+ .mode = COMMAND_ANY,
+ .help = "tpiu/swo instance command group",
+ .usage = "",
+ .chain = arm_tpiu_swo_instance_command_handlers,
+ },
+ COMMAND_REGISTRATION_DONE
+ };
+ retval = register_commands_with_data(CMD_CTX, NULL, obj_commands, obj);
+ if (retval != ERROR_OK)
goto err_exit;
- return JIM_OK;
+ list_add_tail(&obj->lh, &all_tpiu_swo);
+
+ return ERROR_OK;
err_exit:
free(obj->name);
free(obj->out_filename);
free(obj);
- return JIM_ERR;
+ return retval;
}
COMMAND_HANDLER(handle_arm_tpiu_swo_names)
@@ -1192,7 +1180,7 @@ static const struct command_registration arm_tpiu_swo_subcommand_handlers[] = {
{
.name = "create",
.mode = COMMAND_ANY,
- .jim_handler = jim_arm_tpiu_swo_create,
+ .handler = handle_arm_tpiu_swo_create,
.usage = "name [-dap dap] [-ap-num num] [-baseaddr baseaddr]",
.help = "Creates a new TPIU or SWO object",
},
-----------------------------------------------------------------------
Summary of changes:
src/target/arm_tpiu_swo.c | 124 ++++++++++++++++++++++------------------------
1 file changed, 60 insertions(+), 64 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2025-05-25 12:41:56
|
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 c8979f6441eb62bb261827daa252c4e5596c4a39 (commit)
via 1aef2ae18d709a141404777dc5bce3ec59b37909 (commit)
from 532db01df29ab0636911f5cb0b40ed5747879c4e (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 c8979f6441eb62bb261827daa252c4e5596c4a39
Author: Antonio Borneo <bor...@gm...>
Date: Tue Dec 5 01:10:10 2023 +0100
target: arm_cti: rewrite commands 'cti create' as COMMAND_HANDLER
Rewrite only the command, but still use the old jimtcl specific
code in cti_configure().
Change-Id: I29fb952a7c8148416b301cbf78b6e342979af7d3
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8898
Tested-by: jenkins
diff --git a/src/target/arm_cti.c b/src/target/arm_cti.c
index b2f78eef7..830956e5c 100644
--- a/src/target/arm_cti.c
+++ b/src/target/arm_cti.c
@@ -434,49 +434,47 @@ static int cti_configure(struct jim_getopt_info *goi, struct arm_cti *cti)
return JIM_OK;
}
-static int cti_create(struct jim_getopt_info *goi)
+COMMAND_HANDLER(handle_cti_create)
{
- struct command_context *cmd_ctx;
- static struct arm_cti *cti;
- Jim_Obj *new_cmd;
- Jim_Cmd *cmd;
- const char *cp;
- int e;
-
- cmd_ctx = current_command_context(goi->interp);
- assert(cmd_ctx);
-
- if (goi->argc < 3) {
- Jim_WrongNumArgs(goi->interp, 1, goi->argv, "?name? ..options...");
- return JIM_ERR;
- }
- /* COMMAND */
- jim_getopt_obj(goi, &new_cmd);
- /* does this command exist? */
- cmd = Jim_GetCommand(goi->interp, new_cmd, JIM_NONE);
- if (cmd) {
- cp = Jim_GetString(new_cmd, NULL);
- Jim_SetResultFormatted(goi->interp, "Command: %s Exists", cp);
- return JIM_ERR;
+ if (CMD_ARGC < 3)
+ return ERROR_COMMAND_SYNTAX_ERROR;
+
+ /* check if the cti name clashes with an existing command name */
+ Jim_Cmd *jimcmd = Jim_GetCommand(CMD_CTX->interp, CMD_JIMTCL_ARGV[0], JIM_NONE);
+ if (jimcmd) {
+ command_print(CMD, "Command/cti: %s Exists", CMD_ARGV[0]);
+ return ERROR_FAIL;
}
/* Create it */
- cti = calloc(1, sizeof(*cti));
- if (!cti)
- return JIM_ERR;
+ struct arm_cti *cti = calloc(1, sizeof(*cti));
+ if (!cti) {
+ LOG_ERROR("Out of memory");
+ return ERROR_FAIL;
+ }
adiv5_mem_ap_spot_init(&cti->spot);
/* Do the rest as "configure" options */
- goi->is_configure = true;
- e = cti_configure(goi, cti);
+ struct jim_getopt_info goi;
+ jim_getopt_setup(&goi, CMD_CTX->interp, CMD_ARGC - 1, CMD_JIMTCL_ARGV + 1);
+ goi.is_configure = 1;
+ int e = cti_configure(&goi, cti);
if (e != JIM_OK) {
+ int reslen;
+ const char *result = Jim_GetString(Jim_GetResult(CMD_CTX->interp), &reslen);
+ if (reslen > 0)
+ command_print(CMD, "%s", result);
free(cti);
- return e;
+ return ERROR_COMMAND_ARGUMENT_INVALID;
}
- cp = Jim_GetString(new_cmd, NULL);
- cti->name = strdup(cp);
+ cti->name = strdup(CMD_ARGV[0]);
+ if (!cti->name) {
+ LOG_ERROR("Out of memory");
+ free(cti);
+ return ERROR_FAIL;
+ }
/* now - create the new cti name command */
const struct command_registration cti_subcommands[] = {
@@ -487,7 +485,7 @@ static int cti_create(struct jim_getopt_info *goi)
};
const struct command_registration cti_commands[] = {
{
- .name = cp,
+ .name = CMD_ARGV[0],
.mode = COMMAND_ANY,
.help = "cti instance command group",
.usage = "",
@@ -495,31 +493,24 @@ static int cti_create(struct jim_getopt_info *goi)
},
COMMAND_REGISTRATION_DONE
};
- e = register_commands_with_data(cmd_ctx, NULL, cti_commands, cti);
- if (e != ERROR_OK)
- return JIM_ERR;
+ int retval = register_commands_with_data(CMD_CTX, NULL, cti_commands, cti);
+ if (retval != ERROR_OK) {
+ free(cti->name);
+ free(cti);
+ return retval;
+ }
list_add_tail(&cti->lh, &all_cti);
cti->ap = dap_get_ap(cti->spot.dap, cti->spot.ap_num);
if (!cti->ap) {
- Jim_SetResultString(goi->interp, "Cannot get AP", -1);
- return JIM_ERR;
+ command_print(CMD, "Cannot get AP");
+ free(cti->name);
+ free(cti);
+ return ERROR_FAIL;
}
- return JIM_OK;
-}
-
-static int jim_cti_create(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
-{
- struct jim_getopt_info goi;
- jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
- if (goi.argc < 2) {
- Jim_WrongNumArgs(goi.interp, goi.argc, goi.argv,
- "<name> [<cti_options> ...]");
- return JIM_ERR;
- }
- return cti_create(&goi);
+ return ERROR_OK;
}
COMMAND_HANDLER(cti_handle_names)
@@ -539,7 +530,7 @@ static const struct command_registration cti_subcommand_handlers[] = {
{
.name = "create",
.mode = COMMAND_ANY,
- .jim_handler = jim_cti_create,
+ .handler = handle_cti_create,
.usage = "name '-chain-position' name [options ...]",
.help = "Creates a new CTI object",
},
commit 1aef2ae18d709a141404777dc5bce3ec59b37909
Author: Antonio Borneo <bor...@gm...>
Date: Tue Dec 5 00:45:54 2023 +0100
target: arm_dap: rewrite commands 'dap create' as COMMAND_HANDLER
Rewrite only the command, but still use the old jimtcl specific
code in dap_configure().
Change-Id: I3360884616367aae52f5b32247d9864000c53fdc
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8897
Tested-by: jenkins
diff --git a/src/target/arm_dap.c b/src/target/arm_dap.c
index c5bd6ccd4..be5e63c7c 100644
--- a/src/target/arm_dap.c
+++ b/src/target/arm_dap.c
@@ -333,61 +333,59 @@ static int dap_check_config(struct adiv5_dap *dap)
return ERROR_OK;
}
-static int dap_create(struct jim_getopt_info *goi)
+COMMAND_HANDLER(handle_dap_create)
{
- struct command_context *cmd_ctx;
- static struct arm_dap_object *dap;
- Jim_Obj *new_cmd;
- Jim_Cmd *cmd;
- const char *cp;
- int e;
+ if (CMD_ARGC < 3)
+ return ERROR_COMMAND_SYNTAX_ERROR;
- cmd_ctx = current_command_context(goi->interp);
- assert(cmd_ctx);
+ int retval = ERROR_COMMAND_ARGUMENT_INVALID;
- if (goi->argc < 3) {
- Jim_WrongNumArgs(goi->interp, 1, goi->argv, "?name? ..options...");
- return JIM_ERR;
- }
- /* COMMAND */
- jim_getopt_obj(goi, &new_cmd);
- /* does this command exist? */
- cmd = Jim_GetCommand(goi->interp, new_cmd, JIM_NONE);
- if (cmd) {
- cp = Jim_GetString(new_cmd, NULL);
- Jim_SetResultFormatted(goi->interp, "Command: %s Exists", cp);
- return JIM_ERR;
+ /* check if the dap name clashes with an existing command name */
+ Jim_Cmd *jimcmd = Jim_GetCommand(CMD_CTX->interp, CMD_JIMTCL_ARGV[0], JIM_NONE);
+ if (jimcmd) {
+ command_print(CMD, "Command/dap: %s Exists", CMD_ARGV[0]);
+ return ERROR_FAIL;
}
/* Create it */
- dap = calloc(1, sizeof(struct arm_dap_object));
- if (!dap)
- return JIM_ERR;
+ struct arm_dap_object *dap = calloc(1, sizeof(struct arm_dap_object));
+ if (!dap) {
+ LOG_ERROR("Out of memory");
+ return ERROR_FAIL;
+ }
dap_instance_init(&dap->dap);
- cp = Jim_GetString(new_cmd, NULL);
- dap->name = strdup(cp);
+ dap->name = strdup(CMD_ARGV[0]);
+ if (!dap->name) {
+ LOG_ERROR("Out of memory");
+ free(dap);
+ return ERROR_FAIL;
+ }
- e = dap_configure(goi, dap);
- if (e != JIM_OK)
+ struct jim_getopt_info goi;
+ jim_getopt_setup(&goi, CMD_CTX->interp, CMD_ARGC - 1, CMD_JIMTCL_ARGV + 1);
+ int e = dap_configure(&goi, dap);
+ if (e != JIM_OK) {
+ int reslen;
+ const char *result = Jim_GetString(Jim_GetResult(CMD_CTX->interp), &reslen);
+ if (reslen > 0)
+ command_print(CMD, "%s", result);
goto err;
+ }
if (!dap->dap.tap) {
- Jim_SetResultString(goi->interp, "-chain-position required when creating DAP", -1);
- e = JIM_ERR;
+ command_print(CMD, "-chain-position required when creating DAP");
goto err;
}
- e = dap_check_config(&dap->dap);
- if (e != ERROR_OK) {
- e = JIM_ERR;
+ retval = dap_check_config(&dap->dap);
+ if (retval != ERROR_OK)
goto err;
- }
struct command_registration dap_create_commands[] = {
{
- .name = cp,
+ .name = CMD_ARGV[0],
.mode = COMMAND_ANY,
.help = "dap instance command group",
.usage = "",
@@ -400,32 +398,18 @@ static int dap_create(struct jim_getopt_info *goi)
if (transport_is_hla())
dap_create_commands[0].chain = NULL;
- e = register_commands_with_data(cmd_ctx, NULL, dap_create_commands, dap);
- if (e != ERROR_OK) {
- e = JIM_ERR;
+ retval = register_commands_with_data(CMD_CTX, NULL, dap_create_commands, dap);
+ if (retval != ERROR_OK)
goto err;
- }
list_add_tail(&dap->lh, &all_dap);
- return JIM_OK;
+ return ERROR_OK;
err:
free(dap->name);
free(dap);
- return e;
-}
-
-static int jim_dap_create(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
-{
- struct jim_getopt_info goi;
- jim_getopt_setup(&goi, interp, argc - 1, argv + 1);
- if (goi.argc < 2) {
- Jim_WrongNumArgs(goi.interp, goi.argc, goi.argv,
- "<name> [<dap_options> ...]");
- return JIM_ERR;
- }
- return dap_create(&goi);
+ return retval;
}
COMMAND_HANDLER(handle_dap_names)
@@ -496,7 +480,7 @@ static const struct command_registration dap_subcommand_handlers[] = {
{
.name = "create",
.mode = COMMAND_ANY,
- .jim_handler = jim_dap_create,
+ .handler = handle_dap_create,
.usage = "name '-chain-position' name",
.help = "Creates a new DAP instance",
},
-----------------------------------------------------------------------
Summary of changes:
src/target/arm_cti.c | 93 ++++++++++++++++++++++++----------------------------
src/target/arm_dap.c | 92 +++++++++++++++++++++------------------------------
2 files changed, 80 insertions(+), 105 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2025-05-25 12:40:43
|
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 532db01df29ab0636911f5cb0b40ed5747879c4e (commit)
from 6a3abda0b46a777490a8ce5bc748e6fed6775354 (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 532db01df29ab0636911f5cb0b40ed5747879c4e
Author: Antonio Borneo <bor...@gm...>
Date: Fri May 2 16:10:39 2025 +0200
cortex-a: fix single-step on infinite loop
On ARMv7a/r the single-step is implemented through a HW breakpoint
that hits instructions at any address except the address of the
current instruction.
The method above fails in case of an infinite loop coded by a
single instruction that jumps on itself; in such case, the same
instruction (at the same address) is executed over and over and
the breakpoint never hits. In current code this case is wrongly
considered as an error.
Reduce the timeout while waiting for the HW breakpoint being hit,
then halt.
The jump on itself would be executed several times before the
timeout and the halt, but this is not an issue. There are few
"pathological" instructions in ARMv7a/r that jumps on itself and
that can have side effects if executed more than once. They are
listed in the code. We do not consider these as real use cases
generated by a compiler.
Document the method in the code.
Report that the single-step function is not properly managing the
HW breakpoints if it exits on error. To be fixed in the future.
Change-Id: I9641a4a3e2f68b83897ccf3a12d3c34e98a7805c
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8871
Tested-by: jenkins
diff --git a/src/target/cortex_a.c b/src/target/cortex_a.c
index ee27e1b21..46362017a 100644
--- a/src/target/cortex_a.c
+++ b/src/target/cortex_a.c
@@ -1169,6 +1169,29 @@ static int cortex_a_set_dscr_bits(struct target *target,
return retval;
}
+/*
+ * Single-step on ARMv7a/r is implemented through a HW breakpoint that hits
+ * every instruction at any address except the address of the current
+ * instruction.
+ * Such HW breakpoint is never hit in case of a single instruction that jumps
+ * on itself (infinite loop), or a WFI or a WFE. In this case, halt the CPU
+ * after a timeout.
+ * The jump on itself would be executed several times before the timeout forces
+ * the halt, but this is not an issue. In ARMv7a/r there are few "pathological"
+ * instructions, listed below, that jumps on itself and that can have side
+ * effects if executed more than once; but they are not considered as real use
+ * cases generated by a compiler.
+ * Some example:
+ * - 'pop {pc}' or multi register 'pop' including PC, when the new PC value is
+ * the same value of current PC. The single step will not stop at the first
+ * 'pop' and will continue taking values from the stack, modifying SP at each
+ * iteration.
+ * - 'rfeda', 'rfedb', 'rfeia', 'rfeib', when the new PC value is the same
+ * value of current PC. The register provided to the instruction (usually SP)
+ * will be incremented or decremented at each iteration.
+ *
+ * TODO: fix exit in case of error, cleaning HW breakpoints.
+ */
static int cortex_a_step(struct target *target, bool current, target_addr_t address,
bool handle_breakpoints)
{
@@ -1227,15 +1250,34 @@ static int cortex_a_step(struct target *target, bool current, target_addr_t addr
if (retval != ERROR_OK)
return retval;
- int64_t then = timeval_ms();
+ // poll at least once before starting the timeout
+ retval = cortex_a_poll(target);
+ if (retval != ERROR_OK)
+ return retval;
+
+ int64_t then = timeval_ms() + 100;
while (target->state != TARGET_HALTED) {
+ if (timeval_ms() > then)
+ break;
+
retval = cortex_a_poll(target);
if (retval != ERROR_OK)
return retval;
- if (target->state == TARGET_HALTED)
- break;
- if (timeval_ms() > then + 1000) {
- LOG_ERROR("timeout waiting for target halt");
+ }
+
+ if (target->state != TARGET_HALTED) {
+ LOG_TARGET_DEBUG(target, "timeout waiting for target halt, try halt");
+
+ retval = cortex_a_halt(target);
+ if (retval != ERROR_OK)
+ return retval;
+
+ retval = cortex_a_poll(target);
+ if (retval != ERROR_OK)
+ return retval;
+
+ if (target->state != TARGET_HALTED) {
+ LOG_TARGET_ERROR(target, "timeout waiting for target halt");
return ERROR_FAIL;
}
}
@@ -1255,9 +1297,6 @@ static int cortex_a_step(struct target *target, bool current, target_addr_t addr
if (breakpoint)
cortex_a_set_breakpoint(target, breakpoint, 0);
- if (target->state != TARGET_HALTED)
- LOG_DEBUG("target stepped");
-
return ERROR_OK;
}
-----------------------------------------------------------------------
Summary of changes:
src/target/cortex_a.c | 55 +++++++++++++++++++++++++++++++++++++++++++--------
1 file changed, 47 insertions(+), 8 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2025-05-17 14:04:25
|
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 6a3abda0b46a777490a8ce5bc748e6fed6775354 (commit)
from e30828a2769c294a9d2a36ed10f1f3516d82d1c1 (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 6a3abda0b46a777490a8ce5bc748e6fed6775354
Author: Bernhard Rosenkränzer <be...@ba...>
Date: Tue May 6 01:07:06 2025 +0200
helper: add base64 encoding/decoding helpers from FreeBSD
These helpers are needed by the updated RISC-V target files.
Change-Id: I5aa9f4e58eb75e1c7a1e8e0e3961725e2a915ebb
Signed-off-by: Bernhard Rosenkränzer <be...@ba...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8895
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/src/helper/Makefile.am b/src/helper/Makefile.am
index a17ada97d..807212478 100644
--- a/src/helper/Makefile.am
+++ b/src/helper/Makefile.am
@@ -3,6 +3,7 @@
noinst_LTLIBRARIES += %D%/libhelper.la
%C%_libhelper_la_SOURCES = \
+ %D%/base64.c \
%D%/binarybuffer.c \
%D%/options.c \
%D%/time_support_common.c \
@@ -18,6 +19,7 @@ noinst_LTLIBRARIES += %D%/libhelper.la
%D%/jim-nvp.c \
%D%/nvp.c \
%D%/align.h \
+ %D%/base64.h \
%D%/binarybuffer.h \
%D%/bitfield.h \
%D%/bits.h \
diff --git a/src/helper/base64.c b/src/helper/base64.c
new file mode 100644
index 000000000..5e0ee0846
--- /dev/null
+++ b/src/helper/base64.c
@@ -0,0 +1,160 @@
+// SPDX-License-Identifier: BSD-3-Clause
+
+/*
+ * Base64 encoding/decoding (RFC1341)
+ * Copyright (c) 2005-2011, Jouni Malinen <j...@w1...>
+ *
+ * Original file from FreeBSD code
+ * https://cgit.freebsd.org/src/tree/contrib/wpa/src/utils/base64.c?id=f05cddf940db
+ */
+
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "base64.h"
+
+static const unsigned char base64_table[65] =
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+
+/**
+ * base64_encode - Base64 encode
+ * @src: Data to be encoded
+ * @len: Length of the data to be encoded
+ * @out_len: Pointer to output length variable, or %NULL if not used
+ * Returns: Allocated buffer of out_len bytes of encoded data,
+ * or %NULL on failure
+ *
+ * Caller is responsible for freeing the returned buffer. Returned buffer is
+ * nul terminated to make it easier to use as a C string. The nul terminator is
+ * not included in out_len.
+ */
+unsigned char *base64_encode(const unsigned char *src, size_t len,
+ size_t *out_len)
+{
+ unsigned char *out, *pos;
+ const unsigned char *end, *in;
+ size_t olen;
+ int line_len;
+
+ olen = len * 4 / 3 + 4; /* 3-byte blocks to 4-byte */
+ olen += olen / 72; /* line feeds */
+ olen++; /* nul termination */
+ if (olen < len)
+ return NULL; /* integer overflow */
+ out = malloc(olen);
+ if (!out)
+ return NULL;
+
+ end = src + len;
+ in = src;
+ pos = out;
+ line_len = 0;
+ while (end - in >= 3) {
+ *pos++ = base64_table[in[0] >> 2];
+ *pos++ = base64_table[((in[0] & 0x03) << 4) | (in[1] >> 4)];
+ *pos++ = base64_table[((in[1] & 0x0f) << 2) | (in[2] >> 6)];
+ *pos++ = base64_table[in[2] & 0x3f];
+ in += 3;
+ line_len += 4;
+ if (line_len >= 72) {
+ *pos++ = '\n';
+ line_len = 0;
+ }
+ }
+
+ if (end - in) {
+ *pos++ = base64_table[in[0] >> 2];
+ if (end - in == 1) {
+ *pos++ = base64_table[(in[0] & 0x03) << 4];
+ *pos++ = '=';
+ } else {
+ *pos++ = base64_table[((in[0] & 0x03) << 4) |
+ (in[1] >> 4)];
+ *pos++ = base64_table[(in[1] & 0x0f) << 2];
+ }
+ *pos++ = '=';
+ line_len += 4;
+ }
+
+ if (line_len)
+ *pos++ = '\n';
+
+ *pos = '\0';
+ if (out_len)
+ *out_len = pos - out;
+ return out;
+}
+
+
+/**
+ * base64_decode - Base64 decode
+ * @src: Data to be decoded
+ * @len: Length of the data to be decoded
+ * @out_len: Pointer to output length variable
+ * Returns: Allocated buffer of out_len bytes of decoded data,
+ * or %NULL on failure
+ *
+ * Caller is responsible for freeing the returned buffer.
+ */
+unsigned char *base64_decode(const unsigned char *src, size_t len,
+ size_t *out_len)
+{
+ unsigned char dtable[256], *out, *pos, block[4], tmp;
+ size_t i, count, olen;
+ int pad = 0;
+
+ memset(dtable, 0x80, 256);
+ for (i = 0; i < sizeof(base64_table) - 1; i++)
+ dtable[base64_table[i]] = (unsigned char)i;
+ dtable['='] = 0;
+
+ count = 0;
+ for (i = 0; i < len; i++) {
+ if (dtable[src[i]] != 0x80)
+ count++;
+ }
+
+ if (count == 0 || count % 4)
+ return NULL;
+
+ olen = count / 4 * 3;
+ out = malloc(olen);
+ if (!out)
+ return NULL;
+ pos = out;
+
+ count = 0;
+ for (i = 0; i < len; i++) {
+ tmp = dtable[src[i]];
+ if (tmp == 0x80)
+ continue;
+
+ if (src[i] == '=')
+ pad++;
+ block[count] = tmp;
+ count++;
+ if (count == 4) {
+ *pos++ = (block[0] << 2) | (block[1] >> 4);
+ *pos++ = (block[1] << 4) | (block[2] >> 2);
+ *pos++ = (block[2] << 6) | block[3];
+ count = 0;
+ if (pad) {
+ if (pad == 1) {
+ pos--;
+ } else if (pad == 2) {
+ pos -= 2;
+ } else {
+ /* Invalid padding */
+ free(out);
+ return NULL;
+ }
+ break;
+ }
+ }
+ }
+
+ *out_len = pos - out;
+ return out;
+}
diff --git a/src/helper/base64.h b/src/helper/base64.h
new file mode 100644
index 000000000..d3e046213
--- /dev/null
+++ b/src/helper/base64.h
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+
+/*
+ * Base64 encoding/decoding (RFC1341)
+ * Copyright (c) 2005, Jouni Malinen <j...@w1...>
+ *
+ * Original file from FreeBSD code
+ * https://cgit.freebsd.org/src/tree/contrib/wpa/src/utils/base64.h?id=f05cddf940db
+ */
+
+#ifndef BASE64_H
+#define BASE64_H
+
+unsigned char *base64_encode(const unsigned char *src, size_t len,
+ size_t *out_len);
+unsigned char *base64_decode(const unsigned char *src, size_t len,
+ size_t *out_len);
+
+#endif /* BASE64_H */
-----------------------------------------------------------------------
Summary of changes:
src/helper/Makefile.am | 2 +
src/helper/base64.c | 160 +++++++++++++++++++++++++++++++++++++++++++++++++
src/helper/base64.h | 19 ++++++
3 files changed, 181 insertions(+)
create mode 100644 src/helper/base64.c
create mode 100644 src/helper/base64.h
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2025-05-17 08:42:47
|
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 e30828a2769c294a9d2a36ed10f1f3516d82d1c1 (commit)
from 744955e5b4f4f943c187622f4ae977bc4cd6fdb7 (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 e30828a2769c294a9d2a36ed10f1f3516d82d1c1
Author: Walter Ji <wal...@os...>
Date: Mon Mar 4 17:29:15 2024 +0800
helper: add bitfield helper macros
This patch ports FIELD_{GET,PREP,FIT} macros and related macro
from FreeBSD, referenced file:
- `src/tree/sys/compat/linuxkpi/common/include/linux/bitfield.h`
Checkpatch-ignore: MACRO_ARG_REUSE
Change-Id: I6fdf4514d3f95d62fadf7654409a4878d470a600
Signed-off-by: Walter Ji <wal...@os...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8171
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/src/helper/Makefile.am b/src/helper/Makefile.am
index e0fa331ea..a17ada97d 100644
--- a/src/helper/Makefile.am
+++ b/src/helper/Makefile.am
@@ -19,6 +19,7 @@ noinst_LTLIBRARIES += %D%/libhelper.la
%D%/nvp.c \
%D%/align.h \
%D%/binarybuffer.h \
+ %D%/bitfield.h \
%D%/bits.h \
%D%/configuration.h \
%D%/list.h \
diff --git a/src/helper/bitfield.h b/src/helper/bitfield.h
new file mode 100644
index 000000000..9f397282c
--- /dev/null
+++ b/src/helper/bitfield.h
@@ -0,0 +1,60 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+
+/*
+* Copyright (c) 2020-2024 The FreeBSD Foundation
+*
+* This software was developed by Björn Zeeb under sponsorship from
+* the FreeBSD Foundation.
+*/
+
+#ifndef OPENOCD_HELPER_BITFIELD_H
+#define OPENOCD_HELPER_BITFIELD_H
+
+/**
+ * These macros come from FreeBSD, check source on
+ * https://cgit.freebsd.org/src/tree/sys/compat/linuxkpi/common/include/linux/bitfield.h
+ * Which does not include example usages of them.
+ */
+
+#define __bf_shf(x) (__builtin_ffsll(x) - 1)
+
+/**
+ * FIELD_FIT(_mask, _value) - Check if a value fits in the specified bitfield mask
+ * @_mask: Bitfield mask
+ * @_value: Value to check
+ *
+ * This macro checks whether a given value fits within the range defined by the
+ * specified bitfield mask. It ensures that no bits outside the mask are set.
+ *
+ * Return: true if the value fits, false otherwise.
+ */
+#define FIELD_FIT(_mask, _value) \
+ (!(((typeof(_mask))(_value) << __bf_shf(_mask)) & ~(_mask)))
+
+/**
+ * FIELD_PREP(_mask, _value) - Prepare a value for insertion into a bitfield
+ * @_mask: Bitfield mask
+ * @_value: Value to insert
+ *
+ * This macro prepares a value for insertion into a bitfield by shifting the
+ * value into the position defined by the mask and applying the mask.
+ *
+ * Return: The prepared bitfield value.
+ */
+#define FIELD_PREP(_mask, _value) \
+ (((typeof(_mask))(_value) << __bf_shf(_mask)) & (_mask))
+
+/**
+ * FIELD_GET(_mask, _value) - Extract a value from a bitfield
+ * @_mask: Bitfield mask
+ * @_value: Bitfield value to extract from
+ *
+ * This macro extracts a value from a bitfield by masking and shifting the
+ * relevant bits down to the least significant position.
+ *
+ * Return: The extracted value.
+ */
+#define FIELD_GET(_mask, _value) \
+ ((typeof(_mask))(((_value) & (_mask)) >> __bf_shf(_mask)))
+
+#endif /* OPENOCD_HELPER_BITFIELD_H */
-----------------------------------------------------------------------
Summary of changes:
src/helper/Makefile.am | 1 +
src/helper/bitfield.h | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 61 insertions(+)
create mode 100644 src/helper/bitfield.h
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2025-05-09 12:14:02
|
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 744955e5b4f4f943c187622f4ae977bc4cd6fdb7 (commit)
from 1b2a2b818573269e9704e1e117424210941de3c3 (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 744955e5b4f4f943c187622f4ae977bc4cd6fdb7
Author: Antonio Borneo <bor...@gm...>
Date: Mon May 5 10:00:10 2025 +0200
LICENSES: add dual/CC-BY-4.0
The license CC-BY-4.0 is not compatible with GPLv2, but files can
be dual licensed with a GPLv2 compatible license 'OR' CC-BY-4.0.
This is the case for some file auto-generated by riscv project.
Change-Id: I4313d85a569a5e6423392129a730d1e22ef17c51
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8894
Reviewed-by: Bernhard Rosenkraenzer <be...@ba...>
Tested-by: jenkins
diff --git a/LICENSES/dual/CC-BY-4.0 b/LICENSES/dual/CC-BY-4.0
new file mode 100644
index 000000000..e20b7a455
--- /dev/null
+++ b/LICENSES/dual/CC-BY-4.0
@@ -0,0 +1,409 @@
+Valid-License-Identifier: CC-BY-4.0
+SPDX-URL: https://spdx.org/licenses/CC-BY-4.0
+Usage-Guide:
+ Do NOT use on OpenOCD code. This license is not GPL2 compatible. It may only
+ be used for dual-licensed files where the other license is GPL2 compatible.
+ If you end up using this it MUST be used together with a GPL2 compatible
+ license using "OR".
+ To use the Creative Commons Attribution 4.0 International license put
+ the following SPDX tag/value pair into a comment according to the
+ placement guidelines in the licensing rules documentation:
+ SPDX-License-Identifier: CC-BY-4.0
+License-Text:
+
+Creative Commons Attribution 4.0 International
+
+=======================================================================
+
+Creative Commons Corporation ("Creative Commons") is not a law firm and
+does not provide legal services or legal advice. Distribution of
+Creative Commons public licenses does not create a lawyer-client or
+other relationship. Creative Commons makes its licenses and related
+information available on an "as-is" basis. Creative Commons gives no
+warranties regarding its licenses, any material licensed under their
+terms and conditions, or any related information. Creative Commons
+disclaims all liability for damages resulting from their use to the
+fullest extent possible.
+
+Using Creative Commons Public Licenses
+
+Creative Commons public licenses provide a standard set of terms and
+conditions that creators and other rights holders may use to share
+original works of authorship and other material subject to copyright
+and certain other rights specified in the public license below. The
+following considerations are for informational purposes only, are not
+exhaustive, and do not form part of our licenses.
+
+ Considerations for licensors: Our public licenses are
+ intended for use by those authorized to give the public
+ permission to use material in ways otherwise restricted by
+ copyright and certain other rights. Our licenses are
+ irrevocable. Licensors should read and understand the terms
+ and conditions of the license they choose before applying it.
+ Licensors should also secure all rights necessary before
+ applying our licenses so that the public can reuse the
+ material as expected. Licensors should clearly mark any
+ material not subject to the license. This includes other CC-
+ licensed material, or material used under an exception or
+ limitation to copyright. More considerations for licensors:
+ wiki.creativecommons.org/Considerations_for_licensors
+
+ Considerations for the public: By using one of our public
+ licenses, a licensor grants the public permission to use the
+ licensed material under specified terms and conditions. If
+ the licensor's permission is not necessary for any reason--for
+ example, because of any applicable exception or limitation to
+ copyright--then that use is not regulated by the license. Our
+ licenses grant only permissions under copyright and certain
+ other rights that a licensor has authority to grant. Use of
+ the licensed material may still be restricted for other
+ reasons, including because others have copyright or other
+ rights in the material. A licensor may make special requests,
+ such as asking that all changes be marked or described.
+ Although not required by our licenses, you are encouraged to
+ respect those requests where reasonable. More considerations
+ for the public:
+ wiki.creativecommons.org/Considerations_for_licensees
+
+=======================================================================
+
+Creative Commons Attribution 4.0 International Public License
+
+By exercising the Licensed Rights (defined below), You accept and agree
+to be bound by the terms and conditions of this Creative Commons
+Attribution 4.0 International Public License ("Public License"). To the
+extent this Public License may be interpreted as a contract, You are
+granted the Licensed Rights in consideration of Your acceptance of
+these terms and conditions, and the Licensor grants You such rights in
+consideration of benefits the Licensor receives from making the
+Licensed Material available under these terms and conditions.
+
+
+Section 1 -- Definitions.
+
+ a. Adapted Material means material subject to Copyright and Similar
+ Rights that is derived from or based upon the Licensed Material
+ and in which the Licensed Material is translated, altered,
+ arranged, transformed, or otherwise modified in a manner requiring
+ permission under the Copyright and Similar Rights held by the
+ Licensor. For purposes of this Public License, where the Licensed
+ Material is a musical work, performance, or sound recording,
+ Adapted Material is always produced where the Licensed Material is
+ synched in timed relation with a moving image.
+
+ b. Adapter's License means the license You apply to Your Copyright
+ and Similar Rights in Your contributions to Adapted Material in
+ accordance with the terms and conditions of this Public License.
+
+ c. Copyright and Similar Rights means copyright and/or similar rights
+ closely related to copyright including, without limitation,
+ performance, broadcast, sound recording, and Sui Generis Database
+ Rights, without regard to how the rights are labeled or
+ categorized. For purposes of this Public License, the rights
+ specified in Section 2(b)(1)-(2) are not Copyright and Similar
+ Rights.
+
+ d. Effective Technological Measures means those measures that, in the
+ absence of proper authority, may not be circumvented under laws
+ fulfilling obligations under Article 11 of the WIPO Copyright
+ Treaty adopted on December 20, 1996, and/or similar international
+ agreements.
+
+ e. Exceptions and Limitations means fair use, fair dealing, and/or
+ any other exception or limitation to Copyright and Similar Rights
+ that applies to Your use of the Licensed Material.
+
+ f. Licensed Material means the artistic or literary work, database,
+ or other material to which the Licensor applied this Public
+ License.
+
+ g. Licensed Rights means the rights granted to You subject to the
+ terms and conditions of this Public License, which are limited to
+ all Copyright and Similar Rights that apply to Your use of the
+ Licensed Material and that the Licensor has authority to license.
+
+ h. Licensor means the individual(s) or entity(ies) granting rights
+ under this Public License.
+
+ i. Share means to provide material to the public by any means or
+ process that requires permission under the Licensed Rights, such
+ as reproduction, public display, public performance, distribution,
+ dissemination, communication, or importation, and to make material
+ available to the public including in ways that members of the
+ public may access the material from a place and at a time
+ individually chosen by them.
+
+ j. Sui Generis Database Rights means rights other than copyright
+ resulting from Directive 96/9/EC of the European Parliament and of
+ the Council of 11 March 1996 on the legal protection of databases,
+ as amended and/or succeeded, as well as other essentially
+ equivalent rights anywhere in the world.
+
+ k. You means the individual or entity exercising the Licensed Rights
+ under this Public License. Your has a corresponding meaning.
+
+
+Section 2 -- Scope.
+
+ a. License grant.
+
+ 1. Subject to the terms and conditions of this Public License,
+ the Licensor hereby grants You a worldwide, royalty-free,
+ non-sublicensable, non-exclusive, irrevocable license to
+ exercise the Licensed Rights in the Licensed Material to:
+
+ a. reproduce and Share the Licensed Material, in whole or
+ in part; and
+
+ b. produce, reproduce, and Share Adapted Material.
+
+ 2. Exceptions and Limitations. For the avoidance of doubt, where
+ Exceptions and Limitations apply to Your use, this Public
+ License does not apply, and You do not need to comply with
+ its terms and conditions.
+
+ 3. Term. The term of this Public License is specified in Section
+ 6(a).
+
+ 4. Media and formats; technical modifications allowed. The
+ Licensor authorizes You to exercise the Licensed Rights in
+ all media and formats whether now known or hereafter created,
+ and to make technical modifications necessary to do so. The
+ Licensor waives and/or agrees not to assert any right or
+ authority to forbid You from making technical modifications
+ necessary to exercise the Licensed Rights, including
+ technical modifications necessary to circumvent Effective
+ Technological Measures. For purposes of this Public License,
+ simply making modifications authorized by this Section 2(a)
+ (4) never produces Adapted Material.
+
+ 5. Downstream recipients.
+
+ a. Offer from the Licensor -- Licensed Material. Every
+ recipient of the Licensed Material automatically
+ receives an offer from the Licensor to exercise the
+ Licensed Rights under the terms and conditions of this
+ Public License.
+
+ b. No downstream restrictions. You may not offer or impose
+ any additional or different terms or conditions on, or
+ apply any Effective Technological Measures to, the
+ Licensed Material if doing so restricts exercise of the
+ Licensed Rights by any recipient of the Licensed
+ Material.
+
+ 6. No endorsement. Nothing in this Public License constitutes or
+ may be construed as permission to assert or imply that You
+ are, or that Your use of the Licensed Material is, connected
+ with, or sponsored, endorsed, or granted official status by,
+ the Licensor or others designated to receive attribution as
+ provided in Section 3(a)(1)(A)(i).
+
+ b. Other rights.
+
+ 1. Moral rights, such as the right of integrity, are not
+ licensed under this Public License, nor are publicity,
+ privacy, and/or other similar personality rights; however, to
+ the extent possible, the Licensor waives and/or agrees not to
+ assert any such rights held by the Licensor to the limited
+ extent necessary to allow You to exercise the Licensed
+ Rights, but not otherwise.
+
+ 2. Patent and trademark rights are not licensed under this
+ Public License.
+
+ 3. To the extent possible, the Licensor waives any right to
+ collect royalties from You for the exercise of the Licensed
+ Rights, whether directly or through a collecting society
+ under any voluntary or waivable statutory or compulsory
+ licensing scheme. In all other cases the Licensor expressly
+ reserves any right to collect such royalties.
+
+
+Section 3 -- License Conditions.
+
+Your exercise of the Licensed Rights is expressly made subject to the
+following conditions.
+
+ a. Attribution.
+
+ 1. If You Share the Licensed Material (including in modified
+ form), You must:
+
+ a. retain the following if it is supplied by the Licensor
+ with the Licensed Material:
+
+ i. identification of the creator(s) of the Licensed
+ Material and any others designated to receive
+ attribution, in any reasonable manner requested by
+ the Licensor (including by pseudonym if
+ designated);
+
+ ii. a copyright notice;
+
+ iii. a notice that refers to this Public License;
+
+ iv. a notice that refers to the disclaimer of
+ warranties;
+
+ v. a URI or hyperlink to the Licensed Material to the
+ extent reasonably practicable;
+
+ b. indicate if You modified the Licensed Material and
+ retain an indication of any previous modifications; and
+
+ c. indicate the Licensed Material is licensed under this
+ Public License, and include the text of, or the URI or
+ hyperlink to, this Public License.
+
+ 2. You may satisfy the conditions in Section 3(a)(1) in any
+ reasonable manner based on the medium, means, and context in
+ which You Share the Licensed Material. For example, it may be
+ reasonable to satisfy the conditions by providing a URI or
+ hyperlink to a resource that includes the required
+ information.
+
+ 3. If requested by the Licensor, You must remove any of the
+ information required by Section 3(a)(1)(A) to the extent
+ reasonably practicable.
+
+ 4. If You Share Adapted Material You produce, the Adapter's
+ License You apply must not prevent recipients of the Adapted
+ Material from complying with this Public License.
+
+
+Section 4 -- Sui Generis Database Rights.
+
+Where the Licensed Rights include Sui Generis Database Rights that
+apply to Your use of the Licensed Material:
+
+ a. for the avoidance of doubt, Section 2(a)(1) grants You the right
+ to extract, reuse, reproduce, and Share all or a substantial
+ portion of the contents of the database;
+
+ b. if You include all or a substantial portion of the database
+ contents in a database in which You have Sui Generis Database
+ Rights, then the database in which You have Sui Generis Database
+ Rights (but not its individual contents) is Adapted Material; and
+
+ c. You must comply with the conditions in Section 3(a) if You Share
+ all or a substantial portion of the contents of the database.
+
+For the avoidance of doubt, this Section 4 supplements and does not
+replace Your obligations under this Public License where the Licensed
+Rights include other Copyright and Similar Rights.
+
+
+Section 5 -- Disclaimer of Warranties and Limitation of Liability.
+
+ a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
+ EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
+ AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
+ ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
+ IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
+ WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
+ PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
+ ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
+ KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
+ ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
+
+ b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
+ TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
+ NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
+ INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
+ COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
+ USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
+ ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
+ DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
+ IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
+
+ c. The disclaimer of warranties and limitation of liability provided
+ above shall be interpreted in a manner that, to the extent
+ possible, most closely approximates an absolute disclaimer and
+ waiver of all liability.
+
+
+Section 6 -- Term and Termination.
+
+ a. This Public License applies for the term of the Copyright and
+ Similar Rights licensed here. However, if You fail to comply with
+ this Public License, then Your rights under this Public License
+ terminate automatically.
+
+ b. Where Your right to use the Licensed Material has terminated under
+ Section 6(a), it reinstates:
+
+ 1. automatically as of the date the violation is cured, provided
+ it is cured within 30 days of Your discovery of the
+ violation; or
+
+ 2. upon express reinstatement by the Licensor.
+
+ For the avoidance of doubt, this Section 6(b) does not affect any
+ right the Licensor may have to seek remedies for Your violations
+ of this Public License.
+
+ c. For the avoidance of doubt, the Licensor may also offer the
+ Licensed Material under separate terms or conditions or stop
+ distributing the Licensed Material at any time; however, doing so
+ will not terminate this Public License.
+
+ d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
+ License.
+
+
+Section 7 -- Other Terms and Conditions.
+
+ a. The Licensor shall not be bound by any additional or different
+ terms or conditions communicated by You unless expressly agreed.
+
+ b. Any arrangements, understandings, or agreements regarding the
+ Licensed Material not stated herein are separate from and
+ independent of the terms and conditions of this Public License.
+
+
+Section 8 -- Interpretation.
+
+ a. For the avoidance of doubt, this Public License does not, and
+ shall not be interpreted to, reduce, limit, restrict, or impose
+ conditions on any use of the Licensed Material that could lawfully
+ be made without permission under this Public License.
+
+ b. To the extent possible, if any provision of this Public License is
+ deemed unenforceable, it shall be automatically reformed to the
+ minimum extent necessary to make it enforceable. If the provision
+ cannot be reformed, it shall be severed from this Public License
+ without affecting the enforceability of the remaining terms and
+ conditions.
+
+ c. No term or condition of this Public License will be waived and no
+ failure to comply consented to unless expressly agreed to by the
+ Licensor.
+
+ d. Nothing in this Public License constitutes or may be interpreted
+ as a limitation upon, or waiver of, any privileges and immunities
+ that apply to the Licensor or You, including from the legal
+ processes of any jurisdiction or authority.
+
+
+=======================================================================
+
+Creative Commons is not a party to its public
+licenses. Notwithstanding, Creative Commons may elect to apply one of
+its public licenses to material it publishes and in those instances
+will be considered the "Licensor." The text of the Creative Commons
+public licenses is dedicated to the public domain under the CC0 Public
+Domain Dedication. Except for the limited purpose of indicating that
+material is shared under a Creative Commons public license or as
+otherwise permitted by the Creative Commons policies published at
+creativecommons.org/policies, Creative Commons does not authorize the
+use of the trademark "Creative Commons" or any other trademark or logo
+of Creative Commons without its prior written consent including,
+without limitation, in connection with any unauthorized modifications
+to any of its public licenses or any other arrangements,
+understandings, or agreements concerning use of licensed material. For
+the avoidance of doubt, this paragraph does not form part of the
+public licenses.
+
+Creative Commons may be contacted at creativecommons.org.
+
diff --git a/LICENSES/license-rules.txt b/LICENSES/license-rules.txt
index ecc8e4db1..66aaaa5b4 100644
--- a/LICENSES/license-rules.txt
+++ b/LICENSES/license-rules.txt
@@ -187,7 +187,21 @@ OpenOCD, can be broken down into:
License-Text:
Full license text
-2. Exceptions:
+2. Dual Licensing Only:
+
+ These licenses should only be used to dual license code with another
+ license in addition to a preferred license. These licenses are available
+ from the directory::
+
+ LICENSES/dual/
+
+ in the OpenOCD source tree.
+
+ The files in this directory contain the full license text and
+ `Metatags`_. The file names are identical to the SPDX license
+ identifier which shall be used for the license in source files.
+
+3. Exceptions:
Some licenses can be amended with exceptions which grant certain rights
which the original license does not. These exceptions are available
@@ -244,7 +258,7 @@ OpenOCD, can be broken down into:
License-Text:
Full license text
-3. Stand-alone licenses:
+4. Stand-alone licenses:
These licenses should only be used for stand-alone applications that are
distributed with OpenOCD but are not included in the OpenOCD binary.
diff --git a/Makefile.am b/Makefile.am
index 7fe137583..b2b6cef00 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -70,6 +70,7 @@ EXTRA_DIST += \
$(EXTRA_DIST_NEWS) \
Doxyfile.in \
LICENSES/license-rules.txt \
+ LICENSES/dual/CC-BY-4.0 \
LICENSES/exceptions/eCos-exception-2.0 \
LICENSES/preferred/BSD-1-Clause \
LICENSES/preferred/BSD-2-Clause \
diff --git a/tools/scripts/spdxcheck.py b/tools/scripts/spdxcheck.py
index f88294379..9180f61fa 100755
--- a/tools/scripts/spdxcheck.py
+++ b/tools/scripts/spdxcheck.py
@@ -50,7 +50,7 @@ def read_spdxdata(repo):
# The subdirectories of LICENSES in the kernel source
# Note: exceptions needs to be parsed as last directory.
# OpenOCD specific: Begin
- license_dirs = [ "preferred", "stand-alone", "exceptions" ]
+ license_dirs = [ "preferred", "dual", "exceptions", "stand-alone" ]
# OpenOCD specific: End
lictree = repo.head.commit.tree['LICENSES']
-----------------------------------------------------------------------
Summary of changes:
LICENSES/dual/CC-BY-4.0 | 409 +++++++++++++++++++++++++++++++++++++++++++++
LICENSES/license-rules.txt | 18 +-
Makefile.am | 1 +
tools/scripts/spdxcheck.py | 2 +-
4 files changed, 427 insertions(+), 3 deletions(-)
create mode 100644 LICENSES/dual/CC-BY-4.0
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2025-05-09 12:13:47
|
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 1b2a2b818573269e9704e1e117424210941de3c3 (commit)
from f42540cc90b874c7662c59b8e4ebef3f657717ad (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 1b2a2b818573269e9704e1e117424210941de3c3
Author: Evgeniy Naydanov <evg...@sy...>
Date: Fri Nov 29 17:44:50 2024 +0300
testing/tcl_commands: test `target create`, `cget`, `configure`
Introduce basic testing of error-handling in target configuration
related commands.
The tests can be run via `make check` when JTAG `dummy` adapter is
enabled.
Change-Id: Id0f382046dd70007d8e696d82d2396a7ccab7a33
Signed-off-by: Evgeniy Naydanov <evg...@sy...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8644
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/Makefile.am b/Makefile.am
index 271a2c165..7fe137583 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -10,7 +10,7 @@ AUTOMAKE_OPTIONS = gnu 1.6
AM_DISTCHECK_CONFIGURE_FLAGS = --disable-install-jim
# do not run Jim Tcl tests (esp. during distcheck)
-check-recursive: SUBDIRS :=
+check-recursive: SUBDIRS := $(SUBDIRS:jimtcl=)
nobase_dist_pkgdata_DATA = \
contrib/libdcc/dcc_stdio.c \
@@ -36,6 +36,9 @@ EXTRA_DIST += jimtcl/configure.gnu
DISTCLEANFILES += jimtcl/jsmn/jsmn.o
endif
+SUBDIRS += testing
+DIST_SUBDIRS += testing
+
# common flags used in openocd build
AM_CFLAGS = $(GCC_WARNINGS)
AM_LDFLAGS =
diff --git a/configure.ac b/configure.ac
index 9db378702..e48653b21 100644
--- a/configure.ac
+++ b/configure.ac
@@ -835,7 +835,9 @@ AS_IF([test "x$gcc_warnings" = "xyes"], [
AC_SUBST(EXTRA_DIST_NEWS, ["$(echo $srcdir/NEWS-*)"])
AC_CONFIG_FILES([
- Makefile
+ Makefile \
+ testing/Makefile \
+ testing/tcl_commands/Makefile
])
AC_OUTPUT
diff --git a/testing/Makefile.am b/testing/Makefile.am
new file mode 100644
index 000000000..22778a4c2
--- /dev/null
+++ b/testing/Makefile.am
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+SUBDIRS = tcl_commands
+DIST_SUBDIRS = tcl_commands
diff --git a/testing/tcl_commands/Makefile.am b/testing/tcl_commands/Makefile.am
new file mode 100644
index 000000000..fe8d15070
--- /dev/null
+++ b/testing/tcl_commands/Makefile.am
@@ -0,0 +1,15 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+TESTS =
+
+if DUMMY
+TESTS += \
+ test-target-create-command.cfg \
+ test-target-configure-cget-command.cfg
+endif
+
+EXTRA_DIST = utils.tcl $(TESTS)
+
+TEST_EXTENSIONS = .cfg
+CFG_LOG_COMPILER = $(top_builddir)/src/openocd
+AM_CFG_LOG_FLAGS = -f $(abs_srcdir)/utils.tcl -f
diff --git a/testing/tcl_commands/test-target-configure-cget-command.cfg b/testing/tcl_commands/test-target-configure-cget-command.cfg
new file mode 100644
index 000000000..2d546c83d
--- /dev/null
+++ b/testing/tcl_commands/test-target-configure-cget-command.cfg
@@ -0,0 +1,31 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+namespace import testing_helpers::*
+namespace import configure_testing::*
+
+adapter driver dummy
+jtag newtap tap cpu -irlen 5
+
+{*}[target_create_first_args] {*}[simple_configure_options]
+
+set target_name [lindex [target names] 0]
+
+check_matches testee {$target_name cget -type}
+
+foreach {opt arg} [simple_configure_options] {
+ check_syntax_err {$target_name cget $opt extra_arg}
+ check_matches [dict get [simple_configure_options] $opt] \
+ {$target_name cget $opt}
+}
+
+check_error_matches .*-event.* {$target_name cget -event}
+$target_name cget -event examine-start
+check_syntax_err {$target_name cget -event examine-start extra_arg}
+
+check_syntax_err {$target_name configure}
+
+foreach {opt arg} [simple_configure_options] {
+ $target_name configure $opt [$target_name cget $opt]
+}
+
+shutdown
diff --git a/testing/tcl_commands/test-target-create-command.cfg b/testing/tcl_commands/test-target-create-command.cfg
new file mode 100644
index 000000000..11264316c
--- /dev/null
+++ b/testing/tcl_commands/test-target-create-command.cfg
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+namespace import testing_helpers::*
+namespace import configure_testing::*
+
+adapter driver dummy
+jtag newtap tap cpu -irlen 5
+
+check_syntax_err {target create}
+check_syntax_err {target create}
+check_syntax_err {target create test.target}
+check_error_matches -chain-position {target create test.target testee}
+
+{*}[target_create_first_args] {*}[simple_configure_options]
+
+foreach {opt arg} [simple_configure_options] {
+ check_error_matches ".*${opt}.*" {{*}[target_create_first_args] $opt}
+}
+
+foreach {opt1 arg1} [simple_configure_options] {
+ foreach {opt2 arg2} [simple_configure_options] {
+ check_error_matches ".*${opt2}.*" \
+ {{*}[target_create_first_args] $opt1 $arg1 $opt2}
+ check_error_matches {} \
+ {{*}[target_create_first_args] $opt1 $opt2 $arg2}
+ }
+}
+
+check_error_matches ".*-type.*" \
+ {{*}[target_create_first_args] -type}
+
+check_error_matches ".*-type.*" \
+ {{*}[target_create_first_args] {*}[simple_configure_options] -type}
+
+check_error_matches {.*-event [^ ]+ .*} \
+ {{*}[target_create_first_args] -event}
+
+check_error_matches {.*not-an-event.*} \
+ {{*}[target_create_first_args] -event not-an-event}
+
+check_error_matches {.*-event examine-start [^ ]+.*} \
+ {{*}[target_create_first_args] -event examine-start}
+
+{*}[target_create_first_args] {*}[simple_configure_options] \
+ -event examine-start body
+{*}[target_create_first_args] {*}[simple_configure_options] \
+ -event examine-start body \
+ -event examine-end another-body \
+ -event examine-start new-body
+{*}[target_create_first_args] -event examine-start body {*}[simple_configure_options]
+
+{*}[target_create_first_args] {*}[simple_configure_options] -defer-examine
+
+shutdown
diff --git a/testing/tcl_commands/utils.tcl b/testing/tcl_commands/utils.tcl
new file mode 100644
index 000000000..dfc896661
--- /dev/null
+++ b/testing/tcl_commands/utils.tcl
@@ -0,0 +1,80 @@
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+namespace eval testing_helpers {
+
+ proc test_failure message {
+ echo $message
+ shutdown error
+ }
+
+ proc check_for_error {expctd_code msg_ptrn script} {
+ set code [catch {uplevel $script} msg]
+ set expanded_script [uplevel subst \"$script\"]
+ if {!$code} {
+ test_failure \
+ "'$expanded_script' finished successfully. \
+ Was expecting an error."
+ }
+ if {$expctd_code ne "" && $code != $expctd_code} {
+ test_failure \
+ "'$expanded_script' returned unexpected error code $code. \
+ Was expecting $expctd_code. Error message: '$msg'"
+ }
+ if {$msg_ptrn ne "" && ![regexp -- $msg_ptrn $msg]} {
+ test_failure \
+ "'$expanded_script' returned unexpected error message '$msg'. \
+ Was expecting '$msg_ptrn'. Error code: $code"
+ }
+ }
+
+ proc check_error_matches {pattern script} {
+ tailcall check_for_error {} $pattern $script
+ }
+
+ proc check_syntax_err script {
+ tailcall check_for_error -601 {} $script
+ }
+
+ proc check_matches {pattern script} {
+ set result [uplevel $script]
+ if {[regexp $pattern $result]} {return}
+ test_failure \
+ "'$script' produced unexpected result '$result'. \
+ Was expecting '$pattern'."
+ }
+
+ namespace export check_error_matches check_syntax_err check_matches
+}
+
+namespace eval configure_testing {
+
+ variable target_idx 0
+
+ proc unique_tgt_name {} {
+ variable target_idx
+ incr target_idx
+ return test_target$target_idx
+ }
+
+ proc target_create_first_args {} {
+ return "target create [unique_tgt_name] testee"
+ }
+
+ proc simple_configure_options {} {
+ return {
+ -work-area-virt 0
+ -work-area-phys 0
+ -work-area-size 1
+ -work-area-backup 0
+ -endian little
+ -coreid 1
+ -chain-position tap.cpu
+ -dbgbase 0
+ -rtos hwthread
+ -gdb-port 0
+ -gdb-max-connections 1
+ }
+ }
+
+ namespace export target_create_first_args simple_configure_options
+}
-----------------------------------------------------------------------
Summary of changes:
Makefile.am | 5 +-
configure.ac | 4 +-
testing/Makefile.am | 4 ++
testing/tcl_commands/Makefile.am | 15 ++++
.../test-target-configure-cget-command.cfg | 31 +++++++++
.../tcl_commands/test-target-create-command.cfg | 54 +++++++++++++++
testing/tcl_commands/utils.tcl | 80 ++++++++++++++++++++++
7 files changed, 191 insertions(+), 2 deletions(-)
create mode 100644 testing/Makefile.am
create mode 100644 testing/tcl_commands/Makefile.am
create mode 100644 testing/tcl_commands/test-target-configure-cget-command.cfg
create mode 100644 testing/tcl_commands/test-target-create-command.cfg
create mode 100644 testing/tcl_commands/utils.tcl
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2025-05-09 12:13:02
|
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 f42540cc90b874c7662c59b8e4ebef3f657717ad (commit)
from 8c09cc2c17547dca9783b596d43b735520f2e936 (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 f42540cc90b874c7662c59b8e4ebef3f657717ad
Author: Evgeniy Naydanov <evg...@sy...>
Date: Mon Apr 28 16:55:35 2025 +0300
target: improve error reporting for `-event` option
`target create` calls can get quite long and an indication what is the
option that caused the error can be helpful.
Also, there can be multiple `-event` options for different events,
therefore indicating which one is it is also helpful.
Change-Id: I5ea61437ca9705e790ed8343183883a3fdfebc80
Signed-off-by: Evgeniy Naydanov <evg...@sy...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8861
Reviewed-by: Tomas Vanek <va...@fb...>
Reviewed-by: Antonio Borneo <bor...@gm...>
Tested-by: jenkins
diff --git a/src/target/target.c b/src/target/target.c
index 6d2fc9506..6653c381c 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -4926,7 +4926,8 @@ static COMMAND_HELPER(target_configure, struct target *target, unsigned int inde
case TCFG_EVENT:
if (index == CMD_ARGC) {
- command_print(CMD, "missing event-name");
+ command_print(CMD, "expecting %s event-name event-body",
+ CMD_ARGV[index - 1]);
return ERROR_COMMAND_ARGUMENT_INVALID;
}
@@ -4939,7 +4940,8 @@ static COMMAND_HELPER(target_configure, struct target *target, unsigned int inde
if (is_configure) {
if (index == CMD_ARGC) {
- command_print(CMD, "missing event-body");
+ command_print(CMD, "expecting %s %s event-body",
+ CMD_ARGV[index - 2], CMD_ARGV[index - 1]);
return ERROR_COMMAND_ARGUMENT_INVALID;
}
}
-----------------------------------------------------------------------
Summary of changes:
src/target/target.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2025-05-09 12:12:33
|
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 8c09cc2c17547dca9783b596d43b735520f2e936 (commit)
from d6c54b94941294628c5ebff5f9c776c4a7b2aebb (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 8c09cc2c17547dca9783b596d43b735520f2e936
Author: Evgeniy Naydanov <evg...@sy...>
Date: Mon Apr 28 16:46:08 2025 +0300
target: improve error messaging in `target create`
There are a couple of issues with the usage string for `target create`,
namely:
* `-chain-position` is allowed to be not the first option.
* `-chain-position` should be ommited alltogether on ARM targets when
DAP is specified.
Before the patch:
```
> openocd -c 'target create name testee'
...
target create name type '-chain-position' name [options ...]
```
After the patch:
```
> openocd -c 'target create name testee'
...
-chain-position ?name? required when creating target
> openocd -c 'target create'
...
target create name type [options ...]
```
Change-Id: Ia21a99ce6a4086e2e0676f5ef4685da3514a4f69
Signed-off-by: Evgeniy Naydanov <evg...@sy...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8860
Reviewed-by: Antonio Borneo <bor...@gm...>
Reviewed-by: Tomas Vanek <va...@fb...>
Tested-by: jenkins
diff --git a/src/target/target.c b/src/target/target.c
index a85d3def8..6d2fc9506 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -5706,7 +5706,7 @@ COMMAND_HANDLER(handle_target_create)
int retval = ERROR_OK;
int x;
- if (CMD_ARGC < 4)
+ if (CMD_ARGC < 2)
return ERROR_COMMAND_SYNTAX_ERROR;
/* check if the target name clashes with an existing command name */
@@ -6051,7 +6051,7 @@ static const struct command_registration target_subcommand_handlers[] = {
.name = "create",
.mode = COMMAND_CONFIG,
.handler = handle_target_create,
- .usage = "name type '-chain-position' name [options ...]",
+ .usage = "name type [options ...]",
.help = "Creates and selects a new target",
},
{
-----------------------------------------------------------------------
Summary of changes:
src/target/target.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2025-05-09 12:11:19
|
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 d6c54b94941294628c5ebff5f9c776c4a7b2aebb (commit)
from 618e447278097e41daecf76f6a1e2005f9fc9450 (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 d6c54b94941294628c5ebff5f9c776c4a7b2aebb
Author: Daniel Goehring <dgo...@os...>
Date: Wed Apr 30 22:38:15 2025 -0400
target: cget command fix for result output
Function target_configure() when processing a "cget" command needs
to print the result to the console. Currently the result is only printed
when an error occurs. To fix this, move the command print statement from
the error handling section to the common code section.
The code was tested by executing a "$target_name cget -dap" command
and reviewing the result.
Change-Id: Iff1999de8c8e9a837055ba95714137aa03e68d4b
Signed-off-by: Daniel Goehring <dgo...@os...>
Fixes: 61890e3dc320 ("target: rewrite function target_configure() as COMMAND_HELPER")
Reviewed-on: https://review.openocd.org/c/openocd/+/8870
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/src/target/target.c b/src/target/target.c
index 8ccab7e0a..a85d3def8 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -4889,16 +4889,18 @@ static COMMAND_HELPER(target_configure, struct target *target, unsigned int inde
goi.is_configure = is_configure;
int e = (*target->type->target_jim_configure)(target, &goi);
index = CMD_ARGC - goi.argc;
+
+ int reslen;
+ const char *result = Jim_GetString(Jim_GetResult(CMD_CTX->interp), &reslen);
+ if (reslen > 0)
+ command_print(CMD, "%s", result);
+
if (e == JIM_OK) {
/* more? */
continue;
}
if (e == JIM_ERR) {
/* An error */
- int reslen;
- const char *result = Jim_GetString(Jim_GetResult(CMD_CTX->interp), &reslen);
- if (reslen > 0)
- command_print(CMD, "%s", result);
return ERROR_FAIL;
}
/* otherwise we 'continue' below */
-----------------------------------------------------------------------
Summary of changes:
src/target/target.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2025-05-09 12:10:56
|
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 618e447278097e41daecf76f6a1e2005f9fc9450 (commit)
from 00f5b7ece6f031ece824375007e825ffc113e72b (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 618e447278097e41daecf76f6a1e2005f9fc9450
Author: Antonio Borneo <bor...@gm...>
Date: Thu May 1 18:41:51 2025 +0200
tcl: board: convert transport select dapdirect_swd to swd
Two new boards were added after the commit ad53fe659b46 ("tcl:
convert transport select to jtag and swd")
Align them too.
Change-Id: I53e36a3a1a7730822521f0239922682c7b2fcef6
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8869
Tested-by: jenkins
diff --git a/tcl/board/st/nucleo-u083rc.cfg b/tcl/board/st/nucleo-u083rc.cfg
index 7b878adbc..03e956930 100644
--- a/tcl/board/st/nucleo-u083rc.cfg
+++ b/tcl/board/st/nucleo-u083rc.cfg
@@ -5,7 +5,7 @@
source [find interface/stlink.cfg]
-transport select dapdirect_swd
+transport select swd
source [find target/stm32u0x.cfg]
diff --git a/tcl/board/st_nucleo_c0.cfg b/tcl/board/st_nucleo_c0.cfg
index 7d0767592..845b7b50e 100644
--- a/tcl/board/st_nucleo_c0.cfg
+++ b/tcl/board/st_nucleo_c0.cfg
@@ -2,7 +2,7 @@
source [find interface/stlink.cfg]
-transport select dapdirect_swd
+transport select swd
source [find target/stm32c0x.cfg]
-----------------------------------------------------------------------
Summary of changes:
tcl/board/st/nucleo-u083rc.cfg | 2 +-
tcl/board/st_nucleo_c0.cfg | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2025-05-09 12:10:41
|
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 00f5b7ece6f031ece824375007e825ffc113e72b (commit)
from 06c827757b0c44bef5a15558a71ab666375cbb87 (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 00f5b7ece6f031ece824375007e825ffc113e72b
Author: Antonio Borneo <bor...@gm...>
Date: Thu May 1 19:38:42 2025 +0200
transport: fix incorrect statement
Commit 236208a5ff2d ("transport: use a bitmask for the transport")
has an incorrect C statement in place of a return.
The code is working thanks to the previous condition never true.
The issue has been detected by clang scan-build in OpenOCD ACI
since the missing return can make the following statement
dereferencing a NULL pointer.
Fix it!
Change-Id: I3bbe04d99ad9b1288f55ba3c45e2e487aef9ae40
Signed-off-by: Antonio Borneo <bor...@gm...>
Fixes: 236208a5ff2d ("transport: use a bitmask for the transport")
Reviewed-on: https://review.openocd.org/c/openocd/+/8868
Tested-by: jenkins
diff --git a/src/transport/transport.c b/src/transport/transport.c
index ab5be490f..5323a7ca0 100644
--- a/src/transport/transport.c
+++ b/src/transport/transport.c
@@ -258,7 +258,7 @@ struct transport *get_current_transport(void)
const char *get_current_transport_name(void)
{
if (!session || !is_transport_id_valid(session->id))
- NULL;
+ return NULL;
return transport_full_name(session->id);
}
-----------------------------------------------------------------------
Summary of changes:
src/transport/transport.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2025-05-09 12:09:59
|
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 06c827757b0c44bef5a15558a71ab666375cbb87 (commit)
via d71ed4f3bc58f97ec99f265e55faa1fed7e793ff (commit)
from 3954896d6e41298efd74e8bb7af60ec49efae809 (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 06c827757b0c44bef5a15558a71ab666375cbb87
Author: Antonio Borneo <bor...@gm...>
Date: Sat Apr 19 17:05:16 2025 +0200
target: armv7a: use proper type for struct armv7a_cache_common::outer_cache
The field 'outer_cache' is always initialized and used as a
pointer to 'struct armv7a_l2x_cache'.
There is no reason for using type 'void *' for it.
Change the type of 'outer_cache'.
Drop the useless cast while reading 'outer_cache'.
Change-Id: Iaea9d02e247da26e230f887c85fbf8e9d7be34d5
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8858
Tested-by: jenkins
diff --git a/src/target/armv7a.c b/src/target/armv7a.c
index fb8862611..4d353dec6 100644
--- a/src/target/armv7a.c
+++ b/src/target/armv7a.c
@@ -182,8 +182,7 @@ done:
int armv7a_handle_cache_info_command(struct command_invocation *cmd,
struct armv7a_cache_common *armv7a_cache)
{
- struct armv7a_l2x_cache *l2x_cache = (struct armv7a_l2x_cache *)
- (armv7a_cache->outer_cache);
+ struct armv7a_l2x_cache *l2x_cache = armv7a_cache->outer_cache;
int cl;
diff --git a/src/target/armv7a.h b/src/target/armv7a.h
index 8943f1c69..2706c4629 100644
--- a/src/target/armv7a.h
+++ b/src/target/armv7a.h
@@ -66,7 +66,7 @@ struct armv7a_cache_common {
int i_cache_enabled;
int d_u_cache_enabled;
/* outer unified cache if some */
- void *outer_cache;
+ struct armv7a_l2x_cache *outer_cache;
int (*flush_all_data_cache)(struct target *target);
};
diff --git a/src/target/armv7a_cache_l2x.c b/src/target/armv7a_cache_l2x.c
index 39c503f09..bc60e6d19 100644
--- a/src/target/armv7a_cache_l2x.c
+++ b/src/target/armv7a_cache_l2x.c
@@ -21,8 +21,8 @@
static int arm7a_l2x_sanity_check(struct target *target)
{
struct armv7a_common *armv7a = target_to_armv7a(target);
- struct armv7a_l2x_cache *l2x_cache = (struct armv7a_l2x_cache *)
- (armv7a->armv7a_mmu.armv7a_cache.outer_cache);
+ struct armv7a_l2x_cache *l2x_cache =
+ armv7a->armv7a_mmu.armv7a_cache.outer_cache;
if (target->state != TARGET_HALTED) {
LOG_ERROR("%s: target not halted", __func__);
@@ -42,8 +42,8 @@ static int arm7a_l2x_sanity_check(struct target *target)
int arm7a_l2x_flush_all_data(struct target *target)
{
struct armv7a_common *armv7a = target_to_armv7a(target);
- struct armv7a_l2x_cache *l2x_cache = (struct armv7a_l2x_cache *)
- (armv7a->armv7a_mmu.armv7a_cache.outer_cache);
+ struct armv7a_l2x_cache *l2x_cache =
+ armv7a->armv7a_mmu.armv7a_cache.outer_cache;
uint32_t l2_way_val;
int retval;
@@ -62,8 +62,8 @@ int armv7a_l2x_cache_flush_virt(struct target *target, target_addr_t virt,
uint32_t size)
{
struct armv7a_common *armv7a = target_to_armv7a(target);
- struct armv7a_l2x_cache *l2x_cache = (struct armv7a_l2x_cache *)
- (armv7a->armv7a_mmu.armv7a_cache.outer_cache);
+ struct armv7a_l2x_cache *l2x_cache =
+ armv7a->armv7a_mmu.armv7a_cache.outer_cache;
/* FIXME: different controllers have different linelen? */
uint32_t i, linelen = 32;
int retval;
@@ -97,8 +97,8 @@ static int armv7a_l2x_cache_inval_virt(struct target *target, target_addr_t virt
uint32_t size)
{
struct armv7a_common *armv7a = target_to_armv7a(target);
- struct armv7a_l2x_cache *l2x_cache = (struct armv7a_l2x_cache *)
- (armv7a->armv7a_mmu.armv7a_cache.outer_cache);
+ struct armv7a_l2x_cache *l2x_cache =
+ armv7a->armv7a_mmu.armv7a_cache.outer_cache;
/* FIXME: different controllers have different linelen */
uint32_t i, linelen = 32;
int retval;
@@ -132,8 +132,8 @@ static int armv7a_l2x_cache_clean_virt(struct target *target, target_addr_t virt
unsigned int size)
{
struct armv7a_common *armv7a = target_to_armv7a(target);
- struct armv7a_l2x_cache *l2x_cache = (struct armv7a_l2x_cache *)
- (armv7a->armv7a_mmu.armv7a_cache.outer_cache);
+ struct armv7a_l2x_cache *l2x_cache =
+ armv7a->armv7a_mmu.armv7a_cache.outer_cache;
/* FIXME: different controllers have different linelen */
uint32_t i, linelen = 32;
int retval;
@@ -166,8 +166,7 @@ done:
static int arm7a_handle_l2x_cache_info_command(struct command_invocation *cmd,
struct armv7a_cache_common *armv7a_cache)
{
- struct armv7a_l2x_cache *l2x_cache = (struct armv7a_l2x_cache *)
- (armv7a_cache->outer_cache);
+ struct armv7a_l2x_cache *l2x_cache = armv7a_cache->outer_cache;
if (armv7a_cache->info == -1) {
command_print(cmd, "cache not yet identified");
commit d71ed4f3bc58f97ec99f265e55faa1fed7e793ff
Author: Antonio Borneo <bor...@gm...>
Date: Sat Apr 19 16:28:50 2025 +0200
target: armv7a: drop command 'cache_config l2x'
The command was already tagged as deprecated in 2015 with commit
0df557728216 ("armv7a: remove l1 flush all data handler") but has
never been removed.
An equivalent command 'cache l2x conf' was introduced at the same
time in commit cd440bd32a12 ("add armv7a_cache handlers").
Drop it and deprecate it.
Replace the old command in the Tcl script.
Change-Id: Ie24eccc99a78786903704d10ee1d9f6c924529b5
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8857
Tested-by: jenkins
diff --git a/doc/openocd.texi b/doc/openocd.texi
index e0bdd5ca0..ca357c780 100644
--- a/doc/openocd.texi
+++ b/doc/openocd.texi
@@ -10710,10 +10710,6 @@ Display/set the current core displayed in GDB
Selects whether interrupts will be processed when single stepping
@end deffn
-@deffn {Command} {cache_config l2x} [base way]
-configure l2x cache
-@end deffn
-
@deffn {Command} {cortex_a mmu dump} [@option{0}|@option{1}|@option{addr} address [@option{num_entries}]]
Dump the MMU translation table from TTB0 or TTB1 register, or from physical
memory location @var{address}. When dumping the table from @var{address}, print at most
diff --git a/src/target/armv7a.c b/src/target/armv7a.c
index c14155e01..fb8862611 100644
--- a/src/target/armv7a.c
+++ b/src/target/armv7a.c
@@ -179,54 +179,6 @@ done:
return retval;
}
-/* FIXME: remove it */
-static int armv7a_l2x_cache_init(struct target *target, uint32_t base, uint32_t way)
-{
- struct armv7a_l2x_cache *l2x_cache;
- struct target_list *head;
-
- struct armv7a_common *armv7a = target_to_armv7a(target);
- l2x_cache = calloc(1, sizeof(struct armv7a_l2x_cache));
- l2x_cache->base = base;
- l2x_cache->way = way;
- /*LOG_INFO("cache l2 initialized base %x way %d",
- l2x_cache->base,l2x_cache->way);*/
- if (armv7a->armv7a_mmu.armv7a_cache.outer_cache)
- LOG_INFO("outer cache already initialized\n");
- armv7a->armv7a_mmu.armv7a_cache.outer_cache = l2x_cache;
- /* initialize all target in this cluster (smp target)
- * l2 cache must be configured after smp declaration */
- foreach_smp_target(head, target->smp_targets) {
- struct target *curr = head->target;
- if (curr != target) {
- armv7a = target_to_armv7a(curr);
- if (armv7a->armv7a_mmu.armv7a_cache.outer_cache)
- LOG_ERROR("smp target : outer cache already initialized\n");
- armv7a->armv7a_mmu.armv7a_cache.outer_cache = l2x_cache;
- }
- }
- return JIM_OK;
-}
-
-/* FIXME: remove it */
-COMMAND_HANDLER(handle_cache_l2x)
-{
- struct target *target = get_current_target(CMD_CTX);
- uint32_t base, way;
-
- if (CMD_ARGC != 2)
- return ERROR_COMMAND_SYNTAX_ERROR;
-
- /* command_print(CMD, "%s %s", CMD_ARGV[0], CMD_ARGV[1]); */
- COMMAND_PARSE_NUMBER(u32, CMD_ARGV[0], base);
- COMMAND_PARSE_NUMBER(u32, CMD_ARGV[1], way);
-
- /* AP address is in bits 31:24 of DP_SELECT */
- armv7a_l2x_cache_init(target, base, way);
-
- return ERROR_OK;
-}
-
int armv7a_handle_cache_info_command(struct command_invocation *cmd,
struct armv7a_cache_common *armv7a_cache)
{
@@ -561,33 +513,7 @@ int armv7a_arch_state(struct target *target)
return ERROR_OK;
}
-static const struct command_registration l2_cache_commands[] = {
- {
- .name = "l2x",
- .handler = handle_cache_l2x,
- .mode = COMMAND_EXEC,
- .help = "configure l2x cache",
- .usage = "[base_addr] [number_of_way]",
- },
- COMMAND_REGISTRATION_DONE
-
-};
-
-static const struct command_registration l2x_cache_command_handlers[] = {
- {
- .name = "cache_config",
- .mode = COMMAND_EXEC,
- .help = "cache configuration for a target",
- .usage = "",
- .chain = l2_cache_commands,
- },
- COMMAND_REGISTRATION_DONE
-};
-
const struct command_registration armv7a_command_handlers[] = {
- {
- .chain = l2x_cache_command_handlers,
- },
{
.chain = arm7a_cache_command_handlers,
},
diff --git a/src/target/startup.tcl b/src/target/startup.tcl
index e9646097f..1cc9bb7fd 100644
--- a/src/target/startup.tcl
+++ b/src/target/startup.tcl
@@ -316,3 +316,9 @@ proc _post_init_target_cortex_a_cache_auto {} {
}
}
lappend post_init_commands _post_init_target_cortex_a_cache_auto
+
+lappend _telnet_autocomplete_skip "cache_config l2x"
+proc "cache_config l2x" {args} {
+ echo "DEPRECATED! use 'cache l2x conf' not 'cache_config l2x'"
+ eval cache_config l2x $args
+}
diff --git a/tcl/target/u8500.cfg b/tcl/target/u8500.cfg
index 1fdc11fe3..ea3c7218e 100644
--- a/tcl/target/u8500.cfg
+++ b/tcl/target/u8500.cfg
@@ -133,7 +133,7 @@ proc enable_apetap {} {
set status [$_TARGETNAME_1 curstate]
if {[string equal "unknown" $status]} {
$_TARGETNAME_1 arp_examine
- cache_config l2x 0xa0412000 8
+ cache l2x conf 0xa0412000 8
}
set status [$_TARGETNAME_2 curstate]
-----------------------------------------------------------------------
Summary of changes:
doc/openocd.texi | 4 ---
src/target/armv7a.c | 77 +------------------------------------------
src/target/armv7a.h | 2 +-
src/target/armv7a_cache_l2x.c | 23 +++++++------
src/target/startup.tcl | 6 ++++
tcl/target/u8500.cfg | 2 +-
6 files changed, 20 insertions(+), 94 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2025-05-09 12:09:24
|
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 3954896d6e41298efd74e8bb7af60ec49efae809 (commit)
from 3a879c7dcb718f7e575f5a35beeb42d0f67eaa85 (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 3954896d6e41298efd74e8bb7af60ec49efae809
Author: Chien Wong <m...@xv...>
Date: Tue Apr 8 20:33:56 2025 +0800
rtos/FreeRTOS: fix next pointer member offset in FreeRTOS lists
Currently, we are using offset of xListEnd.pxPrevious in List_t for
list_next_offset and offset of pxPrevious in ListItem_t for
list_elem_next_offset. This is confusing. Fix this.
As the related lists are doubly linked lists, only iteration order is
changed without breaking functionality.
Also document those offsets.
Change-Id: I8beacc235ee781ab4e3b415fccad7b72ec55b098
Signed-off-by: Chien Wong <m...@xv...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8833
Reviewed-by: Antonio Borneo <bor...@gm...>
Tested-by: jenkins
diff --git a/src/rtos/freertos.c b/src/rtos/freertos.c
index bd7b4220e..5a9224ec0 100644
--- a/src/rtos/freertos.c
+++ b/src/rtos/freertos.c
@@ -30,12 +30,12 @@ struct freertos_params {
const char *target_name;
const unsigned char thread_count_width;
const unsigned char pointer_width;
- const unsigned char list_next_offset;
- const unsigned char list_width;
- const unsigned char list_elem_next_offset;
- const unsigned char list_elem_content_offset;
- const unsigned char thread_stack_offset;
- const unsigned char thread_name_offset;
+ const unsigned char list_next_offset; /* offsetof(List_t, xListEnd.pxNext) */
+ const unsigned char list_width; /* sizeof(List_t) */
+ const unsigned char list_elem_next_offset; /* offsetof(ListItem_t, pxNext) */
+ const unsigned char list_elem_content_offset; /* offsetof(ListItem_t, pvOwner) */
+ const unsigned char thread_stack_offset; /* offsetof(TCB_t, pxTopOfStack) */
+ const unsigned char thread_name_offset; /* offsetof(TCB_t, pcTaskName) */
const struct rtos_register_stacking *stacking_info_cm3;
const struct rtos_register_stacking *stacking_info_cm4f;
const struct rtos_register_stacking *stacking_info_cm4f_fpu;
@@ -46,9 +46,9 @@ static const struct freertos_params freertos_params_list[] = {
"cortex_m", /* target_name */
4, /* thread_count_width; */
4, /* pointer_width; */
- 16, /* list_next_offset; */
+ 12, /* list_next_offset; */
20, /* list_width; */
- 8, /* list_elem_next_offset; */
+ 4, /* list_elem_next_offset; */
12, /* list_elem_content_offset */
0, /* thread_stack_offset; */
52, /* thread_name_offset; */
@@ -60,9 +60,9 @@ static const struct freertos_params freertos_params_list[] = {
"hla_target", /* target_name */
4, /* thread_count_width; */
4, /* pointer_width; */
- 16, /* list_next_offset; */
+ 12, /* list_next_offset; */
20, /* list_width; */
- 8, /* list_elem_next_offset; */
+ 4, /* list_elem_next_offset; */
12, /* list_elem_content_offset */
0, /* thread_stack_offset; */
52, /* thread_name_offset; */
-----------------------------------------------------------------------
Summary of changes:
src/rtos/freertos.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2025-05-09 12:08:19
|
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 3a879c7dcb718f7e575f5a35beeb42d0f67eaa85 (commit)
from b3b790e4e01331f79b196f8312193ae0130d2394 (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 3a879c7dcb718f7e575f5a35beeb42d0f67eaa85
Author: Antonio Borneo <bor...@gm...>
Date: Fri Apr 18 17:04:47 2025 +0200
rtos: rework rtos_types[] and rtos_try_next()
Drop the NULL sentinel at the end of the array and use ARRAY_SIZE()
to bound the loops.
Adapt rtos_try_next() to use ARRAY_SIZE().
While there:
- change to bool the return type of rtos_try_next();
- move rtos_try_next() to avoid the forward declaration.
Change-Id: I1bee11db943b670789e62f1bebe2509bbef451a0
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8855
Tested-by: jenkins
diff --git a/src/rtos/rtos.c b/src/rtos/rtos.c
index 5cac316ed..216129b97 100644
--- a/src/rtos/rtos.c
+++ b/src/rtos/rtos.c
@@ -13,6 +13,7 @@
#include "target/target.h"
#include "helper/log.h"
#include "helper/binarybuffer.h"
+#include "helper/types.h"
#include "server/gdb_server.h"
static const struct rtos_type *rtos_types[] = {
@@ -31,11 +32,8 @@ static const struct rtos_type *rtos_types[] = {
&rtkernel_rtos,
/* keep this as last, as it always matches with rtos auto */
&hwthread_rtos,
- NULL
};
-static int rtos_try_next(struct target *target);
-
int rtos_smp_init(struct target *target)
{
if (target->rtos->type->smp_init)
@@ -116,12 +114,12 @@ int rtos_create(struct command_invocation *cmd, struct target *target,
return os_alloc(target, rtos_types[0]);
}
- for (int x = 0; rtos_types[x]; x++)
+ for (size_t x = 0; x < ARRAY_SIZE(rtos_types); x++)
if (strcmp(rtos_name, rtos_types[x]->name) == 0)
return os_alloc_create(target, rtos_types[x]);
char *all = NULL;
- for (int x = 0; rtos_types[x]; x++) {
+ for (size_t x = 0; x < ARRAY_SIZE(rtos_types); x++) {
char *prev = all;
if (all)
all = alloc_printf("%s, %s", all, rtos_types[x]->name);
@@ -155,6 +153,29 @@ int gdb_thread_packet(struct connection *connection, char const *packet, int pac
return target->rtos->gdb_thread_packet(connection, packet, packet_size);
}
+static bool rtos_try_next(struct target *target)
+{
+ struct rtos *os = target->rtos;
+
+ if (!os)
+ return false;
+
+ for (size_t x = 0; x < ARRAY_SIZE(rtos_types) - 1; x++) {
+ if (os->type == rtos_types[x]) {
+ // Use next RTOS in the list
+ os->type = rtos_types[x + 1];
+
+ free(os->symbols);
+ os->symbols = NULL;
+
+ return true;
+ }
+ }
+
+ // No next RTOS to try
+ return false;
+}
+
static struct symbol_table_elem *find_symbol(const struct rtos *os, const char *symbol)
{
struct symbol_table_elem *s;
@@ -667,28 +688,6 @@ int rtos_generic_stack_read(struct target *target,
return ERROR_OK;
}
-static int rtos_try_next(struct target *target)
-{
- struct rtos *os = target->rtos;
- const struct rtos_type **type = rtos_types;
-
- if (!os)
- return 0;
-
- while (*type && os->type != *type)
- type++;
-
- if (!*type || !*(++type))
- return 0;
-
- os->type = *type;
-
- free(os->symbols);
- os->symbols = NULL;
-
- return 1;
-}
-
int rtos_update_threads(struct target *target)
{
if ((target->rtos) && (target->rtos->type))
-----------------------------------------------------------------------
Summary of changes:
src/rtos/rtos.c | 53 ++++++++++++++++++++++++++---------------------------
1 file changed, 26 insertions(+), 27 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2025-05-09 12:07:52
|
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 b3b790e4e01331f79b196f8312193ae0130d2394 (commit)
from afbd01b0a46f3a81fe6076c002ad66973dcfb64c (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 b3b790e4e01331f79b196f8312193ae0130d2394
Author: Antonio Borneo <bor...@gm...>
Date: Sun Dec 3 22:54:51 2023 +0100
rtos: rework rtos_create()
To simplify the caller of rtos_create(), convert the code from
jimtcl oriented to OpenOCD commands.
While there, fix inconsistencies in almost every rtos create()
method and reset rtos_auto_detect to better cooperate on run-time
rtos configuration.
Change-Id: I59c443aaed77a48174facdfc86db75d6b28c8480
Signed-off-by: Antonio Borneo <bor...@gm...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8830
Tested-by: jenkins
diff --git a/src/rtos/chibios.c b/src/rtos/chibios.c
index af590c2cb..0cd99e472 100644
--- a/src/rtos/chibios.c
+++ b/src/rtos/chibios.c
@@ -515,10 +515,10 @@ static int chibios_create(struct target *target)
for (unsigned int i = 0; i < ARRAY_SIZE(chibios_params_list); i++)
if (strcmp(chibios_params_list[i].target_name, target_type_name(target)) == 0) {
target->rtos->rtos_specific_params = (void *)&chibios_params_list[i];
- return 0;
+ return ERROR_OK;
}
LOG_WARNING("Could not find target \"%s\" in ChibiOS compatibility "
"list", target_type_name(target));
- return -1;
+ return ERROR_FAIL;
}
diff --git a/src/rtos/ecos.c b/src/rtos/ecos.c
index 7048b006e..a70084b4f 100644
--- a/src/rtos/ecos.c
+++ b/src/rtos/ecos.c
@@ -1213,12 +1213,12 @@ static int ecos_create(struct target *target)
target->rtos->gdb_thread_packet = ecos_packet_hook;
/* We do not currently use the target->rtos->gdb_target_for_threadid
* hook. */
- return 0;
+ return ERROR_OK;
}
tnames++;
}
}
LOG_ERROR("Could not find target in eCos compatibility list");
- return -1;
+ return ERROR_FAIL;
}
diff --git a/src/rtos/embkernel.c b/src/rtos/embkernel.c
index 7e6de7902..7ad937be5 100644
--- a/src/rtos/embkernel.c
+++ b/src/rtos/embkernel.c
@@ -115,11 +115,11 @@ static int embkernel_create(struct target *target)
if (i >= ARRAY_SIZE(embkernel_params_list)) {
LOG_WARNING("Could not find target \"%s\" in embKernel compatibility "
"list", target_type_name(target));
- return -1;
+ return ERROR_FAIL;
}
target->rtos->rtos_specific_params = (void *) &embkernel_params_list[i];
- return 0;
+ return ERROR_OK;
}
static int embkernel_get_tasks_details(struct rtos *rtos, int64_t iterable, const struct embkernel_params *param,
diff --git a/src/rtos/freertos.c b/src/rtos/freertos.c
index 20977e07e..bd7b4220e 100644
--- a/src/rtos/freertos.c
+++ b/src/rtos/freertos.c
@@ -534,9 +534,9 @@ static int freertos_create(struct target *target)
for (unsigned int i = 0; i < ARRAY_SIZE(freertos_params_list); i++)
if (strcmp(freertos_params_list[i].target_name, target_type_name(target)) == 0) {
target->rtos->rtos_specific_params = (void *)&freertos_params_list[i];
- return 0;
+ return ERROR_OK;
}
LOG_ERROR("Could not find target in FreeRTOS compatibility list");
- return -1;
+ return ERROR_FAIL;
}
diff --git a/src/rtos/hwthread.c b/src/rtos/hwthread.c
index 6332bd8ad..76571c6b6 100644
--- a/src/rtos/hwthread.c
+++ b/src/rtos/hwthread.c
@@ -412,7 +412,7 @@ static int hwthread_create(struct target *target)
target->rtos->thread_details = NULL;
target->rtos->gdb_target_for_threadid = hwthread_target_for_threadid;
target->rtos->gdb_thread_packet = hwthread_thread_packet;
- return 0;
+ return ERROR_OK;
}
static int hwthread_read_buffer(struct rtos *rtos, target_addr_t address,
diff --git a/src/rtos/linux.c b/src/rtos/linux.c
index 5efdc9f60..4ca02605e 100644
--- a/src/rtos/linux.c
+++ b/src/rtos/linux.c
@@ -1424,7 +1424,7 @@ static int linux_os_create(struct target *target)
/* initialize a default virt 2 phys translation */
os_linux->phys_mask = ~0xc0000000;
os_linux->phys_base = 0x0;
- return JIM_OK;
+ return ERROR_OK;
}
static char *linux_ps_command(struct target *target)
diff --git a/src/rtos/mqx.c b/src/rtos/mqx.c
index 017fd2b01..dbb48952f 100644
--- a/src/rtos/mqx.c
+++ b/src/rtos/mqx.c
@@ -251,11 +251,11 @@ static int mqx_create(
if (strcmp(mqx_params_list[i].target_name, target_type_name(target)) == 0) {
target->rtos->rtos_specific_params = (void *)&mqx_params_list[i];
/* LOG_DEBUG("MQX RTOS - valid architecture: %s", target_type_name(target)); */
- return 0;
+ return ERROR_OK;
}
}
LOG_ERROR("MQX RTOS - could not find target \"%s\" in MQX compatibility list", target_type_name(target));
- return -1;
+ return ERROR_FAIL;
}
/*
diff --git a/src/rtos/nuttx.c b/src/rtos/nuttx.c
index 821e55088..27bf086c8 100644
--- a/src/rtos/nuttx.c
+++ b/src/rtos/nuttx.c
@@ -129,13 +129,13 @@ static int nuttx_create(struct target *target)
if (i >= ARRAY_SIZE(nuttx_params_list)) {
LOG_ERROR("Could not find \"%s\" target in NuttX compatibility list", target_type_name(target));
- return JIM_ERR;
+ return ERROR_FAIL;
}
/* We found a target in our list, copy its reference. */
target->rtos->rtos_specific_params = (void *)param;
- return JIM_OK;
+ return ERROR_OK;
}
static int nuttx_smp_init(struct target *target)
diff --git a/src/rtos/rtkernel.c b/src/rtos/rtkernel.c
index aebbf3d94..2be1996fc 100644
--- a/src/rtos/rtkernel.c
+++ b/src/rtos/rtkernel.c
@@ -364,12 +364,12 @@ static int rtkernel_create(struct target *target)
for (size_t i = 0; i < ARRAY_SIZE(rtkernel_params_list); i++) {
if (strcmp(rtkernel_params_list[i].target_name, target_type_name(target)) == 0) {
target->rtos->rtos_specific_params = (void *)&rtkernel_params_list[i];
- return 0;
+ return ERROR_OK;
}
}
LOG_ERROR("Could not find target in rt-kernel compatibility list");
- return -1;
+ return ERROR_FAIL;
}
const struct rtos_type rtkernel_rtos = {
diff --git a/src/rtos/rtos.c b/src/rtos/rtos.c
index 2c563d522..5cac316ed 100644
--- a/src/rtos/rtos.c
+++ b/src/rtos/rtos.c
@@ -57,7 +57,7 @@ static int os_alloc(struct target *target, const struct rtos_type *ostype)
struct rtos *os = target->rtos = calloc(1, sizeof(struct rtos));
if (!os)
- return JIM_ERR;
+ return ERROR_FAIL;
os->type = ostype;
os->current_threadid = -1;
@@ -69,7 +69,7 @@ static int os_alloc(struct target *target, const struct rtos_type *ostype)
os->gdb_thread_packet = rtos_thread_packet;
os->gdb_target_for_threadid = rtos_target_for_threadid;
- return JIM_OK;
+ return ERROR_OK;
}
static void os_free(struct target *target)
@@ -86,38 +86,26 @@ static void os_free(struct target *target)
static int os_alloc_create(struct target *target, const struct rtos_type *ostype)
{
int ret = os_alloc(target, ostype);
+ if (ret != ERROR_OK)
+ return ret;
- if (ret == JIM_OK) {
- ret = target->rtos->type->create(target);
- if (ret != JIM_OK)
- os_free(target);
- }
+ ret = target->rtos->type->create(target);
+ if (ret != ERROR_OK)
+ os_free(target);
return ret;
}
-int rtos_create(struct jim_getopt_info *goi, struct target *target)
+int rtos_create(struct command_invocation *cmd, struct target *target,
+ const char *rtos_name)
{
- int x;
- const char *cp;
- Jim_Obj *res;
- int e;
-
- if (!goi->is_configure && goi->argc != 0) {
- Jim_WrongNumArgs(goi->interp, goi->argc, goi->argv, "NO PARAMS");
- return JIM_ERR;
- }
-
os_free(target);
+ target->rtos_auto_detect = false;
- e = jim_getopt_string(goi, &cp, NULL);
- if (e != JIM_OK)
- return e;
-
- if (strcmp(cp, "none") == 0)
- return JIM_OK;
+ if (strcmp(rtos_name, "none") == 0)
+ return ERROR_OK;
- if (strcmp(cp, "auto") == 0) {
+ if (strcmp(rtos_name, "auto") == 0) {
/* Auto detect tries to look up all symbols for each RTOS,
* and runs the RTOS driver's _detect() function when GDB
* finds all symbols for any RTOS. See rtos_qsymbol(). */
@@ -128,17 +116,29 @@ int rtos_create(struct jim_getopt_info *goi, struct target *target)
return os_alloc(target, rtos_types[0]);
}
- for (x = 0; rtos_types[x]; x++)
- if (strcmp(cp, rtos_types[x]->name) == 0)
+ for (int x = 0; rtos_types[x]; x++)
+ if (strcmp(rtos_name, rtos_types[x]->name) == 0)
return os_alloc_create(target, rtos_types[x]);
- Jim_SetResultFormatted(goi->interp, "Unknown RTOS type %s, try one of: ", cp);
- res = Jim_GetResult(goi->interp);
- for (x = 0; rtos_types[x]; x++)
- Jim_AppendStrings(goi->interp, res, rtos_types[x]->name, ", ", NULL);
- Jim_AppendStrings(goi->interp, res, ", auto or none", NULL);
+ char *all = NULL;
+ for (int x = 0; rtos_types[x]; x++) {
+ char *prev = all;
+ if (all)
+ all = alloc_printf("%s, %s", all, rtos_types[x]->name);
+ else
+ all = alloc_printf("%s", rtos_types[x]->name);
+ free(prev);
+ if (!all) {
+ LOG_ERROR("Out of memory");
+ return ERROR_FAIL;
+ }
+ }
+
+ command_print(cmd, "Unknown RTOS type %s, try one of: %s, auto or none",
+ rtos_name, all);
+ free(all);
- return JIM_ERR;
+ return ERROR_COMMAND_ARGUMENT_INVALID;
}
void rtos_destroy(struct target *target)
diff --git a/src/rtos/rtos.h b/src/rtos/rtos.h
index 5ba8b2694..05beab145 100644
--- a/src/rtos/rtos.h
+++ b/src/rtos/rtos.h
@@ -10,7 +10,6 @@
#include "server/server.h"
#include "target/target.h"
-#include <helper/jim-nvp.h>
typedef int64_t threadid_t;
typedef int64_t symbol_address_t;
@@ -113,7 +112,8 @@ struct rtos_register_stacking {
#define GDB_THREAD_PACKET_NOT_CONSUMED (-40)
-int rtos_create(struct jim_getopt_info *goi, struct target *target);
+int rtos_create(struct command_invocation *cmd, struct target *target,
+ const char *rtos_name);
void rtos_destroy(struct target *target);
int rtos_set_reg(struct connection *connection, int reg_num,
uint8_t *reg_value);
diff --git a/src/rtos/threadx.c b/src/rtos/threadx.c
index 61c49264e..620f43cc8 100644
--- a/src/rtos/threadx.c
+++ b/src/rtos/threadx.c
@@ -611,9 +611,9 @@ static int threadx_create(struct target *target)
target->rtos->rtos_specific_params = (void *)&threadx_params_list[i];
target->rtos->current_thread = 0;
target->rtos->thread_details = NULL;
- return 0;
+ return ERROR_OK;
}
LOG_ERROR("Could not find target in ThreadX compatibility list");
- return -1;
+ return ERROR_FAIL;
}
diff --git a/src/target/target.c b/src/target/target.c
index 40c8d3ed3..8ccab7e0a 100644
--- a/src/target/target.c
+++ b/src/target/target.c
@@ -5176,17 +5176,10 @@ static COMMAND_HELPER(target_configure, struct target *target, unsigned int inde
command_print(CMD, "missing argument to %s", CMD_ARGV[index - 1]);
return ERROR_COMMAND_ARGUMENT_INVALID;
}
- struct jim_getopt_info goi;
- jim_getopt_setup(&goi, CMD_CTX->interp, CMD_ARGC - index, CMD_JIMTCL_ARGV + index);
+ retval = rtos_create(CMD, target, CMD_ARGV[index]);
+ if (retval != ERROR_OK)
+ return retval;
index++;
- goi.is_configure = true;
- int resval = rtos_create(&goi, target);
- int reslen;
- const char *result = Jim_GetString(Jim_GetResult(CMD_CTX->interp), &reslen);
- if (reslen > 0)
- command_print(CMD, "%s", result);
- if (resval != JIM_OK)
- return ERROR_FAIL;
} else {
if (index != CMD_ARGC)
return ERROR_COMMAND_SYNTAX_ERROR;
-----------------------------------------------------------------------
Summary of changes:
src/rtos/chibios.c | 4 ++--
src/rtos/ecos.c | 4 ++--
src/rtos/embkernel.c | 4 ++--
src/rtos/freertos.c | 4 ++--
src/rtos/hwthread.c | 2 +-
src/rtos/linux.c | 2 +-
src/rtos/mqx.c | 4 ++--
src/rtos/nuttx.c | 4 ++--
src/rtos/rtkernel.c | 4 ++--
src/rtos/rtos.c | 66 ++++++++++++++++++++++++++--------------------------
src/rtos/rtos.h | 4 ++--
src/rtos/threadx.c | 4 ++--
src/target/target.c | 13 +++--------
13 files changed, 56 insertions(+), 63 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2025-05-01 15:36:12
|
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 afbd01b0a46f3a81fe6076c002ad66973dcfb64c (commit)
from d567824f2ac267f61944aa839911f0b5bee98c4a (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 afbd01b0a46f3a81fe6076c002ad66973dcfb64c
Author: Samuel Obuch <sam...@es...>
Date: Thu Feb 13 14:28:27 2025 +0100
github/workflow: fix warnings for github actions
- update runner to ubuntu-latest
- pass GITHUB_TOKEN to delete-tag-and-release as input
Change-Id: I83d69cfd7af7c44e67b1115ac843a0b41d6f87b9
Signed-off-by: Samuel Obuch <sam...@es...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8756
Reviewed-by: Antonio Borneo <bor...@gm...>
Tested-by: jenkins
diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml
index 36b2f3bb3..755e8f4e1 100644
--- a/.github/workflows/snapshot.yml
+++ b/.github/workflows/snapshot.yml
@@ -8,7 +8,7 @@ name: OpenOCD Snapshot
jobs:
package:
- runs-on: [ubuntu-20.04]
+ runs-on: [ubuntu-latest]
env:
DL_DIR: ../downloads
BUILD_DIR: ../build
@@ -102,8 +102,8 @@ jobs:
# add missing dlls
cd $HOST-root/usr
cp `$HOST-gcc --print-file-name=libwinpthread-1.dll` ./bin/
- # required by libftdi1.dll. For the gcc-mingw-10.3.x or later "libgcc_s_dw2-1.dll" will need to be copied.
- cp `$HOST-gcc --print-file-name=libgcc_s_sjlj-1.dll` ./bin/
+ # required by libftdi1.dll
+ cp `$HOST-gcc --print-file-name=libgcc_s_dw2-1.dll` ./bin/
# prepare the artifact
ARTIFACT="openocd-${OPENOCD_TAG}-${HOST}.tar.gz"
tar -czf $ARTIFACT *
@@ -119,8 +119,7 @@ jobs:
with:
delete_release: true
tag_name: ${{ env.RELEASE_NAME }}
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: ncipollo/release-action@v1
with:
-----------------------------------------------------------------------
Summary of changes:
.github/workflows/snapshot.yml | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2025-05-01 15:35:39
|
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 d567824f2ac267f61944aa839911f0b5bee98c4a (commit)
from efafdd3c552e004525b4515c70ac03765e9b6fd6 (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 d567824f2ac267f61944aa839911f0b5bee98c4a
Author: Marc Schink <de...@za...>
Date: Sat Aug 17 12:35:30 2024 +0200
doc/manual: Add guideline for configuration files
The goal of this guideline is to have consistent and well-structured
configurations files. The focus of this patch is on filenames and
directory structure. A guideline for the content of the files should be
included in a subsequent patch.
This patch addresses a long outstanding task listed in 'Pending and Open
Tasks'.
Change-Id: Ib32dd8b9ed15c3f647cd8d74cfc79edf0e79a3df
Signed-off-by: Marc Schink <de...@za...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8854
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/doc/manual/config_files.txt b/doc/manual/config_files.txt
new file mode 100644
index 000000000..db1cc1419
--- /dev/null
+++ b/doc/manual/config_files.txt
@@ -0,0 +1,117 @@
+/** @page config_files Configuration Files
+
+This page gives an overview of the different configuration files, what purpose they serve and how they are structured.
+The goal of this guide is to ensure well-structured and consistent configuration files.
+
+All configuration files are stored in the @c tcl directory of the project directory.
+These files must follow the @ref styletcl and @ref naming_convention.
+There are different types of configuration files:
+
+- @ref interface_configs
+- @ref target_configs
+- @ref board_configs
+
+@note This guideline must be followed for new configuration files.
+There may be configuration files that do not comply with this guide for legacy reasons.
+
+
+@section interface_configs Interface
+
+This configuration file represents a debug (interface) adapter.
+This is usually a USB device that provides an interface to one or more transports such as JTAG or SWD.
+Other interfaces like ethernet or parallel port are also represented.
+
+A debug adapter configuration file must use the following scheme:
+
+@verbatim
+tcl/interface/[vendor]/<adapter name>.cfg
+@endverbatim
+
+The `vendor` directory for debug adapters is often omitted because multiple adapters from the same vendor can be represented by a common configuration file.
+One counter example are FTDI-based debug adapters.
+There are various devices, either standalone or development boards which use FTDI chips but use different chip models or settings.
+Their corresponding configuration files are stored in the `ftdi` folder.
+
+The name of the `vendor` folder can also be a more generic term such as `parport` as it is used for parallel port based debug adapters.
+
+If it is foreseeable that new configuration files will be added in the future, create a `vendor` directory even if there is only a single file at the moment.
+This prevents that files have to be moved in the future.
+
+@section target_configs Target
+
+This configuration file represents an actual chip.
+For example, a microcontroller, FPGA, CPLD, or system on chip (SoC).
+A target configuration file always represents an entire device series or family.
+
+A target configuration file must use the following scheme:
+
+@verbatim
+tcl/target/<vendor>/<target name>.cfg
+@endverbatim
+
+Use the device series or family as `target name`.
+For example, the configuration file for the nRF54L series from Nordic Semiconductor is located here:
+
+@verbatim
+tcl/target/nordic/nrf54l.cfg
+@endverbatim
+
+If there are many similarities between different targets, use a common file to share large pieces of code.
+Do not use a single file to represent multiple device series or families.
+
+@section board_configs Board
+
+This configuration file represents a circuit board, for example, a development board.
+A board may also contain an on-board debug adapter.
+
+A board configuration file includes existing target and, if available, interface configuration files, since a target is used on many boards.
+
+Reuse existing target and interface configuration files whenever possible.
+If a board needs an external debug adapter, do @b not write adapter specific configuration files.
+
+
+A board configuration file must use the following scheme:
+
+@verbatim
+tcl/board/<vendor>/<board name>[-suffix].cfg
+@endverbatim
+
+For example, the board configuration file for the NUCLEO-U083RC from STMicroelectronics is located here:
+
+@verbatim
+tcl/board/st/nucleo-u083rc.cfg
+@endverbatim
+
+In case a board supports different features, a `suffix` can be used to indicate this.
+Make sure that the suffix is short and meaningful.
+
+For example, the on-board debug adapter of the FRDM-KV11Z development board can be flashed with a SEGGER J-Link compatible firmware.
+Hence, there is the following configuration file:
+
+@verbatim
+tcl/board/nxp/frdm-kv11z-jlink.cfg
+@endverbatim
+
+The use of a suffix should be chosen carefully.
+In many cases it is sufficient to make a certain feature accessible via a variable.
+
+Use a single configuration file for each board.
+If there are many similarities between different boards, use a common file to share large pieces of code.
+
+
+@section naming_convention Naming Convention
+
+
+The following naming conventions for configuration files and directories must be used:
+
+- Use only lower-case letters and digits for directory and filenames
+- Use hyphen characters between consecutive words in identifiers (e.g. `more-than-one-word`)
+
+- Use a common abbreviation for the vendor name, such as
+ - @c ti for Texas Instruments
+ - @c st for STMicroelectronics
+ - @c silabs for Silicon Labs
+
+An extensive list of abbreviations for vendor names can be found [here](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/vendor-prefixes.yaml).
+
+ */
diff --git a/doc/manual/main.txt b/doc/manual/main.txt
index c28fbe228..9da546b6d 100644
--- a/doc/manual/main.txt
+++ b/doc/manual/main.txt
@@ -21,6 +21,8 @@ check the mailing list archives to find the status of your feature (or bug).
- The @subpage releases page describes the project's release process.
- The @subpage endianness provides hints about writing and testing
endianness independent code for OpenOCD.
+- The @subpage config_files page provides a guide for writing configuration files
+ for OpenOCD.
@ref primer provide introductory materials for new developers on various
specific topics.
-----------------------------------------------------------------------
Summary of changes:
doc/manual/config_files.txt | 117 ++++++++++++++++++++++++++++++++++++++++++++
doc/manual/main.txt | 2 +
2 files changed, 119 insertions(+)
create mode 100644 doc/manual/config_files.txt
hooks/post-receive
--
Main OpenOCD repository
|
|
From: openocd-gerrit <ope...@us...> - 2025-05-01 15:34:45
|
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 efafdd3c552e004525b4515c70ac03765e9b6fd6 (commit)
via 98c95df228dd47ea736cea79a63f3302704cc669 (commit)
from 639b7432b81b8851155ab0d539c74ac183bb9bfa (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 efafdd3c552e004525b4515c70ac03765e9b6fd6
Author: Marc Schink <de...@za...>
Date: Mon Apr 14 09:11:36 2025 +0200
doc/manual: Fix Tcl spelling
Use 'Tcl' because it is the official spelling.
While at it, fix some misspellings of 'Jim Tcl'.
Change-Id: I2d96f63b0dbc96ae62fe00ae41d2eb16897250fb
Signed-off-by: Marc Schink <de...@za...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8853
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/README b/README
index d9cc8f3eb..875c85de3 100644
--- a/README
+++ b/README
@@ -8,10 +8,10 @@ layered architecture of JTAG interface and TAP support including:
- debug target support (e.g. ARM, MIPS): single-stepping,
breakpoints/watchpoints, gprof profiling, etc;
- flash chip drivers (e.g. CFI, NAND, internal flash);
-- embedded TCL interpreter for easy scripting.
+- embedded Tcl interpreter for easy scripting.
Several network interfaces are available for interacting with OpenOCD:
-telnet, TCL, and GDB. The GDB server enables OpenOCD to function as a
+telnet, Tcl, and GDB. The GDB server enables OpenOCD to function as a
"remote target" for source-level debugging of embedded systems using
the GNU GDB program (and the others who talk GDB protocol, e.g. IDA
Pro).
diff --git a/TODO b/TODO
index 239b358f5..803692d58 100644
--- a/TODO
+++ b/TODO
@@ -12,14 +12,14 @@ may have evolved an idea since it was added here.
Feel free to send patches to add or clarify items on this list, too.
-@section thelisttcl TCL
+@section thelisttcl Tcl
-This section provides possible things to improve with OpenOCD's TCL support.
+This section provides possible things to improve with OpenOCD's Tcl support.
- Fix problem with incorrect line numbers reported for a syntax
error in a reset init event.
-- organize the TCL configurations:
+- organize the Tcl configurations:
- provide more directory structure for boards/targets?
- factor configurations into layers (encapsulation and re-use)
@@ -27,15 +27,15 @@ This section provides possible things to improve with OpenOCD's TCL support.
parameters. Currently variables assigned through one such parameter
command/script are unset before the next one is invoked.
-- Isolate all TCL command support:
+- Isolate all Tcl command support:
- Pure C CLI implementations using --disable-builtin-tcl.
- Allow developers to build new dongles using OpenOCD's JTAG core.
- At first, provide only low-level JTAG support; target layer and
above rely heavily on scripting event mechanisms.
- - Allow full TCL support? add --with-tcl=/path/to/installed/tcl
- - Move TCL support out of foo.[ch] and into foo_tcl.[ch] (other ideas?)
+ - Allow full Tcl support? add --with-tcl=/path/to/installed/tcl
+ - Move Tcl support out of foo.[ch] and into foo_tcl.[ch] (other ideas?)
- See src/jtag/core.c and src/jtag/tcl.c for an example.
- - allow some of these TCL command modules to be dynamically loadable?
+ - allow some of these Tcl command modules to be dynamically loadable?
@section thelistadapter Adapter
@@ -75,7 +75,7 @@ directly in minidriver API for better embedded host performance.
The following tasks have been suggested for adding new core JTAG support:
-- Improve autodetection of TAPs by supporting tcl escape procedures that
+- Improve autodetection of TAPs by supporting Tcl escape procedures that
can configure discovered TAPs based on IDCODE value ... they could:
- Remove guessing for irlen
- Allow non-default irmask/ircapture values
@@ -133,7 +133,7 @@ TCP/IP packets handled by the server.
- add BSDL support?
A few possible options for the above:
- -# Fake a TCL equivalent?
+ -# Fake a Tcl equivalent?
-# Integrate an existing library?
-# Write a new C implementation a la Jim?
diff --git a/doc/manual/helper.txt b/doc/manual/helper.txt
index b59fd664f..6cf3c977b 100644
--- a/doc/manual/helper.txt
+++ b/doc/manual/helper.txt
@@ -21,7 +21,7 @@ portability API.
/** @page helperjim OpenOCD Jim API
-The Jim API provides access to a small-footprint TCL implementation.
+The Jim API provides access to a small-footprint Tcl implementation.
Visit http://jim.tcl.tk/ for more information on Jim.
diff --git a/doc/manual/jtag.txt b/doc/manual/jtag.txt
index 2653fc78f..5eb945013 100644
--- a/doc/manual/jtag.txt
+++ b/doc/manual/jtag.txt
@@ -15,7 +15,7 @@ asynchronous transactions.
- used by other modules
- @subpage jtagtcl
- - @b private TCL handling routines
+ - @b private Tcl handling routines
- defined in @c src/jtag/tcl.c
- registers and handles Jim commands that configure and use the JTAG core
@@ -47,7 +47,7 @@ This section needs to be expanded.
*/
-/** @page jtagtcl JTAG TCL API
+/** @page jtagtcl JTAG Tcl API
This section needs to be expanded.
diff --git a/doc/manual/primer/docs.txt b/doc/manual/primer/docs.txt
index b1c053137..1aefa17e6 100644
--- a/doc/manual/primer/docs.txt
+++ b/doc/manual/primer/docs.txt
@@ -6,7 +6,7 @@ OpenOCD presently produces several kinds of documentation:
- The User's Guide:
- Focuses on using the OpenOCD software.
- Details the installation, usage, and customization.
- - Provides descriptions of public Jim/TCL script commands.
+ - Provides descriptions of public Jim Tcl script commands.
- Written using GNU texinfo.
- Created with 'make pdf' or 'make html'.
- See @subpage primertexinfo and @ref styletexinfo.
diff --git a/doc/manual/primer/tcl.txt b/doc/manual/primer/tcl.txt
index eba2f552d..6874f5566 100644
--- a/doc/manual/primer/tcl.txt
+++ b/doc/manual/primer/tcl.txt
@@ -1,6 +1,6 @@
-/** @page primertcl OpenOCD TCL Primer
+/** @page primertcl OpenOCD Tcl Primer
-The @subpage scripting page provides additional TCL Primer material.
+The @subpage scripting page provides additional Tcl Primer material.
@verbatim
@@ -8,15 +8,15 @@ The @subpage scripting page provides additional TCL Primer material.
****************************************
This is a short introduction to 'un-scare' you about the language
-known as TCL. It is structured as a guided tour through the files
+known as Tcl. It is structured as a guided tour through the files
written by me [Duane Ellis] - in early July 2008 for OpenOCD.
Which uses the "JIM" embedded Tcl clone-ish language.
-Thing described here are *totally* TCL generic... not Jim specific.
+Thing described here are *totally* Tcl generic... not Jim specific.
The goal of this document is to encourage you to add your own set of
-chips to the TCL package - and most importantly you should know where
+chips to the Tcl package - and most importantly you should know where
you should put them - so they end up in an organized way.
--Duane Ellis.
@@ -57,14 +57,14 @@ Definition:
Open: at91sam7x256.tcl
=== TCL TOUR ===
-A walk through --- For those who are new to TCL.
+A walk through --- For those who are new to Tcl.
Examine the file: at91sam7x256.tcl
It starts with:
source [find path/filename.tcl]
-In TCL - this is very important.
+In Tcl - this is very important.
Rule #1 Everything is a string.
Rule #2 If you think other wise See #1.
@@ -130,7 +130,7 @@ First, there is a "for" loop - at level 0
This means it is evaluated when the file is parsed.
== SIDEBAR: About The FOR command ==
-In TCL, "FOR" is a funny thing, it is not what you think it is.
+In Tcl, "FOR" is a funny thing, it is not what you think it is.
Syntactically - FOR is a just a command, it is not language
construct like for(;;) in C...
@@ -191,7 +191,7 @@ proc create_mask { MSB LSB } {
Like "for" - PROC is really just a command that takes 3 parameters.
The (1) NAME of the function, a (2) LIST of parameters, and a (3) BODY
-Again, this is at "level 0" so it is a global function. (Yes, TCL
+Again, this is at "level 0" so it is a global function. (Yes, Tcl
supports local functions, you put them inside of a function}
You'll see in some cases, I nest [brackets] a lot and in others I'm
@@ -257,7 +257,7 @@ For example - 'show_mmr32_reg' is given the NAME of the register to
display. The assumption is - the NAME is a global variable holding the
address of that MMR.
-The code does some tricks. The [set [set NAME]] is the TCL way
+The code does some tricks. The [set [set NAME]] is the Tcl way
of doing double variable interpolation - like makefiles...
In a makefile or shell script you may have seen this:
@@ -272,7 +272,7 @@ In a makefile or shell script you may have seen this:
#BUILD = mac
FOO = ${FOO_${BUILD}}
-The "double [set] square bracket" thing is the TCL way, nothing more.
+The "double [set] square bracket" thing is the Tcl way, nothing more.
----
@@ -352,7 +352,7 @@ tricks with interpretors.
Function: show_mmr32_bits()
-In this case, we use the special TCL command "upvar" which tcl's way
+In this case, we use the special Tcl command "upvar" which is the Tcl way
of passing things by reference. In this case, we want to reach up into
the callers lexical scope and find the array named "NAMES"
@@ -373,7 +373,7 @@ are basically identical...
Second - there can be many of them.
-In this case - I do some more TCL tricks to dynamically
+In this case - I do some more Tcl tricks to dynamically
create functions out of thin air.
Some assumptions:
@@ -409,7 +409,7 @@ And - declare that variable as GLOBAL so the world can find it.
Then - we dynamically create a function - based on the register name.
Look carefully at how that is done. You'll notice the FUNCTION BODY is
-a string - not something in {braces}. Why? This is because we need TCL
+a string - not something in {braces}. Why? This is because we need Tcl
to evaluate the contents of that string "*NOW*" - when $vn exists not
later, when the function "show_FOO" is invoked.
diff --git a/doc/manual/scripting.txt b/doc/manual/scripting.txt
index f8764e2d7..48ba99bda 100644
--- a/doc/manual/scripting.txt
+++ b/doc/manual/scripting.txt
@@ -4,11 +4,11 @@
The scripting support is intended for developers of OpenOCD.
It is not the intention that normal OpenOCD users will
-use tcl scripting extensively, write lots of clever scripts,
+use Tcl scripting extensively, write lots of clever scripts,
or contribute back to OpenOCD.
Target scripts can contain new procedures that end users may
-tinker to their needs without really understanding tcl.
+tinker to their needs without really understanding Tcl.
Since end users are not expected to mess with the scripting
language, the choice of language is not terribly important
@@ -38,16 +38,16 @@ Default implementation of procedures in tcl/procedures.tcl.
and will have no externally visible consequences.
Tcl has an advantage in that it's syntax is backwards
compatible with the current OpenOCD syntax.
-- external scripting. Low level tcl functions will be defined
- that return machine readable output. These low level tcl
- functions constitute the tcl api. flash_banks is such
- a low level tcl proc. "flash banks" is an example of
+- external scripting. Low level Tcl functions will be defined
+ that return machine readable output. These low level Tcl
+ functions constitute the Tcl api. flash_banks is such
+ a low level Tcl proc. "flash banks" is an example of
a command that has human readable output. The human
readable output is expected to change in between versions
of OpenOCD. The output from flash_banks may not be
in the preferred form for the client. The client then
has two choices a) parse the output from flash_banks
- or b) write a small piece of tcl to output the
+ or b) write a small piece of Tcl to output the
flash_banks output to a more suitable form. The latter may
be simpler.
diff --git a/doc/manual/server.txt b/doc/manual/server.txt
index 8041c3df3..20e48c1f4 100644
--- a/doc/manual/server.txt
+++ b/doc/manual/server.txt
@@ -43,7 +43,7 @@ with a script language:
What follows hopefully shows how the plans to solve these problems
materialized and help to explain the grand roadmap plan.
-@subsection serverdocsjim Why JimTCL? The Internal Script Language
+@subsection serverdocsjim Why Jim Tcl? The Internal Script Language
At the time, the existing "command context schema" was proving itself
insufficient. However, the problem was also considered from another
@@ -57,14 +57,14 @@ OpenOCD. Yuck. OpenOCD already has a complex enough build system, why
make it worse?
The goal was to add a simple language that would be moderately easy to
-work with and be self-contained. JimTCL is a single C and single H
+work with and be self-contained. Jim Tcl is a single C and single H
file, allowing OpenOCD to avoid the spider web of dependent packages.
-@section serverdocstcl TCL Server Port
+@section serverdocstcl Tcl Server Port
-The TCL Server port was added in mid-2008. With embedded TCL, we can
+The Tcl Server port was added in mid-2008. With embedded Tcl, we can
write scripts internally to help things, or we can write "C" code that
-interfaces well with TCL.
+interfaces well with Tcl.
From there, the developers wanted to create an external front-end that
would be @a very usable and that @a any language could utilize,
@@ -78,7 +78,7 @@ also support a high degree of interoperability with multiple systems.
They are not human-centric protocols; more correctly, they are rigid,
terse, simple ASCII protocols that are easily parsable by a script.
-Thus, the TCL server -- a 'machine' type socket interface -- was added
+Thus, the Tcl server -- a 'machine' type socket interface -- was added
with the hope was it would output simple "name-value" pair type
data. At the time, simple name/value pairs seemed reasonably easier to
do at the time, though Maybe it should output JSON;
@@ -107,7 +107,7 @@ What works easier and is less work is what is already present in every
platform? The answer: A web browser. In other words, OpenOCD could
serve out embedded web pages via "localhost" to your browser.
-Long before OpenOCD had a TCL command line, Zylin AS built their ZY1000
+Long before OpenOCD had a Tcl command line, Zylin AS built their ZY1000
device with a built-in HTTP server. Later, they were willing to both
contribute and integrate most of that work into the main tree.
@@ -128,8 +128,8 @@ every language has it's own set of wack-ness, parameter marshaling is
painful.
What about "callbacks" and structures, and other mess. Imagine
-debugging that system. When JimTCL was introduced Spencer Oliver had
-quite a few well-put concerns (Summer 2008) about the idea of "TCL"
+debugging that system. When Jim Tcl was introduced Spencer Oliver had
+quite a few well-put concerns (Summer 2008) about the idea of "Tcl"
taking over OpenOCD. His concern is and was: how do you debug
something written in 2 different languages? A "SWIG" front-end is
unlikely to help that situation.
@@ -143,7 +143,7 @@ to Localhost or remote host, however one might want to make it work.
A socket interface is very simple. One could write a Java application
and serve it out via the embedded web server, could it - or something
-like it talk to the built in TCL server? Yes, absolutely! We are on to
+like it talk to the built in Tcl server? Yes, absolutely! We are on to
something here.
@subsection serverdocplatforms Platform Permutations
@@ -167,9 +167,9 @@ the Socket Approach is used.
@subsection serverdocfuture Development Scale Out
-During 2008, Duane Ellis created some TCL scripts to display peripheral
-register contents. For example, look at the sam7 TCL scripts, and the
-stm32 TCL scripts. The hope was others would create more.
+During 2008, Duane Ellis created some Tcl scripts to display peripheral
+register contents. For example, look at the sam7 Tcl scripts, and the
+stm32 Tcl scripts. The hope was others would create more.
A good example of this is display/view the peripheral registers on
@@ -208,7 +208,7 @@ upon it, sometimes that is the only scheme available.
As a small group of developers, supporting all the platforms and
targets in the debugger will be difficult, as there are enough problem
with the plethora of Adapters, Chips, and different target boards.
-Yes, the TCL interface might be suitable, but it has not received much
+Yes, the Tcl interface might be suitable, but it has not received much
love or attention. Perhaps it will after you read and understand this.
One reason might be, this adds one more host side requirement to make
@@ -247,8 +247,8 @@ Altogether, it provides a universally accessible GUI for OpenOCD.
@section serverdocshtml Simple HTML Pages
-There is (or could be) a simple "Jim TCL" function to read a memory
-location. If that can be tied into a TCL script that can modify the
+There is (or could be) a simple "Jim Tcl" function to read a memory
+location. If that can be tied into a Tcl script that can modify the
HTTP text, then we have a simple script-based web server with a JTAG
engine under the hood.
@@ -275,7 +275,7 @@ bit-banging JTAG Adapter serving web pages.
@subsection serverdocshtmladv Advanced HTML Pages
-Java or JavaScript could be used to talk back to the TCL port. One
+Java or JavaScript could be used to talk back to the Tcl port. One
could write a Java, AJAX, FLASH, or some other developer friendly
toolbox and get a real cross-platform GUI interface. Sure, the interface
is not native - but it is 100% cross-platform!
diff --git a/doc/manual/style.txt b/doc/manual/style.txt
index dc27e8767..f7a12988f 100644
--- a/doc/manual/style.txt
+++ b/doc/manual/style.txt
@@ -27,12 +27,12 @@ providing documentation, either as part of the C code or stand-alone.
Feedback would be welcome to improve the OpenOCD guidelines.
*/
-/** @page styletcl TCL Style Guide
+/** @page styletcl Tcl Style Guide
-OpenOCD needs to expand its Jim/TCL Style Guide.
+OpenOCD needs to expand its Jim Tcl Style Guide.
Many of the guidelines listed on the @ref stylec page should apply to
-OpenOCD's Jim/TCL code as well.
+OpenOCD's Jim Tcl code as well.
*/
/** @page stylec C Style Guide
commit 98c95df228dd47ea736cea79a63f3302704cc669
Author: Marc Schink <de...@za...>
Date: Mon Apr 14 09:09:49 2025 +0200
doc/openocd: Fix Tcl spelling
Use 'Tcl' because it is the official spelling.
While at it, fix some misspellings of 'Jim Tcl'.
Change-Id: I084541a1cc0276d15a263b843ba740da04efc30a
Signed-off-by: Marc Schink <de...@za...>
Reviewed-on: https://review.openocd.org/c/openocd/+/8852
Tested-by: jenkins
Reviewed-by: Antonio Borneo <bor...@gm...>
diff --git a/doc/openocd.texi b/doc/openocd.texi
index cbe5e86da..e0bdd5ca0 100644
--- a/doc/openocd.texi
+++ b/doc/openocd.texi
@@ -62,7 +62,7 @@ Documentation License''.
* About:: About OpenOCD
* Developers:: OpenOCD Developer Resources
* Debug Adapter Hardware:: Debug Adapter Hardware
-* About Jim-Tcl:: About Jim-Tcl
+* About Jim Tcl:: About Jim Tcl
* Running:: Running OpenOCD
* OpenOCD Project Setup:: OpenOCD Project Setup
* Config File Guidelines:: Config File Guidelines
@@ -629,43 +629,43 @@ This is deprecated from Linux v5.3; prefer using @b{linuxgpiod}.
@end itemize
-@node About Jim-Tcl
-@chapter About Jim-Tcl
-@cindex Jim-Tcl
+@node About Jim Tcl
+@chapter About Jim Tcl
+@cindex Jim Tcl
@cindex tcl
-OpenOCD uses a small ``Tcl Interpreter'' known as Jim-Tcl.
+OpenOCD uses a small ``Tcl Interpreter'' known as Jim Tcl.
This programming language provides a simple and extensible
command interpreter.
-All commands presented in this Guide are extensions to Jim-Tcl.
+All commands presented in this Guide are extensions to Jim Tcl.
You can use them as simple commands, without needing to learn
much of anything about Tcl.
Alternatively, you can write Tcl programs with them.
You can learn more about Jim at its website, @url{http://jim.tcl.tk}.
There is an active and responsive community, get on the mailing list
-if you have any questions. Jim-Tcl maintainers also lurk on the
+if you have any questions. Jim Tcl maintainers also lurk on the
OpenOCD mailing list.
@itemize @bullet
@item @b{Jim vs. Tcl}
-@* Jim-Tcl is a stripped down version of the well known Tcl language,
-which can be found here: @url{http://www.tcl.tk}. Jim-Tcl has far
-fewer features. Jim-Tcl is several dozens of .C files and .H files and
+@* Jim Tcl is a stripped down version of the well known Tcl language,
+which can be found here: @url{http://www.tcl.tk}. Jim Tcl has far
+fewer features. Jim Tcl is several dozens of .C files and .H files and
implements the basic Tcl command set. In contrast: Tcl 8.6 is a
4.2 MB .zip file containing 1540 files.
@item @b{Missing Features}
@* Our practice has been: Add/clone the real Tcl feature if/when
-needed. We welcome Jim-Tcl improvements, not bloat. Also there
-are a large number of optional Jim-Tcl features that are not
+needed. We welcome Jim Tcl improvements, not bloat. Also there
+are a large number of optional Jim Tcl features that are not
enabled in OpenOCD.
@item @b{Scripts}
-@* OpenOCD configuration scripts are Jim-Tcl Scripts. OpenOCD's
+@* OpenOCD configuration scripts are Jim Tcl Scripts. OpenOCD's
command interpreter today is a mixture of (newer)
-Jim-Tcl commands, and the (older) original command interpreter.
+Jim Tcl commands, and the (older) original command interpreter.
@item @b{Commands}
@* At the OpenOCD telnet command line (or via the GDB monitor command) one
@@ -674,10 +674,10 @@ Some of the commands documented in this guide are implemented
as Tcl scripts, from a @file{startup.tcl} file internal to the server.
@item @b{Historical Note}
-@* Jim-Tcl was introduced to OpenOCD in spring 2008. Fall 2010,
-before OpenOCD 0.5 release, OpenOCD switched to using Jim-Tcl
-as a Git submodule, which greatly simplified upgrading Jim-Tcl
-to benefit from new features and bugfixes in Jim-Tcl.
+@* Jim Tcl was introduced to OpenOCD in spring 2008. Fall 2010,
+before OpenOCD 0.5 release, OpenOCD switched to using Jim Tcl
+as a Git submodule, which greatly simplified upgrading Jim Tcl
+to benefit from new features and bugfixes in Jim Tcl.
@item @b{Need a crash course in Tcl?}
@*@xref{Tcl Crash Course}.
@@ -796,7 +796,7 @@ those channels.
If you are having problems, you can enable internal debug messages via
the @option{-d} option.
-Also it is possible to interleave Jim-Tcl commands w/config scripts using the
+Also it is possible to interleave Jim Tcl commands w/config scripts using the
@option{-c} command line switch.
To enable debug output (when reporting problems or working on OpenOCD
@@ -962,7 +962,7 @@ that can be tested in a later script.
@end quotation
Here we will focus on the simpler solution: one user config
-file, including basic configuration plus any TCL procedures
+file, including basic configuration plus any Tcl procedures
to simplify your work.
@section User Config Files
@@ -1432,7 +1432,7 @@ In addition to target-specific utility code, another way that
board and target config files communicate is by following a
convention on how to use certain variables.
-The full Tcl/Tk language supports ``namespaces'', but Jim-Tcl does not.
+The full Tcl/Tk language supports ``namespaces'', but Jim Tcl does not.
Thus the rule we follow in OpenOCD is this: Variables that begin with
a leading underscore are temporary in nature, and can be modified and
used at will within a target configuration file.
@@ -1552,7 +1552,7 @@ configuration files for other JTAG tools
Some of this code could probably be shared between different boards.
For example, setting up a DRAM controller often doesn't differ by
much except the bus width (16 bits or 32?) and memory timings, so a
-reusable TCL procedure loaded by the @file{target.cfg} file might take
+reusable Tcl procedure loaded by the @file{target.cfg} file might take
those as parameters.
Similarly with oscillator, PLL, and clock setup;
and disabling the watchdog.
@@ -2137,7 +2137,7 @@ corresponding subsystems:
@end deffn
At last, @command{init} executes all the commands that are specified in
-the TCL list @var{post_init_commands}. The commands are executed in the
+the Tcl list @var{post_init_commands}. The commands are executed in the
same order they occupy in the list. If one of the commands fails, then
the error is propagated and OpenOCD fails too.
@example
@@ -2222,7 +2222,7 @@ cause initialization to fail with "Unknown remote qXfer reply: OK".
@deffn {Config Command} {tcl port} [number]
Specify or query the port used for a simplified RPC
-connection that can be used by clients to issue TCL commands and get the
+connection that can be used by clients to issue Tcl commands and get the
output from the Tcl engine.
Intended as a machine interface.
When not specified during the configuration stage,
@@ -2233,7 +2233,7 @@ When specified as "disabled", this service is not activated.
@deffn {Config Command} {telnet port} [number]
Specify or query the
port on which to listen for incoming telnet connections.
-This port is intended for interaction with one human through TCL commands.
+This port is intended for interaction with one human through Tcl commands.
When not specified during the configuration stage,
the port @var{number} defaults to 4444.
When specified as "disabled", this service is not activated.
@@ -2304,7 +2304,7 @@ The file name is @i{target_name}.xml.
Hardware debuggers are parts of asynchronous systems,
where significant events can happen at any time.
The OpenOCD server needs to detect some of these events,
-so it can report them to through TCL command line
+so it can report them to through Tcl command line
or to GDB.
Examples of such events include:
@@ -2345,7 +2345,7 @@ specific information about the current state is printed.
An optional parameter
allows background polling to be enabled and disabled.
-You could use this from the TCL command shell, or
+You could use this from the Tcl command shell, or
from GDB using @command{monitor poll} command.
Leave background polling enabled while you're using GDB.
@example
@@ -4527,7 +4527,7 @@ mechanism for debugger targets.)
See the next section for information about the available events.
The @code{configure} subcommand assigns an event handler,
-a TCL string which is evaluated when the event is triggered.
+a Tcl string which is evaluated when the event is triggered.
The @code{cget} subcommand returns that handler.
@end deffn
@@ -4786,7 +4786,7 @@ The instance number is in bits 28..31 of DLPIDR value.
@deffn {Command} {dap names}
This command returns a list of all registered DAP objects. It it useful mainly
-for TCL scripting.
+for Tcl scripting.
@end deffn
@deffn {Command} {dap info} [@var{num}|@option{root}]
@@ -5775,7 +5775,7 @@ until the programming session is finished.
If you use @ref{programmingusinggdb,,Programming using GDB},
the target is prepared automatically in the event gdb-flash-erase-start
-The jimtcl script @command{program} calls @command{reset init} explicitly.
+The Tcl script @command{program} calls @command{reset init} explicitly.
@section Erasing, Reading, Writing to Flash
@cindex flash erasing
@@ -7462,18 +7462,18 @@ mspm0_board_reset
@end itemize
-@deffn {TCL proc} {mspm0_board_reset}
+@deffn {Tcl proc} {mspm0_board_reset}
Performs an nRST toggle on the device.
@end deffn
-@deffn {TCL proc} {mspm0_mass_erase}
+@deffn {Tcl proc} {mspm0_mass_erase}
Sends the mass erase command to the SEC-AP mailbox and then performs
an nRST toggle. Once the command has been fully processed by the ROM,
all MAIN memory will be erased. NOTE: This command is not supported
on MSPM0C* family of devices.
@end deffn
-@deffn {TCL proc} {mspm0_factory_reset}
+@deffn {Tcl proc} {mspm0_factory_reset}
Sends the factory reset command to the SEC-AP mailbox and then performs
an nRST toggle. Once the command has been fully processed by the ROM,
all MAIN memory will be erased and NONMAIN will be reset to its default
@@ -7772,7 +7772,7 @@ flash bank super_flash_toc2_cm4 psoc6 0x16007C00 0 0 0 \
psoc6-specific commands
@deffn {Command} {psoc6 reset_halt}
-Command can be used to simulate broken Vector Catch from gdbinit or tcl scripts.
+Command can be used to simulate broken Vector Catch from gdbinit or Tcl scripts.
When invoked for CM0+ target, it will set break point at application entry point
and issue SYSRESETREQ. This will reset both cores and all peripherals. CM0+ will
reset CM4 during boot anyway so this is safe. On CM4 target, VECTRESET is used
@@ -8987,7 +8987,7 @@ OpenOCD implements numerous ways to program the target flash, whether internal o
Programming can be achieved by either using @ref{programmingusinggdb,,Programming using GDB},
or using the commands given in @ref{flashprogrammingcommands,,Flash Programming Commands}.
-@*To simplify using the flash commands directly a jimtcl script is available that handles the programming and verify stage.
+@*To simplify using the flash commands directly a Tcl script is available that handles the programming and verify stage.
OpenOCD will program/verify/reset the target and optionally shutdown.
The script is executed as follows and by default the following actions will be performed.
@@ -9269,7 +9269,7 @@ non-zero exit code to the parent process.
If user types CTRL-C or kills OpenOCD, the command @command{shutdown}
will be automatically executed to cause OpenOCD to exit.
-It is possible to specify, in the TCL list @var{pre_shutdown_commands} , a
+It is possible to specify, in the Tcl list @var{pre_shutdown_commands} , a
set of commands to be automatically executed before @command{shutdown} , e.g.:
@example
lappend pre_shutdown_commands @{echo "Goodbye, my friend ..."@}
@@ -9858,7 +9858,7 @@ Add or replace usage text on the given @var{command_name}.
@deffn {Command} {ms}
Returns current time since the Epoch in ms
(See: @url{https://en.wikipedia.org/wiki/Epoch_(computing)}).
-Useful to compute delays in TCL.
+Useful to compute delays in Tcl.
@end deffn
@node Architecture and Core Commands
@@ -10175,7 +10175,7 @@ of the CTI.
@deffn {Command} {cti names}
Prints a list of names of all CTI objects created. This command is mainly
-useful in TCL scripting.
+useful in Tcl scripting.
@end deffn
@section Generic ARM
@@ -10819,7 +10819,7 @@ protocol used for trace data:
@end itemize
@item @code{-event} @var{event_name} @var{event_body} -- assigns an event handler,
-a TCL string which is evaluated when the event is triggered. The events
+a Tcl string which is evaluated when the event is triggered. The events
@code{pre-enable}, @code{post-enable}, @code{pre-disable} and @code{post-disable}
are defined for TPIU/SWO.
A typical use case for the event @code{pre-enable} is to enable the trace clock
@@ -11643,7 +11643,7 @@ capabilities than most of the other processors and in addition there is an
extension interface that allows SoC designers to add custom registers and
instructions. For the OpenOCD that mostly means that set of core and AUX
registers in target will vary and is not fixed for a particular processor
-model. To enable extensibility several TCL commands are provided that allow to
+model. To enable extensibility several Tcl commands are provided that allow to
describe those optional registers in OpenOCD configuration files. Moreover
those commands allow for a dynamic target features discovery.
@@ -11798,12 +11798,12 @@ configuration comprises two categories:
@end enumerate
All common Xtensa support is built into the OpenOCD Xtensa target layer and
-is enabled through a combination of TCL scripts: the target-specific
+is enabled through a combination of Tcl scripts: the target-specific
@file{target/xtensa.cfg} and a board-specific @file{board/xtensa-*.cfg},
similar to other target architectures.
Importantly, core-specific configuration information must be provided by
-the user, and takes the form of an @file{xtensa-core-XXX.cfg} TCL script that
+the user, and takes the form of an @file{xtensa-core-XXX.cfg} Tcl script that
defines the core's configurable features through a series of Xtensa
configuration commands (detailed below).
@@ -13376,7 +13376,7 @@ learning Tcl, the intent of this chapter is to give you some idea of
how the Tcl scripts work.
This chapter is written with two audiences in mind. (1) OpenOCD users
-who need to understand a bit more of how Jim-Tcl works so they can do
+who need to understand a bit more of how Jim Tcl works so they can do
something useful, and (2) those that want to add a new command to
OpenOCD.
@@ -13536,7 +13536,7 @@ Often many of those parameters are in @{curly-braces@} - thus the
variables inside are not expanded or replaced until later.
Remember that every Tcl command looks like the classic ``main( argc,
-argv )'' function in C. In JimTCL - they actually look like this:
+argv )'' function in C. In Jim Tcl - they actually look like this:
@example
int
-----------------------------------------------------------------------
Summary of changes:
README | 4 +--
TODO | 18 +++++-----
doc/manual/helper.txt | 2 +-
doc/manual/jtag.txt | 4 +--
doc/manual/primer/docs.txt | 2 +-
doc/manual/primer/tcl.txt | 28 +++++++--------
doc/manual/scripting.txt | 14 ++++----
doc/manual/server.txt | 34 +++++++++---------
doc/manual/style.txt | 6 ++--
doc/openocd.texi | 88 +++++++++++++++++++++++-----------------------
10 files changed, 100 insertions(+), 100 deletions(-)
hooks/post-receive
--
Main OpenOCD repository
|