summaryrefslogtreecommitdiff
path: root/gdb/gdbtk/generic/gdbtk-cmds.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2000-12-07 22:33:27 +0000
committerTom Tromey <tromey@redhat.com>2000-12-07 22:33:27 +0000
commit06ba43c26a708109f1507936201cdf32d372a4a2 (patch)
treeece6ef58c116e634cc8c8b96d937500c04785c8e /gdb/gdbtk/generic/gdbtk-cmds.c
parent02724c3027fd677ca4a89f12a87d8efd8878ce4b (diff)
downloadgdb-06ba43c26a708109f1507936201cdf32d372a4a2.tar.gz
* gdbtk-cmds.c (Gdbtk_Init): Create gdb_current_directory,
gdb_inferior_args, and gdb_source_path variables.
Diffstat (limited to 'gdb/gdbtk/generic/gdbtk-cmds.c')
-rw-r--r--gdb/gdbtk/generic/gdbtk-cmds.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/gdb/gdbtk/generic/gdbtk-cmds.c b/gdb/gdbtk/generic/gdbtk-cmds.c
index 4e20d088460..c213d38bac3 100644
--- a/gdb/gdbtk/generic/gdbtk-cmds.c
+++ b/gdb/gdbtk/generic/gdbtk-cmds.c
@@ -60,6 +60,12 @@
#include "annotate.h"
#include <sys/time.h>
+/* 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);
@@ -418,6 +424,28 @@ Gdbtk_Init (interp)
(char *) &gdb_context,
TCL_LINK_INT | TCL_LINK_READ_ONLY);
+ /* Make gdb's notion of the pwd visible. This is read-only because
+ (1) it doesn't make sense to change it directly and (2) it is
+ allocated using xmalloc and not Tcl_Alloc. You might think we
+ could just use the Tcl `pwd' command. However, Tcl (erroneously,
+ imho) maintains a cache of the current directory name, and
+ doesn't provide a way for gdb to invalidate the cache. */
+ Tcl_LinkVar (interp, "gdb_current_directory",
+ (char *) &current_directory,
+ TCL_LINK_STRING | TCL_LINK_READ_ONLY);
+
+ /* Current gdb source file search path. This is read-only for
+ reasons similar to those for gdb_current_directory. */
+ Tcl_LinkVar (interp, "gdb_source_path",
+ (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;