diff options
author | Tom Tromey <tom@tromey.com> | 2018-05-10 16:23:44 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-01-10 07:08:10 -0700 |
commit | baa62830ed84d45b414ff677b7bce900a21923ce (patch) | |
tree | c6bcf23339cd0deca2a1e76d9e0682a0125fed7b /gdb | |
parent | 0e8f53badb3df16f4104890395d9324a5bcf568d (diff) | |
download | gdb-baa62830ed84d45b414ff677b7bce900a21923ce.zip gdb-baa62830ed84d45b414ff677b7bce900a21923ce.tar.gz gdb-baa62830ed84d45b414ff677b7bce900a21923ce.tar.bz2 |
Remove some unneeded psymtab initializations
allocate_psymtab has long cleared the new psymtab that is returned.
This patch documents this behavior and then removes some redundant
initializations.
gdb/ChangeLog
2019-01-10 Tom Tromey <tom@tromey.com>
* xcoffread.c (xcoff_end_psymtab): Remove some initializations.
* psymtab.c (allocate_psymtab): Add comment.
* psympriv.h (allocate_psymtab): Add comment.
* dwarf2read.c (dwarf2_create_include_psymtab): Remove some
initializations.
* dbxread.c (dbx_end_psymtab): Remove some initializations.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 9 | ||||
-rw-r--r-- | gdb/dbxread.c | 7 | ||||
-rw-r--r-- | gdb/dwarf2read.c | 6 | ||||
-rw-r--r-- | gdb/psympriv.h | 10 | ||||
-rw-r--r-- | gdb/psymtab.c | 2 | ||||
-rw-r--r-- | gdb/xcoffread.c | 7 |
6 files changed, 19 insertions, 22 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index dc64607..99b5afd 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,14 @@ 2019-01-10 Tom Tromey <tom@tromey.com> + * xcoffread.c (xcoff_end_psymtab): Remove some initializations. + * psymtab.c (allocate_psymtab): Add comment. + * psympriv.h (allocate_psymtab): Add comment. + * dwarf2read.c (dwarf2_create_include_psymtab): Remove some + initializations. + * dbxread.c (dbx_end_psymtab): Remove some initializations. + +2019-01-10 Tom Tromey <tom@tromey.com> + * symfile.h (mdebug_build_psymtabs, elfmdebug_build_psymtabs): Don't declare. * mipsread.c: Include mdebugread.h. diff --git a/gdb/dbxread.c b/gdb/dbxread.c index e3a9520..743fced 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -2057,13 +2057,6 @@ dbx_end_psymtab (struct objfile *objfile, struct partial_symtab *pst, subpst->dependencies[0] = pst; subpst->number_of_dependencies = 1; - subpst->globals_offset = - subpst->n_global_syms = - subpst->statics_offset = - subpst->n_static_syms = 0; - - subpst->readin = 0; - subpst->compunit_symtab = 0; subpst->read_symtab = pst->read_symtab; } diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index ddf07f1..40d173a 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -6592,13 +6592,7 @@ dwarf2_create_include_psymtab (const char *name, struct partial_symtab *pst, subpst->dependencies[0] = pst; subpst->number_of_dependencies = 1; - subpst->globals_offset = 0; - subpst->n_global_syms = 0; - subpst->statics_offset = 0; - subpst->n_static_syms = 0; - subpst->compunit_symtab = NULL; subpst->read_symtab = pst->read_symtab; - subpst->readin = 0; /* No private part is necessary for include psymtabs. This property can be used to differentiate between such include psymtabs and diff --git a/gdb/psympriv.h b/gdb/psympriv.h index e28adfe..76893f2 100644 --- a/gdb/psympriv.h +++ b/gdb/psympriv.h @@ -290,8 +290,14 @@ extern struct partial_symtab *start_psymtab_common (struct objfile *, extern void end_psymtab_common (struct objfile *, struct partial_symtab *); -extern struct partial_symtab *allocate_psymtab (const char *, - struct objfile *) +/* Allocate a new partial symbol table associated with OBJFILE. + FILENAME (which must be non-NULL) is the filename of this partial + symbol table; it is copied into the appropriate storage. A new + partial symbol table is returned; aside from "next" and "filename", + its fields are initialized to zero. */ + +extern struct partial_symtab *allocate_psymtab (const char *filename, + struct objfile *objfile) ATTRIBUTE_NONNULL (1); extern void discard_psymtab (struct objfile *, struct partial_symtab *); diff --git a/gdb/psymtab.c b/gdb/psymtab.c index d5bd5b1..1a54ea9 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -1677,6 +1677,8 @@ init_psymbol_list (struct objfile *objfile, int total_symbols) objfile->static_psymbols.reserve (total_symbols / 10); } +/* See psympriv.h. */ + struct partial_symtab * allocate_psymtab (const char *filename, struct objfile *objfile) { diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index b8ab292..41ff583 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -2103,13 +2103,6 @@ xcoff_end_psymtab (struct objfile *objfile, struct partial_symtab *pst, subpst->dependencies[0] = pst; subpst->number_of_dependencies = 1; - subpst->globals_offset = - subpst->n_global_syms = - subpst->statics_offset = - subpst->n_static_syms = 0; - - subpst->readin = 0; - subpst->compunit_symtab = NULL; subpst->read_symtab = pst->read_symtab; } |