Skip to content

Commit 1ada54c

Browse files
borneoaerhankur
authored andcommitted
openocd: dump full command line in the debug log
When receiving an OpenOCD debug log to investigate about errors or issues, the first question is often about providing the complete command line to better understand the use context. Plus, when OpenOCD is lunched by an IDE, its command line is kept hidden inside the IDE, adding troubles to the user to recover it. Add the full command line directly inside the debug log. It could have been useful to also search and add in the log the full path of the OpenOCD executable, but this is not an immediate task due to portability among OS's. See, for example: https://stackoverflow.com/questions/933850 This part could be handled in a future change, if really needed. Change-Id: Ia6c5b838b9b7208bf1ecac7f95b5efc319aeabf5 Signed-off-by: Antonio Borneo <[email protected]>
1 parent 7d3b846 commit 1ada54c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/helper/options.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,10 @@ int parse_cmdline_args(struct command_context *cmd_ctx, int argc, char *argv[])
341341
exit(0);
342342
}
343343

344+
/* dump full command line */
345+
for (int i = 0; i < argc; i++)
346+
LOG_DEBUG("ARGV[%d] = \"%s\"", i, argv[i]);
347+
344348
/* paths specified on the command line take precedence over these
345349
* built-in paths
346350
*/

0 commit comments

Comments
 (0)