From: OpenOCD-Gerrit <ope...@us...> - 2020-08-02 09:49: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 e0c16c4c8f7aea03b9e2a4b453c6fbda165dec71 (commit) via 7c66df13ef5e45c085786206ef061047b522c18e (commit) via 768502403ee0513d0e289c22b27c7296300fe39d (commit) from 33b52174e6a0fc7513059e27dea18dee7b105781 (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 e0c16c4c8f7aea03b9e2a4b453c6fbda165dec71 Author: Antonio Borneo <bor...@gm...> Date: Wed Jul 22 12:10:26 2020 +0200 tcl/target/armada370: remove useless 'init' command As the comment states, the 'init' command is issued before the command 'dap apsel', otherwise it fails. This dependency has been already fixed in commit e48690cb26e4 ("target/arm_adi_v5: allow commands apsel and apcsw during init phase"), so the command 'dap apsel' can now be issued directly. Remove both the unneeded 'init' command and the comment that documents and justify its presence. Change-Id: I50f0a820fa7ead6f5a3bd9cc5180d521070822c9 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: http://openocd.zylin.com/5786 Tested-by: jenkins diff --git a/tcl/target/armada370.cfg b/tcl/target/armada370.cfg index 3b4be9f08..71652748f 100644 --- a/tcl/target/armada370.cfg +++ b/tcl/target/armada370.cfg @@ -28,6 +28,4 @@ proc armada370_dbginit {target} { $_TARGETNAME configure -event reset-assert-post "armada370_dbginit $_TARGETNAME" -# We need to init now, so we can run the apsel command. -init dap apsel 1 commit 7c66df13ef5e45c085786206ef061047b522c18e Author: Antonio Borneo <bor...@gm...> Date: Mon May 25 12:04:17 2020 +0200 target/arm11: fix memory leaks, including register cache There is no deinit_target method, so few memory allocations leak at openocd exit. Issue identified by tracking all calls to arm_dpm_setup(). Implement the method arm11_dpm_deinit() to free all the memory allocated in arm11_dpm_init() and call it in the new arm11_deinit_target(). NOT TESTED on real HW. Change-Id: Icab86e290fc2db14f70eb84c8286357aadb02a35 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: http://openocd.zylin.com/5694 Tested-by: jenkins diff --git a/src/target/arm11.c b/src/target/arm11.c index 10a1d6de5..68d4e1894 100644 --- a/src/target/arm11.c +++ b/src/target/arm11.c @@ -1131,6 +1131,14 @@ static int arm11_init_target(struct command_context *cmd_ctx, return ERROR_OK; } +static void arm11_deinit_target(struct target *target) +{ + struct arm11_common *arm11 = target_to_arm11(target); + + arm11_dpm_deinit(arm11); + free(arm11); +} + /* talk to the target and set things up */ static int arm11_examine(struct target *target) { @@ -1379,5 +1387,6 @@ struct target_type arm11_target = { .commands = arm11_command_handlers, .target_create = arm11_target_create, .init_target = arm11_init_target, + .deinit_target = arm11_deinit_target, .examine = arm11_examine, }; diff --git a/src/target/arm11_dbgtap.c b/src/target/arm11_dbgtap.c index a758db58f..60be0096f 100644 --- a/src/target/arm11_dbgtap.c +++ b/src/target/arm11_dbgtap.c @@ -1193,3 +1193,13 @@ int arm11_dpm_init(struct arm11_common *arm11, uint32_t didr) return arm11_bpwp_flush(arm11); } + +void arm11_dpm_deinit(struct arm11_common *arm11) +{ + struct arm_dpm *dpm = &arm11->dpm; + + free(arm11->bpwp_actions); + arm_free_reg_cache(dpm->arm); + free(dpm->dbp); + free(dpm->dwp); +} diff --git a/src/target/arm11_dbgtap.h b/src/target/arm11_dbgtap.h index 541434edc..be0248411 100644 --- a/src/target/arm11_dbgtap.h +++ b/src/target/arm11_dbgtap.h @@ -78,6 +78,7 @@ int arm11_read_memory_word(struct arm11_common *arm11, uint32_t address, uint32_t *result); int arm11_dpm_init(struct arm11_common *arm11, uint32_t didr); +void arm11_dpm_deinit(struct arm11_common *arm11); int arm11_bpwp_flush(struct arm11_common *arm11); #endif /* OPENOCD_TARGET_ARM11_DBGTAP_H */ commit 768502403ee0513d0e289c22b27c7296300fe39d Author: Antonio Borneo <bor...@gm...> Date: Tue May 19 16:41:17 2020 +0200 target: use one second timeout while halting target at gdb attach By default GDB timeouts after 2 seconds, even if this value can be modified with GDB command "set remotetimeout". On OpenOCD side, the default event for GDB attach is to halt the target and wait it to halt. But here the default timeout of the halt command is 5 seconds! If the target cannot be halted (e.g. it's kept in reset by another core or the debugger doesn't have enough privileges) then GDB will timeout while OpenOCD is still waiting and is unable to communicate with GDB. Decrease the halt timeout to 1 second in the default GDB attach event handler. Change-Id: I231c740816bb6a0d74b0bc679a368a6cbfb34824 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: http://openocd.zylin.com/5687 Tested-by: jenkins diff --git a/src/target/startup.tcl b/src/target/startup.tcl index 93e46b5f8..ca39b1816 100644 --- a/src/target/startup.tcl +++ b/src/target/startup.tcl @@ -205,7 +205,7 @@ proc init_target_events {} { foreach t $targets { set_default_target_event $t gdb-flash-erase-start "reset init" set_default_target_event $t gdb-flash-write-end "reset halt" - set_default_target_event $t gdb-attach "halt" + set_default_target_event $t gdb-attach "halt 1000" } } ----------------------------------------------------------------------- Summary of changes: src/target/arm11.c | 9 +++++++++ src/target/arm11_dbgtap.c | 10 ++++++++++ src/target/arm11_dbgtap.h | 1 + src/target/startup.tcl | 2 +- tcl/target/armada370.cfg | 2 -- 5 files changed, 21 insertions(+), 3 deletions(-) hooks/post-receive -- Main OpenOCD repository |