+2001-04-18 Tom Tromey <tromey@redhat.com>
+
+ * library/interface.tcl (run_executable): Use
+ gdb_set_inferior_args.
+ * library/session.tcl (session_load): Use gdb_set_inferior_args.
+ * generic/gdbtk-cmds.c (Gdbtk_Init): Register
+ gdb_set_inferior_args.
+ (gdb_get_inferior_args): New function.
+
2001-04-17 Tom Tromey <tromey@redhat.com>
* library/session.tcl (session_save): Use gdb_get_inferior_args.
static int gdb_get_inferior_args (ClientData clientData,
Tcl_Interp *interp,
int objc, Tcl_Obj * CONST objv[]);
+static int gdb_set_inferior_args (ClientData clientData,
+ Tcl_Interp *interp,
+ int objc, Tcl_Obj * CONST objv[]);
static int gdb_load_info (ClientData, Tcl_Interp *, int,
Tcl_Obj * CONST objv[]);
static int gdb_loc (ClientData, Tcl_Interp *, int, Tcl_Obj * CONST[]);
gdb_block_vars, NULL);
Tcl_CreateObjCommand (interp, "gdb_get_inferior_args", call_wrapper,
gdb_get_inferior_args, NULL);
+ Tcl_CreateObjCommand (interp, "gdb_set_inferior_args", call_wrapper,
+ gdb_set_inferior_args, NULL);
Tcl_LinkVar (interp, "gdb_selected_frame_level",
(char *) &selected_frame_level,
return TCL_OK;
}
+/* This implements the tcl command "gdb_set_inferior_args"
+
+ * Sets inferior command line arguments
+ *
+ * Tcl Arguments:
+ * A string containing the inferior command line arguments
+ * Tcl Result:
+ * None
+ */
+
+static int
+gdb_set_inferior_args (clientData, interp, objc, objv)
+ ClientData clientData;
+ Tcl_Interp *interp;
+ int objc;
+ Tcl_Obj *CONST objv[];
+{
+ char *args;
+
+ if (objc != 2)
+ {
+ Tcl_WrongNumArgs (interp, 1, objv, "argument");
+ return TCL_ERROR;
+ }
+
+ args = Tcl_GetStringFromObj (objv[1], NULL);
+
+ /* The xstrdup/xfree stuff is so that we maintain a coherent picture
+ for gdb. I would expect the accessors to do this, but they
+ don't. */
+ args = xstrdup (args);
+ args = set_inferior_args (args);
+ xfree (args);
+
+ return TCL_OK;
+}
+
/* This implements the tcl command "gdb_load_info"
* It returns information about the file about to be downloaded.