bb9d9c6026
This change contains an alternative to Matthias Welwarsky's #4130 (target-prefixed commands) and to #4293 (event handlers). get_current_target() must retrieve the target associated to the current command. If no target associated, the current target of the command context is used as a fallback. Many Tcl event handlers work with the current target as if it were the target issuing the event. current_target in command_context is a number and has to be converted to a pointer in every get_current_target() call. The solution: - Replace current_target in command_context by a target pointer - Add another target pointer current_target_override - get_current_target() returns current_target_override if set, otherwise current_target - Save, set and restore current_target_override to the current prefix in run_command() - Save, set and restore current_target_override to the event invoking target in target_handle_event() While on it use calloc when allocating a new command_context. Change-Id: I9a82102e94dcac063743834a1d28da861b2e74ea Signed-off-by: Tomas Vanek <vanekt@fbl.cz> Suggested-by: Matthias Welwarsky <matthias.welwarsky@sysgo.com> Reviewed-on: http://openocd.zylin.com/4295 Tested-by: jenkins Reviewed-by: Matthias Welwarsky <matthias@welwarsky.de> |
||
---|---|---|
.. | ||
bin2char.sh | ||
binarybuffer.c | ||
binarybuffer.h | ||
command.c | ||
command.h | ||
configuration.c | ||
configuration.h | ||
fileio.c | ||
fileio.h | ||
ioutil_stubs.c | ||
ioutil.c | ||
ioutil.h | ||
jep106.c | ||
jep106.h | ||
jep106.inc | ||
jim-nvp.c | ||
jim-nvp.h | ||
list.h | ||
log.c | ||
log.h | ||
Makefile.am | ||
options.c | ||
replacements.c | ||
replacements.h | ||
startup.tcl | ||
system.h | ||
time_support_common.c | ||
time_support.c | ||
time_support.h | ||
types.h | ||
update_jep106.pl | ||
util.c | ||
util.h |