This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Don't check PST is NULL in read_symtab
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Yao Qi <yao at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 11 Jan 2013 08:52:33 +0400
- Subject: Re: [PATCH] Don't check PST is NULL in read_symtab
- References: <1357869440-23451-1-git-send-email-yao@codesourcery.com>
> The "method" read_symtab of 'struct partial_symtab" is called in this
> way,
>
> (*pst->read_symtab) (objfile, pst);
>
> so argument PST can't be NULL.
I confirmed it using a quick grep.
> I'll re-indent dwarf2_psymtab_to_symtab when check this patch in.
FWIW, you can also do the re-indent, and then post two parallel
patches: One is the actual patch, the second is a sub-part of
the actual patch where whitespace differences are ignored.
That's usually how I verify that my reformatting did not cause
any intentional changes...
> 2013-01-11 Yao Qi <yao@codesourcery.com>
>
> * dbxread.c (dbx_psymtab_to_symtab_1): Don't check PST is NULL.
> * dwarf2read.c (dwarf2_psymtab_to_symtab): Likewise.
> * mdebugread.c (mdebug_psymtab_to_symtab): Likewise.
> * xcoffread.c (xcoff_psymtab_to_symtab_1): Likewise.
If PST must not be NULL, I think that it should be documented in
psympriv.h. I am also wondering whether an assertion would be
useful or not; maybe not, just thinking out loud.
Tom and Doug are more involved in this area, so they'll probably
have a more definitive answer.
--
Joel