]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fri Aug 28 12:14:49 1998 Martin M. Hunt <hunt@cygnus.com>
authorMartin Hunt <hunt@redhat.com>
Fri, 28 Aug 1998 19:18:38 +0000 (19:18 +0000)
committerMartin Hunt <hunt@redhat.com>
Fri, 28 Aug 1998 19:18:38 +0000 (19:18 +0000)
* 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.

gdb/ChangeLog-gdbtk
gdb/gdbtk-cmds.c

index 428257f39d68fa45da372fc6543043b1495c9244..db6dfafc582428c34308456f2995525673f4284b 100644 (file)
@@ -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.
index f7dda53cb9f6fca16448f6d9f0056454fef76d5e..fba53570bf3583d27201447deb770ee7e6b11726 100644 (file)
@@ -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", "",