This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* This module provides three functions: dbx_symfile_init,
which initializes to read a symbol file; dbx_new_init, which
do_cleanups (back_to);
}
-#ifdef SOFUN_ADDRESS_MAYBE_MISSING
static CORE_ADDR
find_stab_function_addr (char *namestring, char *filename,
struct objfile *objfile)
return msym == NULL ? 0 : SYMBOL_VALUE_ADDRESS (msym);
}
-#endif /* SOFUN_ADDRESS_MAYBE_MISSING */
static void
function_outside_compilation_unit_complaint (const char *arg1)
prev_textlow_not_set = textlow_not_set;
-#ifdef SOFUN_ADDRESS_MAYBE_MISSING
/* A zero value is probably an indication for the SunPRO 3.0
compiler. end_psymtab explicitly tests for zero, so
don't relocate it. */
- if (nlist.n_value == 0)
+ if (nlist.n_value == 0
+ && gdbarch_sofun_address_maybe_missing (current_gdbarch))
{
textlow_not_set = 1;
valu = 0;
}
else
textlow_not_set = 0;
-#else
- textlow_not_set = 0;
-#endif
+
past_first_source_file = 1;
if (prev_so_symnum != symnum - 1)
{
case 'S':
nlist.n_value += ANOFFSET (objfile->section_offsets, data_sect_index);
-#ifdef STATIC_TRANSFORM_NAME
- namestring = STATIC_TRANSFORM_NAME (namestring);
-#endif
+
+ if (gdbarch_static_transform_name_p (current_gdbarch))
+ namestring = gdbarch_static_transform_name
+ (current_gdbarch, namestring);
+
add_psymbol_to_list (namestring, p - namestring,
VAR_DOMAIN, LOC_STATIC,
&objfile->static_psymbols,
SECT_OFF_TEXT (objfile));
/* Kludges for ELF/STABS with Sun ACC */
last_function_name = namestring;
-#ifdef SOFUN_ADDRESS_MAYBE_MISSING
/* Do not fix textlow==0 for .o or NLM files, as 0 is a legit
value for the bottom of the text seg in those cases. */
if (nlist.n_value == ANOFFSET (objfile->section_offsets,
- SECT_OFF_TEXT (objfile)))
+ SECT_OFF_TEXT (objfile))
+ && gdbarch_sofun_address_maybe_missing (current_gdbarch))
{
CORE_ADDR minsym_valu =
find_stab_function_addr (namestring,
if (minsym_valu != 0)
nlist.n_value = minsym_valu;
}
- if (pst && textlow_not_set)
+ if (pst && textlow_not_set
+ && gdbarch_sofun_address_maybe_missing (current_gdbarch))
{
pst->textlow = nlist.n_value;
textlow_not_set = 0;
}
-#endif
/* End kludge. */
/* Keep track of the start of the last function so we
SECT_OFF_TEXT (objfile));
/* Kludges for ELF/STABS with Sun ACC */
last_function_name = namestring;
-#ifdef SOFUN_ADDRESS_MAYBE_MISSING
/* Do not fix textlow==0 for .o or NLM files, as 0 is a legit
value for the bottom of the text seg in those cases. */
if (nlist.n_value == ANOFFSET (objfile->section_offsets,
- SECT_OFF_TEXT (objfile)))
+ SECT_OFF_TEXT (objfile))
+ && gdbarch_sofun_address_maybe_missing (current_gdbarch))
{
CORE_ADDR minsym_valu =
find_stab_function_addr (namestring,
if (minsym_valu != 0)
nlist.n_value = minsym_valu;
}
- if (pst && textlow_not_set)
+ if (pst && textlow_not_set
+ && gdbarch_sofun_address_maybe_missing (current_gdbarch))
{
pst->textlow = nlist.n_value;
textlow_not_set = 0;
}
-#endif
/* End kludge. */
/* Keep track of the start of the last function so we
continue;
case N_ENDM:
-#ifdef SOFUN_ADDRESS_MAYBE_MISSING
/* Solaris 2 end of module, finish current partial symbol table.
end_psymtab will set pst->texthigh to the proper value, which
is necessary if a module compiled without debugging info
follows this module. */
- if (pst)
+ if (pst && gdbarch_sofun_address_maybe_missing (current_gdbarch))
{
end_psymtab (pst, psymtab_include_list, includes_used,
symnum * symbol_size,
includes_used = 0;
dependencies_used = 0;
}
-#endif
continue;
case N_RBRAC:
LDSYMLEN (pst) = capping_symbol_offset - LDSYMOFF (pst);
pst->texthigh = capping_text;
-#ifdef SOFUN_ADDRESS_MAYBE_MISSING
/* Under Solaris, the N_SO symbols always have a value of 0,
instead of the usual address of the .o file. Therefore,
we have to do some tricks to fill in texthigh and textlow.
a reliable texthigh by taking the address plus size of the
last function in the file. */
- if (pst->texthigh == 0 && last_function_name)
+ if (pst->texthigh == 0 && last_function_name
+ && gdbarch_sofun_address_maybe_missing (current_gdbarch))
{
char *p;
int n;
last_function_name = NULL;
}
+ if (!gdbarch_sofun_address_maybe_missing (current_gdbarch))
+ ;
/* this test will be true if the last .o file is only data */
- if (textlow_not_set)
+ else if (textlow_not_set)
pst->textlow = pst->texthigh;
else
{
}
/* End of kludge for patching Solaris textlow and texthigh. */
-#endif /* SOFUN_ADDRESS_MAYBE_MISSING. */
pst->n_global_syms =
objfile->global_psymbols.next - (objfile->global_psymbols.list + pst->globals_offset);
if (desc != new->depth)
lbrac_mismatch_complaint (symnum);
- /* Some compilers put the variable decls inside of an
- LBRAC/RBRAC block. This macro should be nonzero if this is
- true. DESC is N_DESC from the N_RBRAC symbol. GCC_P is true
- if we've detected the GCC_COMPILED_SYMBOL or the
- GCC2_COMPILED_SYMBOL. */
-#if !defined (VARIABLES_INSIDE_BLOCK)
-#define VARIABLES_INSIDE_BLOCK(desc, gcc_p) 0
-#endif
-
- /* Can only use new->locals as local symbols here if we're in
- GCC or on a machine that puts them before the lbrack. */
- if (!VARIABLES_INSIDE_BLOCK (desc, processing_gcc_compilation))
+ if (local_symbols != NULL)
{
- if (local_symbols != NULL)
- {
- /* GCC development snapshots from March to December of
- 2000 would output N_LSYM entries after N_LBRAC
- entries. As a consequence, these symbols are simply
- discarded. Complain if this is the case. Note that
- there are some compilers which legitimately put local
- symbols within an LBRAC/RBRAC block; this complaint
- might also help sort out problems in which
- VARIABLES_INSIDE_BLOCK is incorrectly defined. */
- complaint (&symfile_complaints, _("\
+ /* GCC development snapshots from March to December of
+ 2000 would output N_LSYM entries after N_LBRAC
+ entries. As a consequence, these symbols are simply
+ discarded. Complain if this is the case. */
+ complaint (&symfile_complaints, _("\
misplaced N_LBRAC entry; discarding local symbols which have \
no enclosing block"));
- }
- local_symbols = new->locals;
}
+ local_symbols = new->locals;
- if (context_stack_depth
- > !VARIABLES_INSIDE_BLOCK (desc, processing_gcc_compilation))
+ if (context_stack_depth > 1)
{
/* This is not the outermost LBRAC...RBRAC pair in the
function, its local symbols preceded it, and are the ones
within_function = 0;
}
- if (VARIABLES_INSIDE_BLOCK (desc, processing_gcc_compilation))
- /* Now pop locals of block just finished. */
- local_symbols = new->locals;
break;
case N_FN:
case 'F':
function_stab_type = type;
-#ifdef SOFUN_ADDRESS_MAYBE_MISSING
/* Deal with the SunPRO 3.0 compiler which omits the
address from N_FUN symbols. */
if (type == N_FUN
&& valu == ANOFFSET (section_offsets,
- SECT_OFF_TEXT (objfile)))
+ SECT_OFF_TEXT (objfile))
+ && gdbarch_sofun_address_maybe_missing (current_gdbarch))
{
CORE_ADDR minsym_valu =
find_stab_function_addr (name, last_source_file, objfile);
if (minsym_valu != 0)
valu = minsym_valu;
}
-#endif
if (block_address_function_relative)
/* For Solaris 2 compilers, the block addresses and
default_symfile_offsets, /* sym_offsets: parse user's offsets to internal form */
default_symfile_segments, /* sym_segments: Get segment information from
a file. */
+ NULL, /* sym_read_linetable */
NULL /* next: pointer to next struct sym_fns */
};