This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Code cleanup: objfile->name is never NULL
- From: Tom Tromey <tromey at redhat dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 22 Sep 2010 13:42:45 -0600
- Subject: Re: [patch] Code cleanup: objfile->name is never NULL
- References: <20100922094323.GA20792@host1.dyn.jankratochvil.net>
>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:
Jan> there is some FUD in GDB code whether objfile->name can be NULL. I
Jan> haven't found a way it could be. Also a lot of GDB code already
Jan> assumes it is not NULL.
I agree with this patch.
Jan> - if (!objfile->name)
Jan> - return;
Jan> load_auto_scripts_for_objfile (objfile);
This part made me realize that we should probably have some kind of "is
a file" flag on the objfile, to avoid trying to load files relative to a
phony name like "<<anonymous objfile>>".
Tom