This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH/ob] unify objfile obstacks(2/4)
- From: Elena Zannoni <ezannoni at redhat dot com>
- To: mec dot gnu at mindspring dot com (Michael Elizabeth Chastain)
- Cc: ezannoni at redhat dot com, gdb-patches at sources dot redhat dot com
- Date: Sat, 7 Feb 2004 18:21:07 -0500
- Subject: Re: [PATCH/ob] unify objfile obstacks(2/4)
- References: <20040207023425.40A0D4B364@berman.michael-chastain.com>
Michael Elizabeth Chastain writes:
> This comment in dbxread.c seems a bit wack now:
>
> - /* Read the string table and stash it away in the psymbol_obstack. It is
> + /* Read the string table and stash it away in the objfile_obstack. It is
> only needed as long as we need to expand psymbols into full symbols,
> so when we blow away the psymbol the string table goes away as well.
>
> The psymbols are going to have the same lifetime as the symbols,
> so talking about blowing away the psymbols seems weird.
>
Yes true, however we never did blow away the psymbols. The obstacks
always had the same lifetime. I.e. the comment was a bit weird to
start with. I'll clean that up though.
here:
Index: dbxread.c
===================================================================
RCS file: /cvs/src/src/gdb/dbxread.c,v
retrieving revision 1.62
diff -u -p -r1.62 dbxread.c
--- dbxread.c 9 Jan 2004 16:26:17 -0000 1.62
+++ dbxread.c 7 Feb 2004 17:21:36 -0000
@@ -651,14 +651,13 @@ dbx_symfile_init (struct objfile *objfil
DBX_SYMCOUNT (objfile) = bfd_get_symcount (sym_bfd);
DBX_SYMTAB_OFFSET (objfile) = SYMBOL_TABLE_OFFSET;
- /* Read the string table and stash it away in the psymbol_obstack. It is
- only needed as long as we need to expand psymbols into full symbols,
- so when we blow away the psymbol the string table goes away as well.
+ /* Read the string table and stash it away in the objfile_obstack.
+ When we blow away the objfile the string table goes away as well.
Note that gdb used to use the results of attempting to malloc the
string table, based on the size it read, as a form of sanity check
[....]
all in now.