summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-11-26 13:42:02 +0000
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>2008-11-26 13:42:02 +0000
commit6e2e706d7eb90e58346a5e0d36c6087b19949675 (patch)
tree4afbed16801ae128e996c0a39ecd8cdf57c92c74 /src
parent7765c636498173ad09b91e3b923b8068b227738b (diff)
downloadopenocd+libswd-6e2e706d7eb90e58346a5e0d36c6087b19949675.tar.gz
openocd+libswd-6e2e706d7eb90e58346a5e0d36c6087b19949675.tar.bz2
openocd+libswd-6e2e706d7eb90e58346a5e0d36c6087b19949675.tar.xz
openocd+libswd-6e2e706d7eb90e58346a5e0d36c6087b19949675.zip
friendlier error messages
git-svn-id: svn://svn.berlios.de/openocd/trunk@1185 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src')
-rw-r--r--src/helper/command.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/helper/command.c b/src/helper/command.c
index 9ca64dd2..cccf60e5 100644
--- a/src/helper/command.c
+++ b/src/helper/command.c
@@ -147,6 +147,9 @@ static int script_command(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
return (retval==ERROR_OK)?JIM_OK:JIM_ERR;
}
+/* nice short description of source file */
+#define __THIS__FILE__ "command.c"
+
command_t* register_command(command_context_t *context, command_t *parent, char *name, int (*handler)(struct command_context_s *context, char* name, char** args, int argc), enum command_mode mode, char *help)
{
command_t *c, *p;
@@ -222,7 +225,7 @@ command_t* register_command(command_context_t *context, command_t *parent, char
/* we now need to add an overrideable proc */
const char *override_name=alloc_printf("proc %s%s%s {args} {if {[catch {eval \"ocd_%s%s%s $args\"}]==0} {return \"\"} else { return -code error }", t1, t2, t3, t1, t2, t3);
- Jim_Eval_Named(interp, override_name, __FILE__, __LINE__ );
+ Jim_Eval_Named(interp, override_name, __THIS__FILE__, __LINE__ );
free((void *)override_name);
/* accumulate help text in Tcl helptext list. */
@@ -442,7 +445,7 @@ int command_run_line(command_context_t *context, char *line)
retcode = Jim_SetAssocData(interp, "retval", NULL, &retval);
if (retcode == JIM_OK)
{
- retcode = Jim_Eval_Named(interp, line, __FILE__, __LINE__ );
+ retcode = Jim_Eval_Named(interp, line, __THIS__FILE__, __LINE__ );
Jim_DeleteAssocData(interp, "retval");
}
@@ -648,7 +651,7 @@ static int jim_capture(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
log_add_callback(tcl_output, tclOutput);
- retcode = Jim_Eval_Named(interp, str, __FILE__, __LINE__ );
+ retcode = Jim_Eval_Named(interp, str, __THIS__FILE__, __LINE__ );
log_remove_callback(tcl_output, tclOutput);