[patch] Code cleanup: objfile->name is never NULL

Tom Tromey tromey@redhat.com
Wed Sep 22 20:40:00 GMT 2010


>>>>> "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



More information about the Gdb-patches mailing list