helper/command: strip replicated command name in log
authorAntonio Borneo <borneo.antonio@gmail.com>
Sun, 20 Oct 2019 17:40:28 +0000 (19:40 +0200)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sun, 24 May 2020 20:36:29 +0000 (21:36 +0100)
commit3008756604b8b7a3811948cf66ed7e587efac349
treea1d6b235682aad196b0c2f80a1d601a920fd7319
parent7456e6bac5a3f13818d16660f3cd049a73a6e3fb
helper/command: strip replicated command name in log

After commit 0840414f0e57 ("helper/command: do not replace new
commands with ocd_ prefix"), the command name is present in
argv[0], so there is no need to pass it directly. The current code
causes the command name to be logged twice, once explicitly and
then from the content of argv[0]:
openocd -c 'debug_level 3; echo hello; shutdown'
<snip>
Debug: 13 3 command.c:142 script_debug(): command - echo echo hello
<snip>
Debug: 16 4 command.c:142 script_debug(): command - shutdown shutdown

Remove the command name from the arguments of the function
script_debug().

Change-Id: I57860774f450ff717ee71ef9dc07590549a84319
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5660
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Tested-by: jenkins
src/helper/command.c
src/helper/command.h
src/jtag/tcl.c