aboutsummaryrefslogtreecommitdiff
path: root/src/openocd.c
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-07-10 18:24:30 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-07-10 18:24:30 +0000
commit2858a9f740a49998bf2db1e6379c5c47133aea98 (patch)
treef5838d57fe9224d441b3fb090c83dceeb5c0637e /src/openocd.c
parent5a2b824b2650b5a7ee8366f6dfca5b6c2a9c3033 (diff)
downloadriscv-openocd-2858a9f740a49998bf2db1e6379c5c47133aea98.zip
riscv-openocd-2858a9f740a49998bf2db1e6379c5c47133aea98.tar.gz
riscv-openocd-2858a9f740a49998bf2db1e6379c5c47133aea98.tar.bz2
- added search paths before running tcl/commands.tcl.
- improved error handling for missing tcl/commands.tcl git-svn-id: svn://svn.berlios.de/openocd/trunk@785 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/openocd.c')
-rw-r--r--src/openocd.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/openocd.c b/src/openocd.c
index f4aa451..c7b18eb 100644
--- a/src/openocd.c
+++ b/src/openocd.c
@@ -572,7 +572,11 @@ void initJim(void)
/* after command line parsing */
void initJim2(void)
{
- Jim_Eval(interp, "source [find tcl/commands.tcl]");
+ if (Jim_Eval(interp, "source [find tcl/commands.tcl]")==JIM_ERR)
+ {
+ LOG_ERROR("Can not find tcl/commands.tcl - check installation");
+ exit(-1);
+ }
}
command_context_t *setup_command_handler(void)
@@ -653,11 +657,13 @@ int openocd_main(int argc, char *argv[])
active_cmd_ctx=cfg_cmd_ctx;
- if (parse_cmdline_args(cfg_cmd_ctx, argc, argv) != ERROR_OK)
- return EXIT_FAILURE;
+ add_default_dirs();
initJim2();
-
+
+ if (parse_cmdline_args(cfg_cmd_ctx, argc, argv) != ERROR_OK)
+ return EXIT_FAILURE;
+
if (parse_config_file(cfg_cmd_ctx) != ERROR_OK)
return EXIT_FAILURE;