Skip to content

Commit

Permalink
openocd: dump full command line in the debug log
Browse files Browse the repository at this point in the history
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 <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8170
Tested-by: jenkins
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
  • Loading branch information
borneoa committed Mar 16, 2024
1 parent e9df8a5 commit 1d076d6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/helper/options.c
Expand Up @@ -341,6 +341,10 @@ int parse_cmdline_args(struct command_context *cmd_ctx, int argc, char *argv[])
exit(0);
}

/* dump full command line */
for (int i = 0; i < argc; i++)
LOG_DEBUG("ARGV[%d] = \"%s\"", i, argv[i]);

/* paths specified on the command line take precedence over these
* built-in paths
*/
Expand Down

0 comments on commit 1d076d6

Please sign in to comment.