diff options
author | Tom Tromey <tom@tromey.com> | 2018-05-10 16:23:46 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-01-10 07:08:11 -0700 |
commit | 75aedd27e6a2c58734ab44cc7cad8491f19d059a (patch) | |
tree | 6208568d9314888fffc6755303e953fa4064090a /gdb/psymtab.c | |
parent | 939652a515a10654b16b97e7e2ea39c013714850 (diff) | |
download | gdb-75aedd27e6a2c58734ab44cc7cad8491f19d059a.zip gdb-75aedd27e6a2c58734ab44cc7cad8491f19d059a.tar.gz gdb-75aedd27e6a2c58734ab44cc7cad8491f19d059a.tar.bz2 |
Change add_psymbol_to_list to use an enum
This changes add_psymbol_to_list to use an enum, rather than a pointer
to a vector, to decide where to put the new symbol. This reduces the
number of direct references to the static_psymbols and global_psymbols
members of the objfile, which is handy in a later patch.
gdb/ChangeLog
2019-01-10 Tom Tromey <tom@tromey.com>
* xcoffread.c (scan_xcoff_symtab): Update.
* psymtab.c (add_psymbol_to_list): Replace "list" parameter with
"where".
* mdebugread.c (parse_partial_symbols)
(handle_psymbol_enumerators): Update.
* dwarf2read.c (add_partial_symbol, load_partial_dies): Update.
* dbxread.c (read_dbx_symtab): Update.
* psympriv.h (psymbol_placement): New enum.
(add_psymbol_to_list): Update.
Diffstat (limited to 'gdb/psymtab.c')
-rw-r--r-- | gdb/psymtab.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gdb/psymtab.c b/gdb/psymtab.c index 8e46786..ddb8e76 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -1638,7 +1638,7 @@ add_psymbol_to_list (const char *name, int namelength, int copy_name, domain_enum domain, enum address_class theclass, short section, - std::vector<partial_symbol *> *list, + psymbol_placement where, CORE_ADDR coreaddr, enum language language, struct objfile *objfile) { @@ -1651,11 +1651,14 @@ add_psymbol_to_list (const char *name, int namelength, int copy_name, section, coreaddr, language, objfile, &added); /* Do not duplicate global partial symbols. */ - if (list == &objfile->global_psymbols - && !added) + if (where == psymbol_placement::GLOBAL && !added) return; /* Save pointer to partial symbol in psymtab, growing symtab if needed. */ + std::vector<partial_symbol *> *list + = (where == psymbol_placement::STATIC + ? &objfile->static_psymbols + : &objfile->global_psymbols); append_psymbol_to_list (list, psym, objfile); } |