This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
[PATCH] can't find files? lookup_symtab change
- From: Keith Seitz <keiths at redhat dot com>
- To: Insight Maling List <insight at sources dot redhat dot com>
- Date: Tue, 8 Jan 2002 12:21:45 -0800 (PST)
- Subject: [PATCH] can't find files? lookup_symtab change
Hi,
We made a great stride to dumping more code into gdb, but, alas, I made a
boo-boo.
If you debug gdb on gdb, you'll find that you cannot bring up the source
for gdbtk-cmds.c. The problem is that the symtab's fullname hass not
necessarily been "filled in".
The following patch updates gdb_find_file_command so that it will ask for
the file's fullname if the symtab doesn't have it.
Keith
ChangeLog
2002-01-08 Keith Seitz <keiths@redhat.com>
* generic/gdbtk-cmds.c (gdb_find_file_command): If the symtab
doesn't have the filename's fullname, look it up with
symtab_to_filename.
Patch
Index: generic/gdbtk-cmds.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/generic/gdbtk-cmds.c,v
retrieving revision 1.47
diff -u -p -r1.47 gdbtk-cmds.c
--- gdbtk-cmds.c 2002/01/05 04:30:45 1.47
+++ gdbtk-cmds.c 2002/01/08 20:17:55
@@ -1102,7 +1102,7 @@ gdb_find_file_command (clientData, inter
Tcl_Obj *CONST objv[];
{
struct symtab *st;
- char *filename;
+ char *filename, *fullname;
if (objc != 2)
{
@@ -1120,14 +1120,19 @@ gdb_find_file_command (clientData, inter
return TCL_ERROR;
}
+ if (st->fullname == NULL)
+ fullname = symtab_to_filename (st);
+ else
+ fullname = st->fullname;
+
/* We may not be able to open the file (not available). */
- if (!st->fullname)
+ if (fullname == NULL)
{
Tcl_SetStringObj (result_ptr->obj_ptr, "", -1);
return TCL_OK;
}
- Tcl_SetStringObj (result_ptr->obj_ptr, st->fullname, -1);
+ Tcl_SetStringObj (result_ptr->obj_ptr, fullname, -1);
return TCL_OK;
}