This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: -file-list-exec-source-files
- From: Andreas Schwab <schwab at suse dot de>
- To: Elena Zannoni <ezannoni at redhat dot com>
- Cc: Eli Zaretskii <eliz at gnu dot org>, gdb-patches at sources dot redhat dot com
- Date: Sun, 27 Jun 2004 20:06:13 +0200
- Subject: Re: -file-list-exec-source-files
- References: <20040225040059.GB19094@white><16456.65451.461753.66554@localhost.redhat.com><20040306155700.GA9439@white> <20040311132508.GA2504@white><20040329205545.GA26696@white> <20040405214043.GA2052@white><20040412150620.GA9464@white> <20040420141001.GB4465@white><uisft98sz.fsf@elta.co.il><16519.59247.93650.941260@localhost.redhat.com><20040426130529.GA11975@white>
Bob Rossi <bob@brasko.net> writes:
> +/* Finds the fullname that a symtab represents.
> +
> + If this functions finds the fullname, it will save it in ps->fullname
> + and it will also return the value.
>
> + If this function fails to find the file that this symtab represents,
> + NULL will be returned and ps->fullname will be set to NULL. */
This causes gdb to crash in lookup_symtab.
if (full_path != NULL)
{
const char *fp = symtab_to_fullname (s);
if (FILENAME_CMP (full_path, fp) == 0)
{
return s;
}
}
if (real_path != NULL)
{
char *rp = gdb_realpath (symtab_to_fullname (s));
make_cleanup (xfree, rp);
if (FILENAME_CMP (real_path, rp) == 0)
{
return s;
}
}
Neither of these places expect symtab_to_fullname to return NULL.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."