repeated_header_complaint (const char *arg1, int arg2)
{
complaint (&symfile_complaints,
- _("\"repeated\" header file %s not previously seen, at symtab pos %d"),
+ _("\"repeated\" header file %s not previously seen, at symtab \
+pos %d"),
arg1, arg2);
}
/* Allocate struct to keep track of the symfile */
objfile->deprecated_sym_stab_info = (struct dbx_symfile_info *)
xmalloc (sizeof (struct dbx_symfile_info));
- memset (objfile->deprecated_sym_stab_info, 0, sizeof (struct dbx_symfile_info));
+ memset (objfile->deprecated_sym_stab_info, 0,
+ sizeof (struct dbx_symfile_info));
DBX_TEXT_SECTION (objfile) = bfd_get_section_by_name (sym_bfd, ".text");
DBX_DATA_SECTION (objfile) = bfd_get_section_by_name (sym_bfd, ".data");
if (bfd_get_section_flags (abfd, sec) & SEC_CODE)
{
- sym_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+ sym_value += ANOFFSET (objfile->section_offsets,
+ SECT_OFF_TEXT (objfile));
type = N_TEXT;
}
else if (bfd_get_section_flags (abfd, sec) & SEC_DATA)
{
- sym_value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
+ sym_value += ANOFFSET (objfile->section_offsets,
+ SECT_OFF_DATA (objfile));
type = N_DATA;
}
else if (bfd_get_section_flags (abfd, sec) & SEC_ALLOC)
{
- sym_value += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS (objfile));
+ sym_value += ANOFFSET (objfile->section_offsets,
+ SECT_OFF_BSS (objfile));
type = N_BSS;
}
else
{
arelent *rel = *relptr;
CORE_ADDR address =
- rel->address + ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
+ rel->address + ANOFFSET (objfile->section_offsets,
+ SECT_OFF_DATA (objfile));
switch (bfd_get_arch (abfd))
{
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)
{
complaint (&symfile_complaints,
- _("function `%s' appears to be defined outside of all compilation units"),
+ _("function `%s' appears to be defined outside of all compilation \
+units"),
arg1);
}
case N_TEXT | N_EXT:
case N_NBTEXT | N_EXT:
- nlist.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+ nlist.n_value += ANOFFSET (objfile->section_offsets,
+ SECT_OFF_TEXT (objfile));
goto record_it;
case N_DATA | N_EXT:
case N_NBDATA | N_EXT:
- nlist.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
+ nlist.n_value += ANOFFSET (objfile->section_offsets,
+ SECT_OFF_DATA (objfile));
goto record_it;
case N_BSS:
case N_BSS | N_EXT:
case N_NBBSS | N_EXT:
case N_SETV | N_EXT: /* FIXME, is this in BSS? */
- nlist.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_BSS (objfile));
+ nlist.n_value += ANOFFSET (objfile->section_offsets,
+ SECT_OFF_BSS (objfile));
goto record_it;
case N_ABS | N_EXT:
case N_FN:
case N_FN_SEQ:
case N_TEXT:
- nlist.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+ nlist.n_value += ANOFFSET (objfile->section_offsets,
+ SECT_OFF_TEXT (objfile));
namestring = set_namestring (objfile, nlist);
if ((namestring[0] == '-' && namestring[1] == 'l')
symnum * symbol_size,
nlist.n_value > pst->texthigh
? nlist.n_value : pst->texthigh,
- dependency_list, dependencies_used, textlow_not_set);
+ dependency_list, dependencies_used,
+ textlow_not_set);
pst = (struct partial_symtab *) 0;
includes_used = 0;
dependencies_used = 0;
continue;
case N_DATA:
- nlist.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
+ nlist.n_value += ANOFFSET (objfile->section_offsets,
+ SECT_OFF_DATA (objfile));
goto record_it;
case N_UNDF | N_EXT:
namestring = set_namestring (objfile, nlist);
if (target_lookup_symbol (namestring, &reladdr))
{
- continue; /* Error in lookup; ignore symbol for now. */
+ continue; /* Error in lookup; ignore symbol for now. */
}
nlist.n_type ^= (N_BSS ^ N_UNDF); /* Define it as a bss-symbol */
nlist.n_value = reladdr;
static char *dirname_nso;
int prev_textlow_not_set;
- valu = nlist.n_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+ valu = nlist.n_value + ANOFFSET (objfile->section_offsets,
+ SECT_OFF_TEXT (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)
if (tmp_language != language_unknown
&& (tmp_language != language_c
|| psymtab_language != language_cplus))
- psymtab_language = tmp_language;
+ psymtab_language = tmp_language;
if (pst == NULL)
{
/* FIXME: we should not get here without a PST to work on.
Attempt to recover. */
complaint (&symfile_complaints,
- _("N_BINCL %s not in entries for any file, at symtab pos %d"),
+ _("N_BINCL %s not in entries for any file, at symtab \
+pos %d"),
namestring, symnum);
continue;
}
if (tmp_language != language_unknown
&& (tmp_language != language_c
|| psymtab_language != language_cplus))
- psymtab_language = tmp_language;
+ psymtab_language = tmp_language;
/* In C++, one may expect the same filename to come round many
times, when code is coming alternately from the main file
}
continue;
}
- case N_LSYM: /* Typedef or automatic variable. */
+ case N_LSYM: /* Typedef or automatic variable. */
case N_STSYM: /* Data seg var -- static */
case N_LCSYM: /* BSS " */
case N_ROSYM: /* Read-only data seg var -- static. */
case N_NBSTS: /* Gould nobase. */
case N_NBLCS: /* symbols. */
case N_FUN:
- case N_GSYM: /* Global (extern) variable; can be
- data or bss (sigh FIXME). */
+ case N_GSYM: /* Global (extern) variable; can be
+ data or bss (sigh FIXME). */
/* Following may probably be ignored; I'll leave them here
for now (until I do Pascal and Modula 2 extensions). */
- case N_PC: /* I may or may not need this; I
- suspect not. */
- case N_M2C: /* I suspect that I can ignore this here. */
+ case N_PC: /* I may or may not need this; I
+ suspect not. */
+ case N_M2C: /* I suspect that I can ignore this here. */
case N_SCOPE: /* Same. */
namestring = set_namestring (objfile, nlist);
switch (p[1])
{
case 'S':
- nlist.n_value += ANOFFSET (objfile->section_offsets, data_sect_index);
-#ifdef STATIC_TRANSFORM_NAME
- namestring = STATIC_TRANSFORM_NAME (namestring);
-#endif
+ nlist.n_value += ANOFFSET (objfile->section_offsets,
+ data_sect_index);
+
+ 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,
psymtab_language, objfile);
continue;
case 'G':
- nlist.n_value += ANOFFSET (objfile->section_offsets, data_sect_index);
+ nlist.n_value += ANOFFSET (objfile->section_offsets,
+ data_sect_index);
/* 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,
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
case '8':
case '9':
case '-':
- case '#': /* for symbol identification (used in live ranges) */
+ case '#': /* for symbol identification (used in live ranges) */
continue;
case ':':
(dependencies_used
* sizeof (struct partial_symtab *)));
#ifdef DEBUG_INFO
- fprintf_unfiltered (gdb_stderr, "Had to reallocate dependency list.\n");
- fprintf_unfiltered (gdb_stderr, "New dependencies allocated: %d\n",
+ fprintf_unfiltered (gdb_stderr,
+ "Had to reallocate dependency list.\n");
+ fprintf_unfiltered (gdb_stderr,
+ "New dependencies allocated: %d\n",
dependencies_allocated);
#endif
}
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:
case N_EINCL:
case N_DSLINE:
case N_BSLINE:
- case N_SSYM: /* Claim: Structure or union element.
- Hopefully, I can ignore this. */
+ case N_SSYM: /* Claim: Structure or union element.
+ Hopefully, I can ignore this. */
case N_ENTRY: /* Alternate entry point; can ignore. */
- case N_MAIN: /* Can definitely ignore this. */
+ case N_MAIN: /* Can definitely ignore this. */
case N_CATCH: /* These are GNU C++ extensions */
- case N_EHDECL: /* that can safely be ignored here. */
+ case N_EHDECL: /* that can safely be ignored here. */
case N_LENG:
case N_BCOMM:
case N_ECOMM:
case N_PSYM:
case N_LBRAC:
case N_NSYMS: /* Ultrix 4.0: symbol count */
- case N_DEFD: /* GNU Modula-2 */
+ case N_DEFD: /* GNU Modula-2 */
case N_ALIAS: /* SunPro F77: alias name, ignore for now. */
- case N_OBJ: /* useless types from Solaris */
+ case N_OBJ: /* useless types from Solaris */
case N_OPT:
case N_PATCH:
/* These symbols aren't interesting; don't worry about them */
/* Don't set pst->texthigh lower than it already is. */
CORE_ADDR text_end =
(lowest_text_address == (CORE_ADDR) -1
- ? (text_addr + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)))
+ ? (text_addr + ANOFFSET (objfile->section_offsets,
+ SECT_OFF_TEXT (objfile)))
: lowest_text_address)
+ text_size;
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);
+ objfile->global_psymbols.next - (objfile->global_psymbols.list
+ + pst->globals_offset);
pst->n_static_syms =
- objfile->static_psymbols.next - (objfile->static_psymbols.list + pst->statics_offset);
+ objfile->static_psymbols.next - (objfile->static_psymbols.list
+ + pst->statics_offset);
pst->number_of_dependencies = number_dependencies;
if (number_dependencies)
if (pst->readin)
{
- fprintf_unfiltered (gdb_stderr, "Psymtab for %s already read in. Shouldn't happen.\n",
+ fprintf_unfiltered (gdb_stderr, "Psymtab for %s already read in. \
+Shouldn't happen.\n",
pst->filename);
return;
}
if (pst->readin)
{
- fprintf_unfiltered (gdb_stderr, "Psymtab for %s already read in. Shouldn't happen.\n",
+ fprintf_unfiltered (gdb_stderr, "Psymtab for %s already read in. \
+Shouldn't happen.\n",
pst->filename);
return;
}
DBX_STAB_SECTION (pst->objfile),
NULL);
if (stabs_data)
- back_to = make_cleanup (free_current_contents, (void *) &stabs_data);
+ back_to = make_cleanup (free_current_contents,
+ (void *) &stabs_data);
}
dbx_psymtab_to_symtab_1 (pst);
if (last_source_start_addr > text_offset)
last_source_start_addr = text_offset;
- pst->symtab = end_symtab (text_offset + text_size, objfile, SECT_OFF_TEXT (objfile));
+ pst->symtab = end_symtab (text_offset + text_size, objfile,
+ SECT_OFF_TEXT (objfile));
end_stabs ();
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
if (context_stack_depth > 1)
{
complaint (&symfile_complaints,
- _("unmatched N_LBRAC before symtab pos %d"), symnum);
+ _("unmatched N_LBRAC before symtab pos %d"),
+ symnum);
break;
}
return;
if (!stabstrsect)
- error (_("stabsect_build_psymtabs: Found stabs (%s), but not string section (%s)"),
+ error (_("stabsect_build_psymtabs: Found stabs (%s), but not string \
+section (%s)"),
stab_name, stabstr_name);
objfile->deprecated_sym_stab_info = (struct dbx_symfile_info *)
xmalloc (sizeof (struct dbx_symfile_info));
- memset (objfile->deprecated_sym_stab_info, 0, sizeof (struct dbx_symfile_info));
+ memset (objfile->deprecated_sym_stab_info, 0,
+ sizeof (struct dbx_symfile_info));
text_sect = bfd_get_section_by_name (sym_bfd, text_name);
if (!text_sect)
DBX_SYMTAB_OFFSET (objfile) = stabsect->filepos; /* XXX - FIXME: POKING INSIDE BFD DATA STRUCTURES */
if (DBX_STRINGTAB_SIZE (objfile) > bfd_get_size (sym_bfd))
- error (_("ridiculous string table size: %d bytes"), DBX_STRINGTAB_SIZE (objfile));
+ error (_("ridiculous string table size: %d bytes"),
+ DBX_STRINGTAB_SIZE (objfile));
DBX_STRINGTAB (objfile) = (char *)
obstack_alloc (&objfile->objfile_obstack, DBX_STRINGTAB_SIZE (objfile) + 1);
OBJSTAT (objfile, sz_strtab += DBX_STRINGTAB_SIZE (objfile) + 1);
val = bfd_get_section_contents (sym_bfd, /* bfd */
stabstrsect, /* bfd section */
- DBX_STRINGTAB (objfile), /* input buffer */
+ DBX_STRINGTAB (objfile), /* input buffer */
0, /* offset into section */
- DBX_STRINGTAB_SIZE (objfile)); /* amount to read */
+ DBX_STRINGTAB_SIZE (objfile)); /* amount to read */
if (!val)
perror_with_name (name);
static struct sym_fns aout_sym_fns =
{
bfd_target_aout_flavour,
- dbx_new_init, /* sym_new_init: init anything gbl to entire symtab */
- dbx_symfile_init, /* sym_init: read initial info, setup for sym_read() */
+ dbx_new_init, /* sym_new_init: init anything gbl to entire symtab */
+ dbx_symfile_init, /* sym_init: read initial info, setup for sym_read() */
dbx_symfile_read, /* sym_read: read a symbol file into symtab */
dbx_symfile_finish, /* sym_finish: finished with file, cleanup */
- default_symfile_offsets, /* sym_offsets: parse user's offsets to internal form */
+ 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 */