aboutsummaryrefslogtreecommitdiff
path: root/gdb/dbxread.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2007-10-19 12:26:35 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2007-10-19 12:26:35 +0000
commit203c3895a5003367e77494ca9428446417fce1bc (patch)
tree3bf4251bc1ca88b89716661d8c1c7ec00c84157a /gdb/dbxread.c
parent149ad273c520ca22c19edc35f054fd05fe6cc6e7 (diff)
downloadgdb-203c3895a5003367e77494ca9428446417fce1bc.zip
gdb-203c3895a5003367e77494ca9428446417fce1bc.tar.gz
gdb-203c3895a5003367e77494ca9428446417fce1bc.tar.bz2
* gdbarch.sh (sofun_address_maybe_missing): New gdbarch variable.
* gdbarch.c, gdbarch.h: Regenerate. * dbxread.c (find_stab_function_addr): Define unconditionally. (read_dbx_symtab): Use gdbarch_sofun_address_maybe_missing instead of SOFUN_ADDRESS_MAYBE_MISSING. (end_psymtab): Likewise. (process_one_symbol): Likewise. * mdebugread.c (parse_partial_symbols): Likewise. * symtab.h (struct minimal_symbol): Always define "filename" member. * elfread.c (elf_symtab_read): Use msym->filename unconditionally. * minsyms.c (lookup_minimal_symbol): Likewise. * symmisc.c (dump_msymbols): Likewise. * config/i386/i386sol2.mt (DEPRECATED_TM_FILE): Remove. * config/i386/linux.mt (DEPRECATED_TM_FILE): Remove. * config/i386/tm-i386sol2.h: Remove file. * config/i386/tm-linux.h: Remove file. * i386-linux-tdep.c (i386_linux_init_abi): Add call to set_gdbarch_sofun_address_maybe_missing. * i386-sol2-tdep.c (i386_sol2_init_abi): Likewise. * config/powerpc/linux.mt (DEPRECATED_TM_FILE): Remove. * config/powerpc/nbsd.mt (DEPRECATED_TM_FILE): Remove. * config/powerpc/obsd.mt (DEPRECATED_TM_FILE): Remove. * config/powerpc/ppc-eabi.mt (DEPRECATED_TM_FILE): Remove. * config/powerpc/ppc-sim.mt (DEPRECATED_TM_FILE): Remove. * config/powerpc/tm-ppc-eabi.h: Remove file. * rs6000-tdep.c (rs6000_gdbarch_init): Add call to set_gdbarch_sofun_address_maybe_missing. * config/sparc/sol2-64.mt (DEPRECATED_TM_FILE): Remove. * config/sparc/sol2.mt (DEPRECATED_TM_FILE): Remove. * config/sparc/tm-sol2.h: Remove file. * sparc64-sol2-tdep.c (sparc64_sol2_init_abi): Add call to set_gdbarch_sofun_address_maybe_missing. * sparc-sol2-tdep.c (sparc32_sol2_init_abi): Likewise. doc/ChangeLog: * gdbarch.texi (Target Conditionals): Remove documentation of SOFUN_ADDRESS_MAYBE_MISSING, replaced by ... (Compiler Characteristics): ... documentation of set_gdbarch_sofun_address_maybe_missing.
Diffstat (limited to 'gdb/dbxread.c')
-rw-r--r--gdb/dbxread.c44
1 files changed, 19 insertions, 25 deletions
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index a51fe9d..d94922e 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -1116,7 +1116,6 @@ read_dbx_dynamic_symtab (struct objfile *objfile)
do_cleanups (back_to);
}
-#ifdef SOFUN_ADDRESS_MAYBE_MISSING
static CORE_ADDR
find_stab_function_addr (char *namestring, char *filename,
struct objfile *objfile)
@@ -1160,7 +1159,6 @@ find_stab_function_addr (char *namestring, char *filename,
return msym == NULL ? 0 : SYMBOL_VALUE_ADDRESS (msym);
}
-#endif /* SOFUN_ADDRESS_MAYBE_MISSING */
static void
function_outside_compilation_unit_complaint (const char *arg1)
@@ -1463,21 +1461,19 @@ read_dbx_symtab (struct objfile *objfile)
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)
@@ -1832,11 +1828,11 @@ read_dbx_symtab (struct objfile *objfile)
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,
@@ -1850,12 +1846,12 @@ read_dbx_symtab (struct objfile *objfile)
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
@@ -1900,11 +1896,11 @@ read_dbx_symtab (struct objfile *objfile)
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,
@@ -1918,12 +1914,12 @@ read_dbx_symtab (struct objfile *objfile)
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
@@ -2049,12 +2045,11 @@ read_dbx_symtab (struct objfile *objfile)
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,
@@ -2064,7 +2059,6 @@ read_dbx_symtab (struct objfile *objfile)
includes_used = 0;
dependencies_used = 0;
}
-#endif
continue;
case N_RBRAC:
@@ -2186,7 +2180,6 @@ end_psymtab (struct partial_symtab *pst, char **include_list, int num_includes,
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.
@@ -2202,7 +2195,8 @@ end_psymtab (struct partial_symtab *pst, char **include_list, int num_includes,
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;
@@ -2233,8 +2227,10 @@ end_psymtab (struct partial_symtab *pst, char **include_list, int num_includes,
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
{
@@ -2259,7 +2255,6 @@ end_psymtab (struct partial_symtab *pst, char **include_list, int num_includes,
}
/* 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);
@@ -3081,12 +3076,12 @@ no enclosing block"));
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);
@@ -3100,7 +3095,6 @@ no enclosing block"));
if (minsym_valu != 0)
valu = minsym_valu;
}
-#endif
if (block_address_function_relative)
/* For Solaris 2 compilers, the block addresses and