projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change section_offsets to a std::vector
[deliverable/binutils-gdb.git]
/
gdb
/
xcoffread.c
diff --git
a/gdb/xcoffread.c
b/gdb/xcoffread.c
index bc4877389b0f1ce7e0c84388298cdb1c2df39180..d0fa90e49fb6b670fd1f49fbc5656a14488c853d 100644
(file)
--- a/
gdb/xcoffread.c
+++ b/
gdb/xcoffread.c
@@
-1,5
+1,5
@@
/* Read AIX xcoff symbol tables and convert to internal format, for GDB.
/* Read AIX xcoff symbol tables and convert to internal format, for GDB.
- Copyright (C) 1986-20
19
Free Software Foundation, Inc.
+ Copyright (C) 1986-20
20
Free Software Foundation, Inc.
Derived from coffread.c, dbxread.c, and a lot of hacking.
Contributed by IBM Corporation.
Derived from coffread.c, dbxread.c, and a lot of hacking.
Contributed by IBM Corporation.
@@
-864,7
+864,7
@@
enter_line_range (struct subfile *subfile, unsigned beginoffset,
addr = (int_lnno.l_lnno
? int_lnno.l_addr.l_paddr
: read_symbol_nvalue (int_lnno.l_addr.l_symndx));
addr = (int_lnno.l_lnno
? int_lnno.l_addr.l_paddr
: read_symbol_nvalue (int_lnno.l_addr.l_symndx));
- addr +=
ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile))
;
+ addr +=
objfile->section_offsets[SECT_OFF_TEXT (objfile)]
;
if (addr < startaddr || (endaddr && addr >= endaddr))
return;
if (addr < startaddr || (endaddr && addr >= endaddr))
return;
@@
-1232,8
+1232,7
@@
read_xcoff_symtab (struct objfile *objfile, struct partial_symtab *pst)
}
file_start_addr =
}
file_start_addr =
- cs->c_value + ANOFFSET (objfile->section_offsets,
- SECT_OFF_TEXT (objfile));
+ cs->c_value + objfile->section_offsets[SECT_OFF_TEXT (objfile)];
file_end_addr = file_start_addr + CSECT_LEN (&main_aux);
if (cs->c_name && (cs->c_name[0] == '.' || cs->c_name[0] == '@'))
file_end_addr = file_start_addr + CSECT_LEN (&main_aux);
if (cs->c_name && (cs->c_name[0] == '.' || cs->c_name[0] == '@'))
@@
-1355,8
+1354,7
@@
read_xcoff_symtab (struct objfile *objfile, struct partial_symtab *pst)
case C_FCN:
if (strcmp (cs->c_name, ".bf") == 0)
{
case C_FCN:
if (strcmp (cs->c_name, ".bf") == 0)
{
- CORE_ADDR off = ANOFFSET (objfile->section_offsets,
- SECT_OFF_TEXT (objfile));
+ CORE_ADDR off = objfile->section_offsets[SECT_OFF_TEXT (objfile)];
bfd_coff_swap_aux_in (abfd, raw_auxptr, cs->c_type, cs->c_sclass,
0, cs->c_naux, &main_aux);
bfd_coff_swap_aux_in (abfd, raw_auxptr, cs->c_type, cs->c_sclass,
0, cs->c_naux, &main_aux);
@@
-1400,8
+1398,7
@@
read_xcoff_symtab (struct objfile *objfile, struct partial_symtab *pst)
NULL, cstk.start_addr,
(fcn_cs_saved.c_value
+ fcn_aux_saved.x_sym.x_misc.x_fsize
NULL, cstk.start_addr,
(fcn_cs_saved.c_value
+ fcn_aux_saved.x_sym.x_misc.x_fsize
- + ANOFFSET (objfile->section_offsets,
- SECT_OFF_TEXT (objfile))));
+ + objfile->section_offsets[SECT_OFF_TEXT (objfile)]));
within_function = 0;
}
break;
within_function = 0;
}
break;
@@
-1468,8
+1465,7
@@
read_xcoff_symtab (struct objfile *objfile, struct partial_symtab *pst)
depth++;
newobj = push_context (depth,
(cs->c_value
depth++;
newobj = push_context (depth,
(cs->c_value
- + ANOFFSET (objfile->section_offsets,
- SECT_OFF_TEXT (objfile))));
+ + objfile->section_offsets[SECT_OFF_TEXT (objfile)]));
}
else if (strcmp (cs->c_name, ".eb") == 0)
{
}
else if (strcmp (cs->c_name, ".eb") == 0)
{
@@
-1491,8
+1487,7
@@
read_xcoff_symtab (struct objfile *objfile, struct partial_symtab *pst)
cstk.old_blocks, NULL,
cstk.start_addr,
(cs->c_value
cstk.old_blocks, NULL,
cstk.start_addr,
(cs->c_value
- + ANOFFSET (objfile->section_offsets,
- SECT_OFF_TEXT (objfile))));
+ + objfile->section_offsets[SECT_OFF_TEXT (objfile)]));
}
*get_local_symbols () = cstk.locals;
}
}
*get_local_symbols () = cstk.locals;
}
@@
-1522,7
+1517,7
@@
read_xcoff_symtab (struct objfile *objfile, struct partial_symtab *pst)
}
#define SYMBOL_DUP(SYMBOL1, SYMBOL2) \
}
#define SYMBOL_DUP(SYMBOL1, SYMBOL2) \
- (SYMBOL2) =
XOBNEW (&objfile->objfile_obstack, struct symbol
); \
+ (SYMBOL2) =
new (&objfile->objfile_obstack) symbol (
); \
*(SYMBOL2) = *(SYMBOL1);
*(SYMBOL2) = *(SYMBOL1);
@@
-1554,7
+1549,7
@@
process_xcoff_symbol (struct coff_symbol *cs, struct objfile *objfile)
else
{
sec = secnum_to_section (cs->c_secnum, objfile);
else
{
sec = secnum_to_section (cs->c_secnum, objfile);
- off =
ANOFFSET (objfile->section_offsets, sec)
;
+ off =
objfile->section_offsets[sec]
;
}
name = cs->c_name;
}
name = cs->c_name;
@@
-1574,7
+1569,7
@@
process_xcoff_symbol (struct coff_symbol *cs, struct objfile *objfile)
will be patched with the type from its stab entry later on in
patch_block_stabs (), unless the file was compiled without -g. */
will be patched with the type from its stab entry later on in
patch_block_stabs (), unless the file was compiled without -g. */
-
SYMBOL_SET_LINKAGE_NAME (sym,
SYMNAME_ALLOC (name, symname_alloced));
+
sym->set_linkage_name (
SYMNAME_ALLOC (name, symname_alloced));
SYMBOL_TYPE (sym) = objfile_type (objfile)->nodebug_text_symbol;
SYMBOL_ACLASS_INDEX (sym) = LOC_BLOCK;
SYMBOL_TYPE (sym) = objfile_type (objfile)->nodebug_text_symbol;
SYMBOL_ACLASS_INDEX (sym) = LOC_BLOCK;
@@
-1657,8
+1652,7
@@
process_xcoff_symbol (struct coff_symbol *cs, struct objfile *objfile)
if (*pp == 'V' && !within_function)
*pp = 'S';
sym = define_symbol ((cs->c_value
if (*pp == 'V' && !within_function)
*pp = 'S';
sym = define_symbol ((cs->c_value
- + ANOFFSET (objfile->section_offsets,
- static_block_section)),
+ + objfile->section_offsets[static_block_section]),
cs->c_name, 0, 0, objfile);
if (sym != NULL)
{
cs->c_name, 0, 0, objfile);
if (sym != NULL)
{
@@
-2634,8
+2628,9
@@
scan_xcoff_symtab (minimal_symbol_reader &reader,
namestring = gdbarch_static_transform_name
(gdbarch, namestring);
namestring = gdbarch_static_transform_name
(gdbarch, namestring);
- add_psymbol_to_list (namestring, p - namestring, true,
- VAR_DOMAIN, LOC_STATIC,
+ add_psymbol_to_list (gdb::string_view (namestring,
+ p - namestring),
+ true, VAR_DOMAIN, LOC_STATIC,
SECT_OFF_DATA (objfile),
psymbol_placement::STATIC,
symbol.n_value,
SECT_OFF_DATA (objfile),
psymbol_placement::STATIC,
symbol.n_value,
@@
-2645,8
+2640,9
@@
scan_xcoff_symtab (minimal_symbol_reader &reader,
case 'G':
/* The addresses in these entries are reported to be
wrong. See the code that reads 'G's for symtabs. */
case 'G':
/* The addresses in these entries are reported to be
wrong. See the code that reads 'G's for symtabs. */
- add_psymbol_to_list (namestring, p - namestring, true,
- VAR_DOMAIN, LOC_STATIC,
+ add_psymbol_to_list (gdb::string_view (namestring,
+ p - namestring),
+ true, VAR_DOMAIN, LOC_STATIC,
SECT_OFF_DATA (objfile),
psymbol_placement::GLOBAL,
symbol.n_value,
SECT_OFF_DATA (objfile),
psymbol_placement::GLOBAL,
symbol.n_value,
@@
-2664,15
+2660,17
@@
scan_xcoff_symtab (minimal_symbol_reader &reader,
|| (p == namestring + 1
&& namestring[0] != ' '))
{
|| (p == namestring + 1
&& namestring[0] != ' '))
{
- add_psymbol_to_list (namestring, p - namestring, true,
- STRUCT_DOMAIN, LOC_TYPEDEF, -1,
+ add_psymbol_to_list (gdb::string_view (namestring,
+ p - namestring),
+ true, STRUCT_DOMAIN, LOC_TYPEDEF, -1,
psymbol_placement::STATIC,
0, psymtab_language, objfile);
if (p[2] == 't')
{
/* Also a typedef with the same name. */
psymbol_placement::STATIC,
0, psymtab_language, objfile);
if (p[2] == 't')
{
/* Also a typedef with the same name. */
- add_psymbol_to_list (namestring, p - namestring, true,
- VAR_DOMAIN, LOC_TYPEDEF, -1,
+ add_psymbol_to_list (gdb::string_view (namestring,
+ p - namestring),
+ true, VAR_DOMAIN, LOC_TYPEDEF, -1,
psymbol_placement::STATIC,
0, psymtab_language, objfile);
p += 1;
psymbol_placement::STATIC,
0, psymtab_language, objfile);
p += 1;
@@
-2683,8
+2681,9
@@
scan_xcoff_symtab (minimal_symbol_reader &reader,
case 't':
if (p != namestring) /* a name is there, not just :T... */
{
case 't':
if (p != namestring) /* a name is there, not just :T... */
{
- add_psymbol_to_list (namestring, p - namestring, true,
- VAR_DOMAIN, LOC_TYPEDEF, -1,
+ add_psymbol_to_list (gdb::string_view (namestring,
+ p - namestring),
+ true, VAR_DOMAIN, LOC_TYPEDEF, -1,
psymbol_placement::STATIC,
0, psymtab_language, objfile);
}
psymbol_placement::STATIC,
0, psymtab_language, objfile);
}
@@
-2745,7
+2744,7
@@
scan_xcoff_symtab (minimal_symbol_reader &reader,
;
/* Note that the value doesn't matter for
enum constants in psymtabs, just in symtabs. */
;
/* Note that the value doesn't matter for
enum constants in psymtabs, just in symtabs. */
- add_psymbol_to_list (
p, q - p
, true,
+ add_psymbol_to_list (
gdb::string_view (p, q - p)
, true,
VAR_DOMAIN, LOC_CONST, -1,
psymbol_placement::STATIC,
0, psymtab_language, objfile);
VAR_DOMAIN, LOC_CONST, -1,
psymbol_placement::STATIC,
0, psymtab_language, objfile);
@@
-2763,8
+2762,9
@@
scan_xcoff_symtab (minimal_symbol_reader &reader,
case 'c':
/* Constant, e.g. from "const" in Pascal. */
case 'c':
/* Constant, e.g. from "const" in Pascal. */
- add_psymbol_to_list (namestring, p - namestring, true,
- VAR_DOMAIN, LOC_CONST, -1,
+ add_psymbol_to_list (gdb::string_view (namestring,
+ p - namestring),
+ true, VAR_DOMAIN, LOC_CONST, -1,
psymbol_placement::STATIC,
0, psymtab_language, objfile);
continue;
psymbol_placement::STATIC,
0, psymtab_language, objfile);
continue;
@@
-2780,8
+2780,9
@@
scan_xcoff_symtab (minimal_symbol_reader &reader,
function_outside_compilation_unit_complaint (name);
xfree (name);
}
function_outside_compilation_unit_complaint (name);
xfree (name);
}
- add_psymbol_to_list (namestring, p - namestring, true,
- VAR_DOMAIN, LOC_BLOCK,
+ add_psymbol_to_list (gdb::string_view (namestring,
+ p - namestring),
+ true, VAR_DOMAIN, LOC_BLOCK,
SECT_OFF_TEXT (objfile),
psymbol_placement::STATIC,
symbol.n_value,
SECT_OFF_TEXT (objfile),
psymbol_placement::STATIC,
symbol.n_value,
@@
-2810,8
+2811,9
@@
scan_xcoff_symtab (minimal_symbol_reader &reader,
if (startswith (namestring, "@FIX"))
continue;
if (startswith (namestring, "@FIX"))
continue;
- add_psymbol_to_list (namestring, p - namestring, true,
- VAR_DOMAIN, LOC_BLOCK,
+ add_psymbol_to_list (gdb::string_view (namestring,
+ p - namestring),
+ true, VAR_DOMAIN, LOC_BLOCK,
SECT_OFF_TEXT (objfile),
psymbol_placement::GLOBAL,
symbol.n_value,
SECT_OFF_TEXT (objfile),
psymbol_placement::GLOBAL,
symbol.n_value,
@@
-3016,7
+3018,7
@@
xcoff_symfile_offsets (struct objfile *objfile,
us to test whether the associated section exists or not, and then
access it quickly (without searching it again). */
us to test whether the associated section exists or not, and then
access it quickly (without searching it again). */
- if (objfile->
num_sections == 0
)
+ if (objfile->
section_offsets.empty ()
)
return; /* Is that even possible? Better safe than sorry. */
first_section_name = bfd_section_name (objfile->sections[0].the_bfd_section);
return; /* Is that even possible? Better safe than sorry. */
first_section_name = bfd_section_name (objfile->sections[0].the_bfd_section);
This page took
0.028227 seconds
and
4
git commands to generate.