[RFA] remove free_contents

Doug Evans dje@google.com
Thu Apr 3 18:13:00 GMT 2008


Hi.

symtab.h contains this:

struct general_symbol_info
{
 /* Name of the symbol.  This is a required field.  Storage for the
    name is allocated on the objfile_obstack for the associated
    objfile.  ...  */

 char *name;

[...]

#define DEPRECATED_SYMBOL_NAME(symbol)  (symbol)->ginfo.name

but symmisc.c does this:

static void
free_symtab_block (struct objfile *objfile, struct block *b)
{
 [...]
     xfree (DEPRECATED_SYMBOL_NAME (sym));
 [...]
}

Either the comment is incomplete (i.e. some names are not allocated
on an objfile_obstack), or the code is wrong (or in this case, outdated).

There's a FIXME that says free_symtab_block is likely never used
and that is the case.  free_contents is never used, which
is how free_symtab_block would get called.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gdb-080403-free-contents.patch
Type: text/x-patch
Size: 3623 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20080403/5f5f89ee/attachment.bin>


More information about the Gdb-patches mailing list