* [PATCH] can't find files? lookup_symtab change
@ 2002-01-08 12:21 Keith Seitz
0 siblings, 0 replies; only message in thread
From: Keith Seitz @ 2002-01-08 12:21 UTC (permalink / raw)
To: Insight Maling List
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;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-01-08 20:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-08 12:21 [PATCH] can't find files? lookup_symtab change Keith Seitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).