diff options
author | Spencer Oliver <spen@spen-soft.co.uk> | 2011-12-20 16:15:52 +0000 |
---|---|---|
committer | Spencer Oliver <spen@spen-soft.co.uk> | 2012-01-03 09:30:14 +0000 |
commit | 4c1190624124b182a8502aa011354a1b9676aa8a (patch) | |
tree | 180cd47a57598faab364ac112c2bfb104de3e334 /src | |
parent | 7e2257663d1ccdcfba5e000d6745367eb3d94443 (diff) | |
download | riscv-openocd-4c1190624124b182a8502aa011354a1b9676aa8a.zip riscv-openocd-4c1190624124b182a8502aa011354a1b9676aa8a.tar.gz riscv-openocd-4c1190624124b182a8502aa011354a1b9676aa8a.tar.bz2 |
helper: fix arm11 help text
This fixes a long standing bug: see Trac #4
Increased help text recursion limit and added LOG_DEBUG so we can
catch future errors like this.
Change-Id: I5fac95c4486eaddaf1e88a27ecb1835168f87711
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Reviewed-on: http://openocd.zylin.com/291
Tested-by: jenkins
Reviewed-by: Øyvind Harboe <oyvindharboe@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/helper/command.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/helper/command.c b/src/helper/command.c index b00a231..552031d 100644 --- a/src/helper/command.c +++ b/src/helper/command.c @@ -97,7 +97,7 @@ static struct log_capture_state *command_log_capture_start(Jim_Interp *interp) * Therefore we set the tcl return value only if we actually * captured output. */ -static void command_log_capture_finish(struct log_capture_state *state) +static void command_log_capture_finish(struct log_capture_state *state) { if (NULL == state) return; @@ -927,8 +927,10 @@ static COMMAND_HELPER(command_help_show, struct command *c, unsigned n, return -ENOMEM; } - if (++n >= 2) - return ERROR_OK; + if (++n > 5) { + LOG_ERROR("command recursion exceeded"); + return ERROR_FAIL; + } return CALL_COMMAND_HANDLER(command_help_show_list, c->children, n, show_help, match); |