/* DWARF 2 debugging format support for GDB.
- Copyright (C) 1994-2018 Free Software Foundation, Inc.
+ Copyright (C) 1994-2019 Free Software Foundation, Inc.
Adapted by Gary Funck (gary@intrepid.com), Intrepid Technology,
Inc. with support from Florida State University (under contract
struct dwarf2_per_objfile *dwarf2_per_objfile
= get_dwarf2_per_objfile (objfile);
- if (objfile->global_psymbols.capacity () == 0
- && objfile->static_psymbols.capacity () == 0)
- init_psymbol_list (objfile, 1024);
+ init_psymbol_list (objfile, 1024);
TRY
{
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
struct objfile *objfile = per_cu->dwarf2_per_objfile->objfile;
struct partial_symtab *pst;
- pst = start_psymtab_common (objfile, name, 0,
- objfile->global_psymbols,
- objfile->static_psymbols);
+ pst = start_psymtab_common (objfile, name, 0);
pst->psymtabs_addrmap_supported = 1;
built_actual_name != NULL,
VAR_DOMAIN, LOC_BLOCK,
SECT_OFF_TEXT (objfile),
- &objfile->global_psymbols,
+ psymbol_placement::GLOBAL,
addr,
cu->language, objfile);
}
built_actual_name != NULL,
VAR_DOMAIN, LOC_BLOCK,
SECT_OFF_TEXT (objfile),
- &objfile->static_psymbols,
+ psymbol_placement::STATIC,
addr, cu->language, objfile);
}
set_objfile_main_name (objfile, actual_name, cu->language);
break;
case DW_TAG_constant:
- {
- std::vector<partial_symbol *> *list;
-
- if (pdi->is_external)
- list = &objfile->global_psymbols;
- else
- list = &objfile->static_psymbols;
- add_psymbol_to_list (actual_name, strlen (actual_name),
- built_actual_name != NULL, VAR_DOMAIN, LOC_STATIC,
- -1, list, 0, cu->language, objfile);
- }
+ add_psymbol_to_list (actual_name, strlen (actual_name),
+ built_actual_name != NULL, VAR_DOMAIN, LOC_STATIC,
+ -1, (pdi->is_external
+ ? psymbol_placement::GLOBAL
+ : psymbol_placement::STATIC),
+ 0, cu->language, objfile);
break;
case DW_TAG_variable:
if (pdi->d.locdesc)
built_actual_name != NULL,
VAR_DOMAIN, LOC_STATIC,
SECT_OFF_TEXT (objfile),
- &objfile->global_psymbols,
+ psymbol_placement::GLOBAL,
addr, cu->language, objfile);
}
else
built_actual_name != NULL,
VAR_DOMAIN, LOC_STATIC,
SECT_OFF_TEXT (objfile),
- &objfile->static_psymbols,
+ psymbol_placement::STATIC,
has_loc ? addr : 0,
cu->language, objfile);
}
add_psymbol_to_list (actual_name, strlen (actual_name),
built_actual_name != NULL,
VAR_DOMAIN, LOC_TYPEDEF, -1,
- &objfile->static_psymbols,
+ psymbol_placement::STATIC,
0, cu->language, objfile);
break;
case DW_TAG_imported_declaration:
add_psymbol_to_list (actual_name, strlen (actual_name),
built_actual_name != NULL,
VAR_DOMAIN, LOC_TYPEDEF, -1,
- &objfile->global_psymbols,
+ psymbol_placement::GLOBAL,
0, cu->language, objfile);
break;
case DW_TAG_module:
add_psymbol_to_list (actual_name, strlen (actual_name),
built_actual_name != NULL,
MODULE_DOMAIN, LOC_TYPEDEF, -1,
- &objfile->global_psymbols,
+ psymbol_placement::GLOBAL,
0, cu->language, objfile);
break;
case DW_TAG_class_type:
built_actual_name != NULL,
STRUCT_DOMAIN, LOC_TYPEDEF, -1,
cu->language == language_cplus
- ? &objfile->global_psymbols
- : &objfile->static_psymbols,
+ ? psymbol_placement::GLOBAL
+ : psymbol_placement::STATIC,
0, cu->language, objfile);
break;
built_actual_name != NULL,
VAR_DOMAIN, LOC_CONST, -1,
cu->language == language_cplus
- ? &objfile->global_psymbols
- : &objfile->static_psymbols,
+ ? psymbol_placement::GLOBAL
+ : psymbol_placement::STATIC,
0, cu->language, objfile);
break;
default:
if (building_psymtab && pdi.name != NULL)
add_psymbol_to_list (pdi.name, strlen (pdi.name), 0,
VAR_DOMAIN, LOC_TYPEDEF, -1,
- &objfile->static_psymbols,
+ psymbol_placement::STATIC,
0, cu->language, objfile);
info_ptr = locate_pdi_sibling (reader, &pdi, info_ptr);
continue;
add_psymbol_to_list (pdi.name, strlen (pdi.name), 0,
VAR_DOMAIN, LOC_CONST, -1,
cu->language == language_cplus
- ? &objfile->global_psymbols
- : &objfile->static_psymbols,
+ ? psymbol_placement::GLOBAL
+ : psymbol_placement::STATIC,
0, cu->language, objfile);
info_ptr = locate_pdi_sibling (reader, &pdi, info_ptr);
{
struct dwarf2_per_cu_data *this_cu;
int low, high;
- const sect_offset *cu_off;
low = 0;
high = dwarf2_per_objfile->all_comp_units.size () - 1;
int mid = low + (high - low) / 2;
mid_cu = dwarf2_per_objfile->all_comp_units[mid];
- cu_off = &mid_cu->sect_off;
if (mid_cu->is_dwz > offset_in_dwz
|| (mid_cu->is_dwz == offset_in_dwz
- && *cu_off + mid_cu->length >= sect_off))
+ && mid_cu->sect_off + mid_cu->length >= sect_off))
high = mid;
else
low = mid + 1;
}
gdb_assert (low == high);
this_cu = dwarf2_per_objfile->all_comp_units[low];
- cu_off = &this_cu->sect_off;
- if (this_cu->is_dwz != offset_in_dwz || *cu_off > sect_off)
+ if (this_cu->is_dwz != offset_in_dwz || this_cu->sect_off > sect_off)
{
if (low == 0 || this_cu->is_dwz != offset_in_dwz)
error (_("Dwarf Error: could not find partial DIE containing "