diff options
author | Simon Marchi <simon.marchi@ericsson.com> | 2017-10-14 08:06:29 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@ericsson.com> | 2017-10-14 08:07:46 -0400 |
commit | af5bf4ada48ff65b6658be1fab8f9c8f8ab5f319 (patch) | |
tree | 2b2cc8c87a4971598ab6f4b6934e5e58c7083f7b /gdb/dwarf2read.c | |
parent | 3ec5942fbf8501db10784b0dff7d24222a113728 (diff) | |
download | gdb-af5bf4ada48ff65b6658be1fab8f9c8f8ab5f319.zip gdb-af5bf4ada48ff65b6658be1fab8f9c8f8ab5f319.tar.gz gdb-af5bf4ada48ff65b6658be1fab8f9c8f8ab5f319.tar.bz2 |
Replace psymbol_allocation_list with std::vector
psymbol_allocation_list is basically a vector implementation. We can
replace it with an std::vector, now that objfile has been C++-ified.
I sent this to the buildbot, there are a few suspicious failures, but
I don't think they are related to this patch. For example on powerpc:
new FAIL: gdb.base/catch-syscall.exp: execve: syscall execve has returned
new FAIL: gdb.base/catch-syscall.exp: execve: continue to main
new FAIL: gdb.base/catch-syscall.exp: execve: continue until exit
I get the same failures when testing manually on gcc112, without this
patch.
gdb/ChangeLog:
* objfiles.h: Don't include symfile.h.
(struct partial_symbol): Remove forward-declaration.
(struct objfile) <global_psymbols, static_psymbols>: Change type
to std::vector<partial_symbol *>.
* objfiles.c (objfile::objfile): Don't memset those fields.
(objfile::~objfile): Don't free those fields.
* psympriv.h (struct psymbol_allocation_list): Remove
forward-declaration.
(add_psymbol_to_list): Change psymbol_allocation_list parameter
to std::vector.
(start_psymtab_common): Change parameters to std::vector.
* psymtab.c: Include algorithm.
(require_partial_symbols): Call shrink_to_fit.
(find_pc_sect_psymbol): Adjust to vector change.
(match_partial_symbol): Likewise.
(lookup_partial_symbol): Likewise.
(psym_relocate): Likewise.
(dump_psymtab): Likewise.
(recursively_search_psymtabs): Likewise.
(compare_psymbols): Remove.
(sort_pst_symbols): Adjust to vector change.
(start_psymtab_common): Likewise.
(end_psymtab_common): Likewise.
(psymbol_bcache_full): De-constify return value.
(add_psymbol_to_bcache): Likewise.
(extend_psymbol_list): Remove.
(append_psymbol_to_list): Adjust to vector change.
(add_psymbol_to_list): Likewise.
(init_psymbol_list): Likewise.
(maintenance_info_psymtabs): Likewise.
(maintenance_check_psymtabs): Likewise.
* symfile.h (struct psymbol_allocation_list): Remove.
* symfile.c (reread_symbols): Adjust to vector change.
* dbxread.c (start_psymtab): Change type of parameters.
(dbx_symfile_read): Adjust to vector change.
(read_dbx_symtab): Likewise.
(start_psymtab): Change type of parameters.
* dwarf2read.c (dwarf2_build_psymtabs): Adjust to vector change.
(create_partial_symtab): Likewise.
(add_partial_symbol): Likewise.
(write_one_signatured_type): Likewise.
(recursively_write_psymbols): Likewise.
* mdebugread.c (parse_partial_symbols): Likewise.
* xcoffread.c (xcoff_start_psymtab): Change type of parameters.
(scan_xcoff_symtab): Adjust to vector change.
(xcoff_initial_scan): Likewise.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r-- | gdb/dwarf2read.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 979dae2..af4bb64 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -4456,10 +4456,9 @@ void dwarf2_build_psymtabs (struct objfile *objfile) { - if (objfile->global_psymbols.size == 0 && objfile->static_psymbols.size == 0) - { - init_psymbol_list (objfile, 1024); - } + if (objfile->global_psymbols.capacity () == 0 + && objfile->static_psymbols.capacity () == 0) + init_psymbol_list (objfile, 1024); TRY { @@ -6143,8 +6142,8 @@ create_partial_symtab (struct dwarf2_per_cu_data *per_cu, const char *name) struct partial_symtab *pst; pst = start_psymtab_common (objfile, name, 0, - objfile->global_psymbols.next, - objfile->static_psymbols.next); + objfile->global_psymbols, + objfile->static_psymbols); pst->psymtabs_addrmap_supported = 1; @@ -7166,7 +7165,7 @@ add_partial_symbol (struct partial_die_info *pdi, struct dwarf2_cu *cu) break; case DW_TAG_constant: { - struct psymbol_allocation_list *list; + std::vector<partial_symbol *> *list; if (pdi->is_external) list = &objfile->global_psymbols; @@ -23732,14 +23731,12 @@ write_one_signatured_type (void **slot, void *d) write_psymbols (info->symtab, info->psyms_seen, - info->objfile->global_psymbols.list - + psymtab->globals_offset, + &info->objfile->global_psymbols[psymtab->globals_offset], psymtab->n_global_syms, info->cu_index, 0); write_psymbols (info->symtab, info->psyms_seen, - info->objfile->static_psymbols.list - + psymtab->statics_offset, + &info->objfile->static_psymbols[psymtab->statics_offset], psymtab->n_static_syms, info->cu_index, 1); @@ -23789,12 +23786,12 @@ recursively_write_psymbols (struct objfile *objfile, write_psymbols (symtab, psyms_seen, - objfile->global_psymbols.list + psymtab->globals_offset, + &objfile->global_psymbols[psymtab->globals_offset], psymtab->n_global_syms, cu_index, 0); write_psymbols (symtab, psyms_seen, - objfile->static_psymbols.list + psymtab->statics_offset, + &objfile->static_psymbols[psymtab->statics_offset], psymtab->n_static_syms, cu_index, 1); } |