Lint around file_ptr's (bfd's off_t's) and bfd_seek.
* dbxread.c (read_dbx_symtab): Use L_SET as bfd_seek arg. (elfstab_build_psymtabs): staboffset and stabstroffset args are file_ptr's. * dwarfread.c (struct dwfinfo): Convert dbfoff, lnfoff to file_ptr. (scan_compilation_units): Punt unused filename arg. dbfoff, lnoffset, and curlnoffset are file_ptr's now. (dwarf_build_psymtabs): Drop desc and filename args; use objfile. dbfoff and lnoffset are file_ptr's now. (read_ofile_symtab): foffset is now file_ptr. Use L_SET in bfd_seek. * elfread.c (struct elfinfo): dboffset and lnoffset are file_ptr's. (elf_symfile_read): Skip desc and filename args to dwarf_build_psymtabs. Pass file_ptr's to elfstab_build_psymtabs. * gdb-stabs.h: Use file_ptr rather than off_t. * mipsread.c (fixup_symtab): f_ptr is a file_ptr. Re-enable compile-time debug check that someone turned off as "unused". (read_the_mips_symtab): st_filptr is a file_ptr. Fix bfd_seek call. * symfile.h: Update dwarf_build_psymtabs and elfstab_build_psymtabs prototypes. * xcoffread.c (init_stringtab, init_lineno, xcoff_symfile_read): Use file_ptr offsets. bfd_seeks use L_SET.
This commit is contained in:
parent
6803d8186f
commit
d5931d797d
6 changed files with 106 additions and 64 deletions
|
@ -1,3 +1,43 @@
|
||||||
|
Thu Oct 15 02:59:30 1992 John Gilmore (gnu@cygnus.com)
|
||||||
|
|
||||||
|
* Makefile.in (VERSION): Roll to 4.6.8.
|
||||||
|
(OBS): Put version.o first, so Makefile rebuild happens early.
|
||||||
|
|
||||||
|
* command.h: Publicize prototype for not_just_help_class_command.
|
||||||
|
* command.c: Remove proto.
|
||||||
|
* maint.c (maintenance_init): Mark "mt" as an abbrev, to avoid
|
||||||
|
duplicated help output. Move "maint info" from class info to
|
||||||
|
class maintenance, and improve text.
|
||||||
|
* infrun.c (): Move "stop" to class_obscure, and give it a
|
||||||
|
function so it will not be seen as a global help topic. FIXME,
|
||||||
|
it should be possible to set these attributes independently.
|
||||||
|
|
||||||
|
* core.c (core_command): Make nicer error message for no core support.
|
||||||
|
|
||||||
|
|
||||||
|
Lint around file_ptr's (bfd's off_t's) and bfd_seek.
|
||||||
|
|
||||||
|
* dbxread.c (read_dbx_symtab): Use L_SET as bfd_seek arg.
|
||||||
|
(elfstab_build_psymtabs): staboffset and stabstroffset args are
|
||||||
|
file_ptr's.
|
||||||
|
* dwarfread.c (struct dwfinfo): Convert dbfoff, lnfoff to file_ptr.
|
||||||
|
(scan_compilation_units): Punt unused filename arg. dbfoff,
|
||||||
|
lnoffset, and curlnoffset are file_ptr's now.
|
||||||
|
(dwarf_build_psymtabs): Drop desc and filename args; use
|
||||||
|
objfile. dbfoff and lnoffset are file_ptr's now.
|
||||||
|
(read_ofile_symtab): foffset is now file_ptr. Use L_SET in bfd_seek.
|
||||||
|
* elfread.c (struct elfinfo): dboffset and lnoffset are file_ptr's.
|
||||||
|
(elf_symfile_read): Skip desc and filename args to
|
||||||
|
dwarf_build_psymtabs. Pass file_ptr's to elfstab_build_psymtabs.
|
||||||
|
* gdb-stabs.h: Use file_ptr rather than off_t.
|
||||||
|
* mipsread.c (fixup_symtab): f_ptr is a file_ptr. Re-enable
|
||||||
|
compile-time debug check that someone turned off as "unused".
|
||||||
|
(read_the_mips_symtab): st_filptr is a file_ptr. Fix bfd_seek call.
|
||||||
|
* symfile.h: Update dwarf_build_psymtabs and
|
||||||
|
elfstab_build_psymtabs prototypes.
|
||||||
|
* xcoffread.c (init_stringtab, init_lineno, xcoff_symfile_read):
|
||||||
|
Use file_ptr offsets. bfd_seeks use L_SET.
|
||||||
|
|
||||||
Thu Oct 15 01:27:32 1992 Stu Grossman (grossman at cygnus.com)
|
Thu Oct 15 01:27:32 1992 Stu Grossman (grossman at cygnus.com)
|
||||||
|
|
||||||
* mips-tdep.c, mipsread.c, tm-mips.h: Get rid of ".gdbinfo."
|
* mips-tdep.c, mipsread.c, tm-mips.h: Get rid of ".gdbinfo."
|
||||||
|
@ -92,7 +132,8 @@ Fri Oct 9 00:31:33 1992 K. Richard Pixley (rich@sendai.cygnus.com)
|
||||||
* config/irix4.mh (XDEPFILES): removed procfs.o fork-child.o.
|
* config/irix4.mh (XDEPFILES): removed procfs.o fork-child.o.
|
||||||
(NAT_FILE, NATDEPFILES): new macros for native support.
|
(NAT_FILE, NATDEPFILES): new macros for native support.
|
||||||
(CC): supply default compiler switches.
|
(CC): supply default compiler switches.
|
||||||
* config/irix3.mh (XDEPFILES): removed infptrace.o inftarg.o fork-child.o coredep.o.
|
* config/irix3.mh (XDEPFILES): removed infptrace.o inftarg.o
|
||||||
|
fork-child.o coredep.o.
|
||||||
(NAT_FILE, NATDEPFILES): new macros for native support. Note that
|
(NAT_FILE, NATDEPFILES): new macros for native support. Note that
|
||||||
irix3 is untested.
|
irix3 is untested.
|
||||||
* config/decstation.mh (XDEPFILES): removed infptrace.o inftarg.o
|
* config/decstation.mh (XDEPFILES): removed infptrace.o inftarg.o
|
||||||
|
|
|
@ -41,10 +41,6 @@ other things to work on, if you get bored. :-)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
#include <varargs.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "bfd.h"
|
#include "bfd.h"
|
||||||
#include "symtab.h"
|
#include "symtab.h"
|
||||||
#include "gdbtypes.h"
|
#include "gdbtypes.h"
|
||||||
|
@ -55,6 +51,18 @@ other things to work on, if you get bored. :-)
|
||||||
#include "buildsym.h"
|
#include "buildsym.h"
|
||||||
#include "demangle.h"
|
#include "demangle.h"
|
||||||
|
|
||||||
|
#include <varargs.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <string.h>
|
||||||
|
#ifndef NO_SYS_FILE
|
||||||
|
#include <sys/file.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* FIXME -- convert this to SEEK_SET a la POSIX, move to config files. */
|
||||||
|
#ifndef L_SET
|
||||||
|
#define L_SET 0
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef MAINTENANCE /* Define to 1 to compile in some maintenance stuff */
|
#ifdef MAINTENANCE /* Define to 1 to compile in some maintenance stuff */
|
||||||
#define SQUAWK(stuff) dwarfwarn stuff
|
#define SQUAWK(stuff) dwarfwarn stuff
|
||||||
#else
|
#else
|
||||||
|
@ -253,10 +261,10 @@ static struct section_offsets *base_section_offsets;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct dwfinfo {
|
struct dwfinfo {
|
||||||
int dbfoff; /* Absolute file offset to start of .debug section */
|
file_ptr dbfoff; /* Absolute file offset to start of .debug section */
|
||||||
int dbroff; /* Relative offset from start of .debug section */
|
int dbroff; /* Relative offset from start of .debug section */
|
||||||
int dblength; /* Size of the chunk of DIE's being examined */
|
int dblength; /* Size of the chunk of DIE's being examined */
|
||||||
int lnfoff; /* Absolute file offset to line table fragment */
|
file_ptr lnfoff; /* Absolute file offset to line table fragment */
|
||||||
};
|
};
|
||||||
|
|
||||||
#define DBFOFF(p) (((struct dwfinfo *)((p)->read_symtab_private))->dbfoff)
|
#define DBFOFF(p) (((struct dwfinfo *)((p)->read_symtab_private))->dbfoff)
|
||||||
|
@ -342,8 +350,8 @@ static void
|
||||||
scan_partial_symbols PARAMS ((char *, char *, struct objfile *));
|
scan_partial_symbols PARAMS ((char *, char *, struct objfile *));
|
||||||
|
|
||||||
static void
|
static void
|
||||||
scan_compilation_units PARAMS ((char *, char *, char *, unsigned int,
|
scan_compilation_units PARAMS ((char *, char *, file_ptr,
|
||||||
unsigned int, struct objfile *));
|
file_ptr, struct objfile *));
|
||||||
|
|
||||||
static void
|
static void
|
||||||
add_partial_symbol PARAMS ((struct dieinfo *, struct objfile *));
|
add_partial_symbol PARAMS ((struct dieinfo *, struct objfile *));
|
||||||
|
@ -498,18 +506,17 @@ GLOBAL FUNCTION
|
||||||
|
|
||||||
SYNOPSIS
|
SYNOPSIS
|
||||||
|
|
||||||
void dwarf_build_psymtabs (int desc, char *filename,
|
void dwarf_build_psymtabs (struct objfile *objfile,
|
||||||
struct section_offsets *section_offsets,
|
struct section_offsets *section_offsets,
|
||||||
int mainline, unsigned int dbfoff, unsigned int dbfsize,
|
int mainline, file_ptr dbfoff, unsigned int dbfsize,
|
||||||
unsigned int lnoffset, unsigned int lnsize,
|
file_ptr lnoffset, unsigned int lnsize)
|
||||||
struct objfile *objfile)
|
|
||||||
|
|
||||||
DESCRIPTION
|
DESCRIPTION
|
||||||
|
|
||||||
This function is called upon to build partial symtabs from files
|
This function is called upon to build partial symtabs from files
|
||||||
containing DIE's (Dwarf Information Entries) and DWARF line numbers.
|
containing DIE's (Dwarf Information Entries) and DWARF line numbers.
|
||||||
|
|
||||||
It is passed a file descriptor for an open file containing the DIES
|
It is passed a bfd* containing the DIES
|
||||||
and line number information, the corresponding filename for that
|
and line number information, the corresponding filename for that
|
||||||
file, a base address for relocating the symbols, a flag indicating
|
file, a base address for relocating the symbols, a flag indicating
|
||||||
whether or not this debugging information is from a "main symbol
|
whether or not this debugging information is from a "main symbol
|
||||||
|
@ -524,29 +531,28 @@ RETURNS
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
dwarf_build_psymtabs (desc, filename, section_offsets, mainline, dbfoff, dbfsize,
|
dwarf_build_psymtabs (objfile, section_offsets, mainline, dbfoff, dbfsize,
|
||||||
lnoffset, lnsize, objfile)
|
lnoffset, lnsize)
|
||||||
int desc;
|
struct objfile *objfile;
|
||||||
char *filename;
|
|
||||||
struct section_offsets *section_offsets;
|
struct section_offsets *section_offsets;
|
||||||
int mainline;
|
int mainline;
|
||||||
unsigned int dbfoff;
|
file_ptr dbfoff;
|
||||||
unsigned int dbfsize;
|
unsigned int dbfsize;
|
||||||
unsigned int lnoffset;
|
file_ptr lnoffset;
|
||||||
unsigned int lnsize;
|
unsigned int lnsize;
|
||||||
struct objfile *objfile;
|
|
||||||
{
|
{
|
||||||
|
bfd *abfd = objfile->obfd;
|
||||||
struct cleanup *back_to;
|
struct cleanup *back_to;
|
||||||
|
|
||||||
current_objfile = objfile;
|
current_objfile = objfile;
|
||||||
dbsize = dbfsize;
|
dbsize = dbfsize;
|
||||||
dbbase = xmalloc (dbsize);
|
dbbase = xmalloc (dbsize);
|
||||||
dbroff = 0;
|
dbroff = 0;
|
||||||
if ((lseek (desc, dbfoff, 0) != dbfoff) ||
|
if ((bfd_seek (abfd, dbfoff, L_SET) != 0) ||
|
||||||
(read (desc, dbbase, dbsize) != dbsize))
|
(bfd_read (dbbase, dbsize, 1, abfd) != dbsize))
|
||||||
{
|
{
|
||||||
free (dbbase);
|
free (dbbase);
|
||||||
error ("can't read DWARF data from '%s'", filename);
|
error ("can't read DWARF data from '%s'", bfd_get_filename (abfd));
|
||||||
}
|
}
|
||||||
back_to = make_cleanup (free, dbbase);
|
back_to = make_cleanup (free, dbbase);
|
||||||
|
|
||||||
|
@ -569,8 +575,7 @@ dwarf_build_psymtabs (desc, filename, section_offsets, mainline, dbfoff, dbfsize
|
||||||
table entry for each one. Save enough information about each compilation
|
table entry for each one. Save enough information about each compilation
|
||||||
unit to locate the full DWARF information later. */
|
unit to locate the full DWARF information later. */
|
||||||
|
|
||||||
scan_compilation_units (filename, dbbase, dbbase + dbsize,
|
scan_compilation_units (dbbase, dbbase + dbsize, dbfoff, lnoffset, objfile);
|
||||||
dbfoff, lnoffset, objfile);
|
|
||||||
|
|
||||||
do_cleanups (back_to);
|
do_cleanups (back_to);
|
||||||
current_objfile = NULL;
|
current_objfile = NULL;
|
||||||
|
@ -2083,7 +2088,7 @@ read_ofile_symtab (pst)
|
||||||
{
|
{
|
||||||
struct cleanup *back_to;
|
struct cleanup *back_to;
|
||||||
unsigned long lnsize;
|
unsigned long lnsize;
|
||||||
int foffset;
|
file_ptr foffset;
|
||||||
bfd *abfd;
|
bfd *abfd;
|
||||||
char lnsizedata[SIZEOF_LINETBL_LENGTH];
|
char lnsizedata[SIZEOF_LINETBL_LENGTH];
|
||||||
|
|
||||||
|
@ -2100,7 +2105,7 @@ read_ofile_symtab (pst)
|
||||||
foffset = DBFOFF(pst) + dbroff;
|
foffset = DBFOFF(pst) + dbroff;
|
||||||
base_section_offsets = pst->section_offsets;
|
base_section_offsets = pst->section_offsets;
|
||||||
baseaddr = ANOFFSET (pst->section_offsets, 0);
|
baseaddr = ANOFFSET (pst->section_offsets, 0);
|
||||||
if (bfd_seek (abfd, foffset, 0) ||
|
if (bfd_seek (abfd, foffset, L_SET) ||
|
||||||
(bfd_read (dbbase, dbsize, 1, abfd) != dbsize))
|
(bfd_read (dbbase, dbsize, 1, abfd) != dbsize))
|
||||||
{
|
{
|
||||||
free (dbbase);
|
free (dbbase);
|
||||||
|
@ -2116,7 +2121,7 @@ read_ofile_symtab (pst)
|
||||||
lnbase = NULL;
|
lnbase = NULL;
|
||||||
if (LNFOFF (pst))
|
if (LNFOFF (pst))
|
||||||
{
|
{
|
||||||
if (bfd_seek (abfd, LNFOFF (pst), 0) ||
|
if (bfd_seek (abfd, LNFOFF (pst), L_SET) ||
|
||||||
(bfd_read ((PTR) lnsizedata, sizeof (lnsizedata), 1, abfd) !=
|
(bfd_read ((PTR) lnsizedata, sizeof (lnsizedata), 1, abfd) !=
|
||||||
sizeof (lnsizedata)))
|
sizeof (lnsizedata)))
|
||||||
{
|
{
|
||||||
|
@ -2125,7 +2130,7 @@ read_ofile_symtab (pst)
|
||||||
lnsize = target_to_host (lnsizedata, SIZEOF_LINETBL_LENGTH,
|
lnsize = target_to_host (lnsizedata, SIZEOF_LINETBL_LENGTH,
|
||||||
GET_UNSIGNED, pst -> objfile);
|
GET_UNSIGNED, pst -> objfile);
|
||||||
lnbase = xmalloc (lnsize);
|
lnbase = xmalloc (lnsize);
|
||||||
if (bfd_seek (abfd, LNFOFF (pst), 0) ||
|
if (bfd_seek (abfd, LNFOFF (pst), L_SET) ||
|
||||||
(bfd_read (lnbase, lnsize, 1, abfd) != lnsize))
|
(bfd_read (lnbase, lnsize, 1, abfd) != lnsize))
|
||||||
{
|
{
|
||||||
free (lnbase);
|
free (lnbase);
|
||||||
|
@ -2637,12 +2642,11 @@ RETURNS
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void
|
static void
|
||||||
scan_compilation_units (filename, thisdie, enddie, dbfoff, lnoffset, objfile)
|
scan_compilation_units (thisdie, enddie, dbfoff, lnoffset, objfile)
|
||||||
char *filename;
|
|
||||||
char *thisdie;
|
char *thisdie;
|
||||||
char *enddie;
|
char *enddie;
|
||||||
unsigned int dbfoff;
|
file_ptr dbfoff;
|
||||||
unsigned int lnoffset;
|
file_ptr lnoffset;
|
||||||
struct objfile *objfile;
|
struct objfile *objfile;
|
||||||
{
|
{
|
||||||
char *nextdie;
|
char *nextdie;
|
||||||
|
@ -2650,7 +2654,7 @@ scan_compilation_units (filename, thisdie, enddie, dbfoff, lnoffset, objfile)
|
||||||
struct partial_symtab *pst;
|
struct partial_symtab *pst;
|
||||||
int culength;
|
int culength;
|
||||||
int curoff;
|
int curoff;
|
||||||
int curlnoffset;
|
file_ptr curlnoffset;
|
||||||
|
|
||||||
while (thisdie < enddie)
|
while (thisdie < enddie)
|
||||||
{
|
{
|
||||||
|
|
|
@ -42,8 +42,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
#include "symfile.h"
|
#include "symfile.h"
|
||||||
#include "objfiles.h"
|
#include "objfiles.h"
|
||||||
#include "buildsym.h"
|
#include "buildsym.h"
|
||||||
|
|
||||||
#include <sys/types.h> /* For off_t for gdb-stabs.h */
|
|
||||||
#include "gdb-stabs.h"
|
#include "gdb-stabs.h"
|
||||||
|
|
||||||
#define STREQ(a,b) (strcmp((a),(b))==0)
|
#define STREQ(a,b) (strcmp((a),(b))==0)
|
||||||
|
@ -53,9 +51,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||||
It's local to elf_symfile_read. */
|
It's local to elf_symfile_read. */
|
||||||
|
|
||||||
struct elfinfo {
|
struct elfinfo {
|
||||||
unsigned int dboffset; /* Offset to dwarf debug section */
|
file_ptr dboffset; /* Offset to dwarf debug section */
|
||||||
unsigned int dbsize; /* Size of dwarf debug section */
|
unsigned int dbsize; /* Size of dwarf debug section */
|
||||||
unsigned int lnoffset; /* Offset to dwarf line number section */
|
file_ptr lnoffset; /* Offset to dwarf line number section */
|
||||||
unsigned int lnsize; /* Size of dwarf line number section */
|
unsigned int lnsize; /* Size of dwarf line number section */
|
||||||
asection *stabsect; /* Section pointer for .stab section */
|
asection *stabsect; /* Section pointer for .stab section */
|
||||||
asection *stabindexsect; /* Section pointer for .stab.index section */
|
asection *stabindexsect; /* Section pointer for .stab.index section */
|
||||||
|
@ -464,11 +462,10 @@ elf_symfile_read (objfile, section_offsets, mainline)
|
||||||
if (ei.dboffset && ei.lnoffset)
|
if (ei.dboffset && ei.lnoffset)
|
||||||
{
|
{
|
||||||
/* DWARF sections */
|
/* DWARF sections */
|
||||||
dwarf_build_psymtabs (fileno ((FILE *)(abfd -> iostream)),
|
dwarf_build_psymtabs (objfile,
|
||||||
bfd_get_filename (abfd),
|
|
||||||
section_offsets, mainline,
|
section_offsets, mainline,
|
||||||
ei.dboffset, ei.dbsize,
|
ei.dboffset, ei.dbsize,
|
||||||
ei.lnoffset, ei.lnsize, objfile);
|
ei.lnoffset, ei.lnsize);
|
||||||
}
|
}
|
||||||
if (ei.stabsect)
|
if (ei.stabsect)
|
||||||
{
|
{
|
||||||
|
@ -489,7 +486,7 @@ elf_symfile_read (objfile, section_offsets, mainline)
|
||||||
mainline,
|
mainline,
|
||||||
ei.stabsect->filepos, /* .stab offset */
|
ei.stabsect->filepos, /* .stab offset */
|
||||||
bfd_get_section_size_before_reloc (ei.stabsect),/* .stab size */
|
bfd_get_section_size_before_reloc (ei.stabsect),/* .stab size */
|
||||||
elf_sect->sh_offset, /* .stabstr offset */
|
(file_ptr) elf_sect->sh_offset, /* .stabstr offset */
|
||||||
elf_sect->sh_size); /* .stabstr size */
|
elf_sect->sh_size); /* .stabstr size */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,15 +59,15 @@ struct dbx_symfile_info {
|
||||||
int symcount; /* How many symbols are there in the file */
|
int symcount; /* How many symbols are there in the file */
|
||||||
char *stringtab; /* The actual string table */
|
char *stringtab; /* The actual string table */
|
||||||
int stringtab_size; /* Its size */
|
int stringtab_size; /* Its size */
|
||||||
off_t symtab_offset; /* Offset in file to symbol table */
|
file_ptr symtab_offset; /* Offset in file to symbol table */
|
||||||
int symbol_size; /* Bytes in a single symbol */
|
int symbol_size; /* Bytes in a single symbol */
|
||||||
struct stab_section_info *stab_section_info; /* section starting points
|
struct stab_section_info *stab_section_info; /* section starting points
|
||||||
of the original .o files before linking. */
|
of the original .o files before linking. */
|
||||||
/* FIXME: HP kludges that shouldn't be here, probably. */
|
/* FIXME: HP kludges that shouldn't be here. */
|
||||||
int hp_symcount;
|
int hp_symcount;
|
||||||
char *hp_stringtab;
|
char *hp_stringtab;
|
||||||
int hp_stringtab_size;
|
int hp_stringtab_size;
|
||||||
off_t hp_symtab_offset;
|
file_ptr hp_symtab_offset;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define DBX_SYMFILE_INFO(o) ((struct dbx_symfile_info *)((o)->sym_private))
|
#define DBX_SYMFILE_INFO(o) ((struct dbx_symfile_info *)((o)->sym_private))
|
||||||
|
|
|
@ -230,7 +230,7 @@ struct type *builtin_type_string;
|
||||||
/* Forward declarations */
|
/* Forward declarations */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
fixup_symtab PARAMS ((HDRR *, char *, int, bfd *));
|
fixup_symtab PARAMS ((HDRR *, char *, file_ptr, bfd *));
|
||||||
|
|
||||||
static void
|
static void
|
||||||
read_mips_symtab PARAMS ((struct objfile *, struct section_offsets *));
|
read_mips_symtab PARAMS ((struct objfile *, struct section_offsets *));
|
||||||
|
@ -449,7 +449,7 @@ read_the_mips_symtab(abfd, end_of_text_segp)
|
||||||
CORE_ADDR *end_of_text_segp;
|
CORE_ADDR *end_of_text_segp;
|
||||||
{
|
{
|
||||||
int stsize, st_hdrsize;
|
int stsize, st_hdrsize;
|
||||||
unsigned st_filptr;
|
file_ptr st_filptr;
|
||||||
struct hdr_ext hdr_ext;
|
struct hdr_ext hdr_ext;
|
||||||
HDRR st_hdr;
|
HDRR st_hdr;
|
||||||
/* Header for executable/object file we read symbols from */
|
/* Header for executable/object file we read symbols from */
|
||||||
|
@ -457,7 +457,7 @@ read_the_mips_symtab(abfd, end_of_text_segp)
|
||||||
int val;
|
int val;
|
||||||
|
|
||||||
/* We need some info from the initial headers */
|
/* We need some info from the initial headers */
|
||||||
val = bfd_seek(abfd, 0L, L_SET);
|
val = bfd_seek(abfd, (file_ptr) 0, L_SET);
|
||||||
val = bfd_read((PTR)&filhdr, sizeof filhdr, 1, abfd);
|
val = bfd_read((PTR)&filhdr, sizeof filhdr, 1, abfd);
|
||||||
|
|
||||||
if (end_of_text_segp)
|
if (end_of_text_segp)
|
||||||
|
@ -514,7 +514,7 @@ static void
|
||||||
fixup_symtab (hdr, data, f_ptr, abfd)
|
fixup_symtab (hdr, data, f_ptr, abfd)
|
||||||
HDRR *hdr;
|
HDRR *hdr;
|
||||||
char *data;
|
char *data;
|
||||||
int f_ptr;
|
file_ptr f_ptr;
|
||||||
bfd *abfd;
|
bfd *abfd;
|
||||||
{
|
{
|
||||||
int f_idx, s_idx, i;
|
int f_idx, s_idx, i;
|
||||||
|
@ -526,8 +526,9 @@ fixup_symtab (hdr, data, f_ptr, abfd)
|
||||||
|
|
||||||
/* This function depends on the external and internal forms
|
/* This function depends on the external and internal forms
|
||||||
of the MIPS symbol table taking identical space. Check this
|
of the MIPS symbol table taking identical space. Check this
|
||||||
assumption at compile-time. */
|
assumption at compile-time.
|
||||||
#if 0 /* FIXME: Unused */
|
DO NOT DELETE THESE ENTRIES, OR COMMENT THEM OUT, JUST BECAUSE SOME
|
||||||
|
"LINT" OR COMPILER THINKS THEY ARE UNUSED! Thank you. */
|
||||||
static check_hdr1[1 + sizeof (struct hdr_ext) - sizeof (HDRR)] = {0};
|
static check_hdr1[1 + sizeof (struct hdr_ext) - sizeof (HDRR)] = {0};
|
||||||
static check_hdr2[1 + sizeof (HDRR) - sizeof (struct hdr_ext)] = {0};
|
static check_hdr2[1 + sizeof (HDRR) - sizeof (struct hdr_ext)] = {0};
|
||||||
static check_fdr1[1 + sizeof (struct fdr_ext) - sizeof (FDR)] = {0};
|
static check_fdr1[1 + sizeof (struct fdr_ext) - sizeof (FDR)] = {0};
|
||||||
|
@ -540,7 +541,6 @@ fixup_symtab (hdr, data, f_ptr, abfd)
|
||||||
static check_ext2[1 + sizeof (EXTR) - sizeof (struct ext_ext)] = {0};
|
static check_ext2[1 + sizeof (EXTR) - sizeof (struct ext_ext)] = {0};
|
||||||
static check_rfd1[1 + sizeof (struct rfd_ext) - sizeof (RFDT)] = {0};
|
static check_rfd1[1 + sizeof (struct rfd_ext) - sizeof (RFDT)] = {0};
|
||||||
static check_rfd2[1 + sizeof (RFDT) - sizeof (struct rfd_ext)] = {0};
|
static check_rfd2[1 + sizeof (RFDT) - sizeof (struct rfd_ext)] = {0};
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Swap in the header record. */
|
/* Swap in the header record. */
|
||||||
ecoff_swap_hdr_in (abfd, hdr, hdr);
|
ecoff_swap_hdr_in (abfd, hdr, hdr);
|
||||||
|
|
|
@ -174,7 +174,7 @@ static int
|
||||||
init_debugsection PARAMS ((bfd *));
|
init_debugsection PARAMS ((bfd *));
|
||||||
|
|
||||||
static int
|
static int
|
||||||
init_stringtab PARAMS ((bfd *, long, struct objfile *));
|
init_stringtab PARAMS ((bfd *, file_ptr, struct objfile *));
|
||||||
|
|
||||||
static void
|
static void
|
||||||
xcoff_symfile_init PARAMS ((struct objfile *));
|
xcoff_symfile_init PARAMS ((struct objfile *));
|
||||||
|
@ -196,7 +196,7 @@ static struct section_offsets *
|
||||||
xcoff_symfile_offsets PARAMS ((struct objfile *, CORE_ADDR));
|
xcoff_symfile_offsets PARAMS ((struct objfile *, CORE_ADDR));
|
||||||
|
|
||||||
static int
|
static int
|
||||||
init_lineno PARAMS ((bfd *, long, int));
|
init_lineno PARAMS ((bfd *, file_ptr, int));
|
||||||
|
|
||||||
static void
|
static void
|
||||||
find_linenos PARAMS ((bfd *, sec_ptr, PTR));
|
find_linenos PARAMS ((bfd *, sec_ptr, PTR));
|
||||||
|
@ -2009,12 +2009,12 @@ PTR vpinfo;
|
||||||
static int
|
static int
|
||||||
init_lineno (abfd, offset, size)
|
init_lineno (abfd, offset, size)
|
||||||
bfd *abfd;
|
bfd *abfd;
|
||||||
long offset;
|
file_ptr offset;
|
||||||
int size;
|
int size;
|
||||||
{
|
{
|
||||||
int val;
|
int val;
|
||||||
|
|
||||||
if (bfd_seek(abfd, offset, 0) < 0)
|
if (bfd_seek(abfd, offset, L_SET) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
linetab = (char *) xmalloc(size);
|
linetab = (char *) xmalloc(size);
|
||||||
|
@ -2150,14 +2150,14 @@ xcoff_symfile_finish (objfile)
|
||||||
static int
|
static int
|
||||||
init_stringtab(abfd, offset, objfile)
|
init_stringtab(abfd, offset, objfile)
|
||||||
bfd *abfd;
|
bfd *abfd;
|
||||||
long offset;
|
file_ptr offset;
|
||||||
struct objfile *objfile;
|
struct objfile *objfile;
|
||||||
{
|
{
|
||||||
long length;
|
long length;
|
||||||
int val;
|
int val;
|
||||||
unsigned char lengthbuf[4];
|
unsigned char lengthbuf[4];
|
||||||
|
|
||||||
if (bfd_seek(abfd, offset, 0) < 0)
|
if (bfd_seek(abfd, offset, L_SET) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
val = bfd_read((char *)lengthbuf, 1, sizeof lengthbuf, abfd);
|
val = bfd_read((char *)lengthbuf, 1, sizeof lengthbuf, abfd);
|
||||||
|
@ -2235,9 +2235,9 @@ xcoff_symfile_read (objfile, section_offset, mainline)
|
||||||
struct section_offset *section_offset;
|
struct section_offset *section_offset;
|
||||||
int mainline;
|
int mainline;
|
||||||
{
|
{
|
||||||
int num_symbols; /* # of symbols */
|
int num_symbols; /* # of symbols */
|
||||||
int symtab_offset; /* symbol table and */
|
file_ptr symtab_offset; /* symbol table and */
|
||||||
int stringtab_offset; /* string table file offsets */
|
file_ptr stringtab_offset; /* string table file offsets */
|
||||||
int val;
|
int val;
|
||||||
bfd *abfd;
|
bfd *abfd;
|
||||||
struct coff_symfile_info *info;
|
struct coff_symfile_info *info;
|
||||||
|
@ -2262,7 +2262,7 @@ xcoff_symfile_read (objfile, section_offset, mainline)
|
||||||
|
|
||||||
/* only read in the line # table if one exists */
|
/* only read in the line # table if one exists */
|
||||||
val = init_lineno(abfd, info->min_lineno_offset,
|
val = init_lineno(abfd, info->min_lineno_offset,
|
||||||
info->max_lineno_offset - info->min_lineno_offset);
|
(int) (info->max_lineno_offset - info->min_lineno_offset));
|
||||||
|
|
||||||
if (val < 0)
|
if (val < 0)
|
||||||
error("\"%s\": error reading line numbers\n", name);
|
error("\"%s\": error reading line numbers\n", name);
|
||||||
|
@ -2278,7 +2278,7 @@ xcoff_symfile_read (objfile, section_offset, mainline)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Position to read the symbol table. Do not read it all at once. */
|
/* Position to read the symbol table. Do not read it all at once. */
|
||||||
val = bfd_seek(abfd, (long)symtab_offset, 0);
|
val = bfd_seek(abfd, symtab_offset, L_SET);
|
||||||
if (val < 0)
|
if (val < 0)
|
||||||
perror_with_name(name);
|
perror_with_name(name);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue