This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
Re: [RFC] patch to fix finding sources
- To: Fernando Nasser <fnasser at cygnus dot com>
- Subject: Re: [RFC] patch to fix finding sources
- From: "Martin M. Hunt" <hunt at redhat dot com>
- Date: Tue, 6 Feb 2001 13:30:43 -0800 (PST)
- cc: <insight at sources dot redhat dot com>
Sorry about the brief comments and forgetting to add the changelog into
the email. I have more time now, so I'll explain in more detail.
gdb_find_file checks for the existance of a source file on the development
host. It is expected that many sources (particularly to shared libraries)
will not be found. That is why I didn't like the idea that TCL_ERROR
would be returned forcing a catch to always be used. Then you have to
either parse the error message to determine if a warning or eror dialog is
displayed, or always ignore it. No big deal either way...
when you call full_lookup_symtab() you get a pointer to a symtab struct.
If that pointer is NULL, it is probably an error. If the pointer is not
null, st->fullname will be null if there if the sources are not found.
So, your code needs changed around a bit to avoid dereferencing a null
pointer.
The real problem here is probably my comment on full_lookup_symtab() that
says it always sets symtab->filename. Maybe we need a note that it will
be set to null is the sources are not available.
If you want to test yourself, my test case is not too difficult :^)
main()
{
printf("Hello World\n");
}
compile, run gdb, try to step into printf.
Martin
On Tue, 6 Feb 2001, Fernando Nasser wrote:
> I have added a few bits to Martin's patch, but I don't have how to test it at the moment. I would need Martin's help as he probably has the situation repeatable right now (which caused him to send the patch).
>
> I have attached the patch.
>
> --
> Fernando Nasser
> Red Hat - Toronto E-Mail: fnasser@redhat.com
> 2323 Yonge Street, Suite #300
> Toronto, Ontario M4P 2C9