summaryrefslogtreecommitdiff
path: root/gdb/gdbtk
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2001-04-18 16:49:38 +0000
committerTom Tromey <tromey@redhat.com>2001-04-18 16:49:38 +0000
commit48210e0efd3be702f403e153c5e4ca5c8c4c6a00 (patch)
tree973dac3974b40c5215bc63ab6765a2ae96e1d21e /gdb/gdbtk
parent7d10aef5b1f849ed8b6b44a522ae1f8339d15d3d (diff)
downloadgdb-48210e0efd3be702f403e153c5e4ca5c8c4c6a00.tar.gz
* library/session.tcl (session_save): Use gdb_get_inferior_args.
* generic/gdbtk-cmds.c (inferior_args): Removed. (Gdbtk_Init): Don't register gdb_inferior_args variable. Do register gdb_get_inferior_args function. (gdb_get_inferior_args): New function.
Diffstat (limited to 'gdb/gdbtk')
-rw-r--r--gdb/gdbtk/ChangeLog8
-rw-r--r--gdb/gdbtk/generic/gdbtk-cmds.c41
-rw-r--r--gdb/gdbtk/library/session.tcl4
3 files changed, 42 insertions, 11 deletions
diff --git a/gdb/gdbtk/ChangeLog b/gdb/gdbtk/ChangeLog
index 7b19f330ba8..72b325ee9b2 100644
--- a/gdb/gdbtk/ChangeLog
+++ b/gdb/gdbtk/ChangeLog
@@ -1,3 +1,11 @@
+2001-04-17 Tom Tromey <tromey@redhat.com>
+
+ * library/session.tcl (session_save): Use gdb_get_inferior_args.
+ * generic/gdbtk-cmds.c (inferior_args): Removed.
+ (Gdbtk_Init): Don't register gdb_inferior_args variable. Do
+ register gdb_get_inferior_args function.
+ (gdb_get_inferior_args): New function.
+
2001-04-17 Fernando Nasser <fnasser@redhat.com>
* library/variables.tcl (update): Temporary fix to the detection of
diff --git a/gdb/gdbtk/generic/gdbtk-cmds.c b/gdb/gdbtk/generic/gdbtk-cmds.c
index a4960fb0f06..35f269506e5 100644
--- a/gdb/gdbtk/generic/gdbtk-cmds.c
+++ b/gdb/gdbtk/generic/gdbtk-cmds.c
@@ -64,9 +64,6 @@
/* Various globals we reference. */
extern char *source_path;
-/* FIXME: this must be `extern'. But to do that we need a patch to
- infcmd.c. */
-static char *inferior_args = "";
static void setup_architecture_data (void);
static int tracepoint_exists (char *args);
@@ -236,6 +233,9 @@ static int gdb_loadfile (ClientData, Tcl_Interp *, int,
Tcl_Obj * CONST objv[]);
static int gdb_load_disassembly (ClientData clientData, Tcl_Interp
* interp, int objc, Tcl_Obj * CONST objv[]);
+static int gdb_get_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[]);
@@ -419,6 +419,8 @@ Gdbtk_Init (interp)
gdb_get_blocks, NULL);
Tcl_CreateObjCommand (interp, "gdb_block_variables", call_wrapper,
gdb_block_vars, NULL);
+ Tcl_CreateObjCommand (interp, "gdb_get_inferior_args", call_wrapper,
+ gdb_get_inferior_args, NULL);
Tcl_LinkVar (interp, "gdb_selected_frame_level",
(char *) &selected_frame_level,
@@ -445,12 +447,6 @@ Gdbtk_Init (interp)
(char *) &source_path,
TCL_LINK_STRING | TCL_LINK_READ_ONLY);
- /* Current inferior command-line arguments. This is read-only for
- reasons similar to those for gdb_current_directory. */
- Tcl_LinkVar (interp, "gdb_inferior_args",
- (char *) &inferior_args,
- TCL_LINK_STRING | TCL_LINK_READ_ONLY);
-
/* Init variable interface... */
if (gdb_variable_init (interp) != TCL_OK)
return TCL_ERROR;
@@ -986,6 +982,33 @@ gdb_target_has_execution_command (clientData, interp, objc, objv)
return TCL_OK;
}
+/* This implements the tcl command "gdb_get_inferior_args"
+
+ * Returns inferior command line arguments as a string
+ *
+ * Tcl Arguments:
+ * None
+ * Tcl Result:
+ * A string containing the inferior command line arguments
+ */
+
+static int
+gdb_get_inferior_args (clientData, interp, objc, objv)
+ ClientData clientData;
+ Tcl_Interp *interp;
+ int objc;
+ Tcl_Obj *CONST objv[];
+{
+ if (objc != 1)
+ {
+ Tcl_WrongNumArgs (interp, 1, objv, NULL);
+ return TCL_ERROR;
+ }
+
+ Tcl_SetStringObj (result_ptr->obj_ptr, get_inferior_args (), -1);
+ return TCL_OK;
+}
+
/* This implements the tcl command "gdb_load_info"
* It returns information about the file about to be downloaded.
diff --git a/gdb/gdbtk/library/session.tcl b/gdb/gdbtk/library/session.tcl
index d4f3ec6d18c..e9de8d7c3c2 100644
--- a/gdb/gdbtk/library/session.tcl
+++ b/gdb/gdbtk/library/session.tcl
@@ -21,7 +21,7 @@
#
proc session_save {} {
global gdb_exe_name gdb_target_name
- global gdb_current_directory gdb_source_path gdb_inferior_args
+ global gdb_current_directory gdb_source_path
# gdb sessions are named after the executable.
set name $gdb_exe_name
@@ -34,7 +34,7 @@ proc session_save {} {
set values(executable) $gdb_exe_name
# Some simple state the user wants.
- set values(args) $gdb_inferior_args
+ set values(args) [gdb_get_inferior_args]
set values(dirs) $gdb_source_path
set values(pwd) $gdb_current_directory
set values(target) $gdb_target_name