/* Read dbx symbol tables and convert to internal format, for GDB.
- Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004.
Free Software Foundation, Inc.
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., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, 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
static void
unknown_symtype_complaint (const char *arg1)
{
- complaint (&symfile_complaints, "unknown symbol type %s", arg1);
+ complaint (&symfile_complaints, _("unknown symbol type %s"), arg1);
}
static void
lbrac_mismatch_complaint (int arg1)
{
complaint (&symfile_complaints,
- "N_LBRAC/N_RBRAC symbol mismatch at symtab pos %d", arg1);
+ _("N_LBRAC/N_RBRAC symbol mismatch at symtab pos %d"), arg1);
}
static void
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);
}
}
if (!found_any)
- error ("Can't find any code sections in symbol file");
+ error (_("Can't find any code sections in symbol file"));
DBX_TEXT_ADDR (objfile) = start;
DBX_TEXT_SIZE (objfile) = end - start;
text_sect = bfd_get_section_by_name (sym_bfd, ".text");
if (!text_sect)
- error ("Can't find .text section in symbol file");
+ error (_("Can't find .text section in symbol file"));
DBX_TEXT_ADDR (objfile) = bfd_section_vma (sym_bfd, text_sect);
DBX_TEXT_SIZE (objfile) = bfd_section_size (sym_bfd, text_sect);
if (DBX_STRINGTAB_SIZE (objfile) < sizeof (size_temp)
|| DBX_STRINGTAB_SIZE (objfile) > bfd_get_size (sym_bfd))
- error ("ridiculous string table size (%d bytes).",
+ error (_("ridiculous string table size (%d bytes)."),
DBX_STRINGTAB_SIZE (objfile));
DBX_STRINGTAB (objfile) =
if (nbytes < 0)
perror_with_name (bfd_get_filename (sym_bfd));
else if (nbytes == 0)
- error ("Premature end of file reading symbol table");
+ error (_("Premature end of file reading symbol table"));
symbuf_end = nbytes / symbol_size;
symbuf_idx = 0;
symbuf_left -= nbytes;
if (((unsigned) nlist.n_strx + file_string_table_offset) >=
DBX_STRINGTAB_SIZE (objfile))
{
- complaint (&symfile_complaints, "bad string table offset in symbol %d",
+ complaint (&symfile_complaints, _("bad string table offset in symbol %d"),
symnum);
namestring = "<bad string table offset>";
}
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);
}
next_file_string_table_offset =
file_string_table_offset + nlist.n_value;
if (next_file_string_table_offset < file_string_table_offset)
- error ("string table offset backs up at %d", symnum);
+ error (_("string table offset backs up at %d"), symnum);
/* FIXME -- replace error() with complaint. */
continue;
}
/* 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;
}
function_outside_compilation_unit_complaint (name);
xfree (name);
}
- nlist.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+ nlist.n_value += ANOFFSET (objfile->section_offsets,
+ SECT_OFF_TEXT (objfile));
/* Kludges for ELF/STABS with Sun ACC */
last_function_name = namestring;
#ifdef SOFUN_ADDRESS_MAYBE_MISSING
SECT_OFF_TEXT (objfile)))
{
CORE_ADDR minsym_valu =
- find_stab_function_addr (namestring, pst->filename, objfile);
+ find_stab_function_addr (namestring,
+ pst ? pst->filename : NULL,
+ objfile);
/* find_stab_function_addr will return 0 if the minimal
symbol wasn't found. (Unfortunately, this might also
be a valid address.) Anyway, if it *does* return 0,
function_outside_compilation_unit_complaint (name);
xfree (name);
}
- nlist.n_value += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+ nlist.n_value += ANOFFSET (objfile->section_offsets,
+ SECT_OFF_TEXT (objfile));
/* Kludges for ELF/STABS with Sun ACC */
last_function_name = namestring;
#ifdef SOFUN_ADDRESS_MAYBE_MISSING
SECT_OFF_TEXT (objfile)))
{
CORE_ADDR minsym_valu =
- find_stab_function_addr (namestring, pst->filename, objfile);
+ find_stab_function_addr (namestring,
+ pst ? pst->filename : NULL,
+ objfile);
/* find_stab_function_addr will return 0 if the minimal
symbol wasn't found. (Unfortunately, this might also
be a valid address.) Anyway, if it *does* return 0,
time searching to the end of every string looking for
a backslash. */
- complaint (&symfile_complaints, "unknown symbol descriptor `%c'",
+ complaint (&symfile_complaints, _("unknown symbol descriptor `%c'"),
p[1]);
/* Ignore it; perhaps it is an extension that we don't
STRING_OFFSET (result) = string_table_offset;
FILE_STRING_OFFSET (result) = file_string_table_offset;
+#ifdef HAVE_ELF
/* If we're handling an ELF file, drag some section-relocation info
for this source file out of the ELF symbol table, to compensate for
Sun brain death. This replaces the section_offsets in this psymtab,
if successful. */
elfstab_offset_sections (objfile, result);
+#endif
/* Deduce the source language from the filename for this psymtab. */
psymtab_language = deduce_language_from_filename (filename);
fill_symbuf (abfd);
bufp = &symbuf[symbuf_idx];
if (bfd_h_get_8 (abfd, bufp->e_type) != N_SO)
- error ("First symbol in segment of executable not a source symbol");
+ error (_("First symbol in segment of executable not a source symbol"));
max_symnum = sym_size / symbol_size;
}
}
- current_objfile = NULL;
-
/* In a Solaris elf file, this variable, which comes from the
value of the N_SO symbol, will still be 0. Luckily, text_offset,
which comes from pst->textlow is correct. */
pst->symtab = end_symtab (text_offset + text_size, objfile, SECT_OFF_TEXT (objfile));
end_stabs ();
+
+ current_objfile = NULL;
}
\f
/* Relocate for dynamic loading. */
valu += ANOFFSET (section_offsets, SECT_OFF_TEXT (objfile));
- valu = SMASH_TEXT_ADDRESS (valu);
+ valu = gdbarch_smash_text_address (current_gdbarch, valu);
last_function_start = valu;
goto define_a_symbol;
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, "\
+ complaint (&symfile_complaints, _("\
misplaced N_LBRAC entry; discarding local symbols which have \
-no enclosing block");
+no enclosing block"));
}
local_symbols = new->locals;
}
if (new->start_addr > valu)
{
complaint (&symfile_complaints,
- "block start larger than block end");
+ _("block start larger than block end"));
new->start_addr = valu;
}
/* Make a block for the local symbols within. */
goto case_N_ROSYM;
default:
internal_error (__FILE__, __LINE__,
- "failed internal consistency check");
+ _("failed internal consistency check"));
}
}
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;
}
DBX_STRINGTAB_SIZE (objfile) = stabstrsize;
if (stabstrsize > bfd_get_size (sym_bfd))
- error ("ridiculous string table size: %d bytes", stabstrsize);
+ error (_("ridiculous string table size: %d bytes"), stabstrsize);
DBX_STRINGTAB (objfile) = (char *)
obstack_alloc (&objfile->objfile_obstack, stabstrsize + 1);
OBJSTAT (objfile, sz_strtab += stabstrsize + 1);
DBX_STAB_SECTION (objfile) = stabsect;
if (stabstrsize > bfd_get_size (sym_bfd))
- error ("ridiculous string table size: %d bytes", stabstrsize);
+ error (_("ridiculous string table size: %d bytes"), stabstrsize);
DBX_STRINGTAB (objfile) = (char *)
obstack_alloc (&objfile->objfile_obstack, stabstrsize + 1);
OBJSTAT (objfile, sz_strtab += stabstrsize + 1);
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 *)
text_sect = bfd_get_section_by_name (sym_bfd, text_name);
if (!text_sect)
- error ("Can't find %s section in symbol file", text_name);
+ error (_("Can't find %s section in symbol file"), text_name);
DBX_TEXT_ADDR (objfile) = bfd_section_vma (sym_bfd, text_sect);
DBX_TEXT_SIZE (objfile) = bfd_section_size (sym_bfd, 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);
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_segments, /* sym_segments: Get segment information from
+ a file. */
+ NULL, /* sym_read_linetable */
NULL /* next: pointer to next struct sym_fns */
};