openocd/src/helper
Antonio Borneo 462323f123 helper/command: use one single handler for all the commands
Today openocd registers the commands to jim with three methods:
1) "native" commands (.jim_handler) at root level are registered
   directly as jim commands;
2) "simple" commands (.handler) at root level are registered
   through the handler script_command();
3) all other commands not at root level are registered through the
   handler command_unknown().

Apart from using different handler, other inconsistencies are
present:
a) command in 1) are not checked for their "mode", so are run with
   no check about current mode (COMMAND_CONFIG or COMMAND_EXEC);
b) target_call_timer_callbacks_now() is called only for "simple"
   commands and not for "native" commands;
c) target override is performed only for "simple" commands and not
   for "native" commands.

Drop script_command() and extend command_unknown() to uniformly
handle all the cases above, fixing all the inconsistencies already
mentioned.
The handler's name command_unknown() is probably not anymore
appropriate, but will be renamed in a separate change.

Note: today all the commands in a) have mode CONFIG_ANY, apart for
"mem2array" and "array2mem" that have mode COMMAND_EXEC. But the
latter commands are registered during target init, so do not exist
during COMMAND_CONFIG and no issue is present.

Change-Id: I67bd6e47eb2c575107251b9192c676c27d4aabae
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5665
Tested-by: jenkins
Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
2021-04-18 15:33:07 +01:00
..
bin2char.sh helper: fix minor typos 2020-09-05 17:10:54 +01:00
binarybuffer.c Fix debug prints when loading to flash 2020-09-05 16:48:08 +01:00
binarybuffer.h Fix debug prints when loading to flash 2020-09-05 16:48:08 +01:00
bits.h openocd: fix incorrect doxygen comments 2021-01-13 11:33:16 +00:00
command.c helper/command: use one single handler for all the commands 2021-04-18 15:33:07 +01:00
command.h helper/command: always pass struct command as jim private data 2021-04-18 15:32:57 +01:00
configuration.c helper/configuration: free script_search_dirs and config_file_names 2018-03-07 23:47:31 +00:00
configuration.h helper/configuration: free script_search_dirs and config_file_names 2018-03-07 23:47:31 +00:00
fileio.c Handle improperly build image files gracefully 2018-02-14 08:27:01 +00:00
fileio.h Handle improperly build image files gracefully 2018-02-14 08:27:01 +00:00
jep106.c Remove FSF address from GPL notices 2016-05-24 22:30:01 +01:00
jep106.h Make #include guard naming consistent 2016-05-24 22:30:55 +01:00
jep106.inc jep106: Add new IDs from JEDEC 2020-12-05 23:17:48 +00:00
jim-nvp.c jim-nvp: Make Jim_GetOpt_String const-correct 2016-02-29 20:32:31 +00:00
jim-nvp.h helper: fix minor typos 2020-09-05 17:10:54 +01:00
list.h openocd: fix incorrect doxygen comments 2021-01-13 11:33:16 +00:00
log.c helper: fix minor typos 2020-09-05 17:10:54 +01:00
log.h Upstream tons of RISC-V changes. 2020-10-14 05:43:05 +01:00
Makefile.am ioutil: drop the code, deprecated in v0.10.0 2021-03-19 21:55:23 +00:00
options.c openocd: remove command line flag -p/--pipe deprecated in v0.5.0 2021-03-19 21:54:46 +00:00
replacements.c Remove FSF address from GPL notices 2016-05-24 22:30:01 +01:00
replacements.h helper/replacements.h: Add missing #include 2018-03-07 23:43:58 +00:00
startup.tcl coding style: src: remove empty lines at end of text files 2020-05-02 15:40:21 +01:00
system.h configure: drop macro 'AC_HEADER_TIME' 2021-01-18 15:32:46 +00:00
time_support_common.c Fix usage of timeval_ms() 2016-07-19 10:45:16 +01:00
time_support.c Add timeval_compare helper function 2018-01-25 16:43:45 +00:00
time_support.h configure: drop macro 'AC_HEADER_TIME' 2021-01-18 15:32:46 +00:00
types.h Remove BUILD_TARGET64 2020-04-21 12:55:41 +01:00
update_jep106.pl helper: fix minor typos 2020-09-05 17:10:54 +01:00
util.c helper: fix minor typos 2020-09-05 17:10:54 +01:00
util.h Make #include guard naming consistent 2016-05-24 22:30:55 +01:00