diff options
author | Martin Hunt <hunt@redhat.com> | 1998-08-28 19:18:38 +0000 |
---|---|---|
committer | Martin Hunt <hunt@redhat.com> | 1998-08-28 19:18:38 +0000 |
commit | 973b0216f663faa1b62636210460968c65c3511e (patch) | |
tree | 97d7797fa8263b7d3a4da2f5d35d32f9709fc250 /gdb | |
parent | 28278f903209f7f8408c65ff862bc1495287845d (diff) | |
download | gdb-973b0216f663faa1b62636210460968c65c3511e.zip gdb-973b0216f663faa1b62636210460968c65c3511e.tar.gz gdb-973b0216f663faa1b62636210460968c65c3511e.tar.bz2 |
Fri Aug 28 12:14:49 1998 Martin M. Hunt <hunt@cygnus.com>
* gdbtk-cmds.c (gdb_loadfile): Open the file after doing
the symtab lookup and calling symtab_to_filename(). This
makes GDBtk work with the GDB "dir" command.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog-gdbtk | 6 | ||||
-rw-r--r-- | gdb/gdbtk-cmds.c | 15 |
2 files changed, 14 insertions, 7 deletions
diff --git a/gdb/ChangeLog-gdbtk b/gdb/ChangeLog-gdbtk index 428257f..db6dfaf 100644 --- a/gdb/ChangeLog-gdbtk +++ b/gdb/ChangeLog-gdbtk @@ -1,3 +1,9 @@ +Fri Aug 28 12:14:49 1998 Martin M. Hunt <hunt@cygnus.com> + + * gdbtk-cmds.c (gdb_loadfile): Open the file after doing + the symtab lookup and calling symtab_to_filename(). This + makes GDBtk work with the GDB "dir" command. + 1998-08-18 Keith Seitz <keiths@cygnus.com> * gdbtk-hooks.c (gdbtk_add_hooks): Set selected_frame_level_changed_hook. diff --git a/gdb/gdbtk-cmds.c b/gdb/gdbtk-cmds.c index f7dda53..fba5357 100644 --- a/gdb/gdbtk-cmds.c +++ b/gdb/gdbtk-cmds.c @@ -2581,20 +2581,21 @@ gdb_loadfile (clientData, interp, objc, objv) file = Tcl_GetStringFromObj (objv[2], NULL); Tcl_GetBooleanFromObj (interp, objv[3], &linenumbers); - if ((fp = fopen ( file, "r" )) == NULL) - { - Tcl_SetStringObj ( result_ptr->obj_ptr, "Can't open file for reading", -1); - return TCL_ERROR; - } - symtab = full_lookup_symtab (file); if (!symtab) { - Tcl_SetStringObj ( result_ptr->obj_ptr, "File not found in symtab", -1); + Tcl_SetStringObj ( result_ptr->obj_ptr, "File not found in symtab", -1); fclose (fp); return TCL_ERROR; } + file = symtab_to_filename ( symtab ); + if ((fp = fopen ( file, "r" )) == NULL) + { + Tcl_SetStringObj ( result_ptr->obj_ptr, "Can't open file for reading", -1); + return TCL_ERROR; + } + if (stat (file, &st) < 0) { catch_errors (perror_with_name_wrapper, "gdbtk: get time stamp", "", |