* 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 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)
* mips-tdep.c, mipsread.c, tm-mips.h: Get rid of ".gdbinfo."
* config/irix4.mh (XDEPFILES): removed procfs.o fork-child.o.
(NAT_FILE, NATDEPFILES): new macros for native support.
(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
irix3 is untested.
* config/decstation.mh (XDEPFILES): removed infptrace.o inftarg.o
*/
#include "defs.h"
-#include <varargs.h>
-#include <fcntl.h>
-#include <string.h>
-
#include "bfd.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "buildsym.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 */
#define SQUAWK(stuff) dwarfwarn stuff
#else
*/
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 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)
scan_partial_symbols PARAMS ((char *, char *, struct objfile *));
static void
-scan_compilation_units PARAMS ((char *, char *, char *, unsigned int,
- unsigned int, struct objfile *));
+scan_compilation_units PARAMS ((char *, char *, file_ptr,
+ file_ptr, struct objfile *));
static void
add_partial_symbol PARAMS ((struct dieinfo *, struct objfile *));
SYNOPSIS
- void dwarf_build_psymtabs (int desc, char *filename,
+ void dwarf_build_psymtabs (struct objfile *objfile,
struct section_offsets *section_offsets,
- int mainline, unsigned int dbfoff, unsigned int dbfsize,
- unsigned int lnoffset, unsigned int lnsize,
- struct objfile *objfile)
+ int mainline, file_ptr dbfoff, unsigned int dbfsize,
+ file_ptr lnoffset, unsigned int lnsize)
DESCRIPTION
This function is called upon to build partial symtabs from files
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
file, a base address for relocating the symbols, a flag indicating
whether or not this debugging information is from a "main symbol
*/
void
-dwarf_build_psymtabs (desc, filename, section_offsets, mainline, dbfoff, dbfsize,
- lnoffset, lnsize, objfile)
- int desc;
- char *filename;
+dwarf_build_psymtabs (objfile, section_offsets, mainline, dbfoff, dbfsize,
+ lnoffset, lnsize)
+ struct objfile *objfile;
struct section_offsets *section_offsets;
int mainline;
- unsigned int dbfoff;
+ file_ptr dbfoff;
unsigned int dbfsize;
- unsigned int lnoffset;
+ file_ptr lnoffset;
unsigned int lnsize;
- struct objfile *objfile;
{
+ bfd *abfd = objfile->obfd;
struct cleanup *back_to;
current_objfile = objfile;
dbsize = dbfsize;
dbbase = xmalloc (dbsize);
dbroff = 0;
- if ((lseek (desc, dbfoff, 0) != dbfoff) ||
- (read (desc, dbbase, dbsize) != dbsize))
+ if ((bfd_seek (abfd, dbfoff, L_SET) != 0) ||
+ (bfd_read (dbbase, dbsize, 1, abfd) != dbsize))
{
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);
table entry for each one. Save enough information about each compilation
unit to locate the full DWARF information later. */
- scan_compilation_units (filename, dbbase, dbbase + dbsize,
- dbfoff, lnoffset, objfile);
+ scan_compilation_units (dbbase, dbbase + dbsize, dbfoff, lnoffset, objfile);
do_cleanups (back_to);
current_objfile = NULL;
{
struct cleanup *back_to;
unsigned long lnsize;
- int foffset;
+ file_ptr foffset;
bfd *abfd;
char lnsizedata[SIZEOF_LINETBL_LENGTH];
foffset = DBFOFF(pst) + dbroff;
base_section_offsets = pst->section_offsets;
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))
{
free (dbbase);
lnbase = NULL;
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) !=
sizeof (lnsizedata)))
{
lnsize = target_to_host (lnsizedata, SIZEOF_LINETBL_LENGTH,
GET_UNSIGNED, pst -> objfile);
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))
{
free (lnbase);
*/
static void
-scan_compilation_units (filename, thisdie, enddie, dbfoff, lnoffset, objfile)
- char *filename;
+scan_compilation_units (thisdie, enddie, dbfoff, lnoffset, objfile)
char *thisdie;
char *enddie;
- unsigned int dbfoff;
- unsigned int lnoffset;
+ file_ptr dbfoff;
+ file_ptr lnoffset;
struct objfile *objfile;
{
char *nextdie;
struct partial_symtab *pst;
int culength;
int curoff;
- int curlnoffset;
+ file_ptr curlnoffset;
while (thisdie < enddie)
{
#include "symfile.h"
#include "objfiles.h"
#include "buildsym.h"
-
-#include <sys/types.h> /* For off_t for gdb-stabs.h */
#include "gdb-stabs.h"
#define STREQ(a,b) (strcmp((a),(b))==0)
It's local to elf_symfile_read. */
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 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 */
asection *stabsect; /* Section pointer for .stab section */
asection *stabindexsect; /* Section pointer for .stab.index section */
if (ei.dboffset && ei.lnoffset)
{
/* DWARF sections */
- dwarf_build_psymtabs (fileno ((FILE *)(abfd -> iostream)),
- bfd_get_filename (abfd),
+ dwarf_build_psymtabs (objfile,
section_offsets, mainline,
ei.dboffset, ei.dbsize,
- ei.lnoffset, ei.lnsize, objfile);
+ ei.lnoffset, ei.lnsize);
}
if (ei.stabsect)
{
mainline,
ei.stabsect->filepos, /* .stab offset */
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 */
}
int symcount; /* How many symbols are there in the file */
char *stringtab; /* The actual string table */
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 */
struct stab_section_info *stab_section_info; /* section starting points
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;
char *hp_stringtab;
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))
/* Forward declarations */
static void
-fixup_symtab PARAMS ((HDRR *, char *, int, bfd *));
+fixup_symtab PARAMS ((HDRR *, char *, file_ptr, bfd *));
static void
read_mips_symtab PARAMS ((struct objfile *, struct section_offsets *));
CORE_ADDR *end_of_text_segp;
{
int stsize, st_hdrsize;
- unsigned st_filptr;
+ file_ptr st_filptr;
struct hdr_ext hdr_ext;
HDRR st_hdr;
/* Header for executable/object file we read symbols from */
int val;
/* 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);
if (end_of_text_segp)
fixup_symtab (hdr, data, f_ptr, abfd)
HDRR *hdr;
char *data;
- int f_ptr;
+ file_ptr f_ptr;
bfd *abfd;
{
int f_idx, s_idx, i;
/* This function depends on the external and internal forms
of the MIPS symbol table taking identical space. Check this
- assumption at compile-time. */
-#if 0 /* FIXME: Unused */
+ assumption at compile-time.
+ 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_hdr2[1 + sizeof (HDRR) - sizeof (struct hdr_ext)] = {0};
static check_fdr1[1 + sizeof (struct fdr_ext) - sizeof (FDR)] = {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_rfd2[1 + sizeof (RFDT) - sizeof (struct rfd_ext)] = {0};
-#endif
/* Swap in the header record. */
ecoff_swap_hdr_in (abfd, hdr, hdr);
init_debugsection PARAMS ((bfd *));
static int
-init_stringtab PARAMS ((bfd *, long, struct objfile *));
+init_stringtab PARAMS ((bfd *, file_ptr, struct objfile *));
static void
xcoff_symfile_init PARAMS ((struct objfile *));
xcoff_symfile_offsets PARAMS ((struct objfile *, CORE_ADDR));
static int
-init_lineno PARAMS ((bfd *, long, int));
+init_lineno PARAMS ((bfd *, file_ptr, int));
static void
find_linenos PARAMS ((bfd *, sec_ptr, PTR));
static int
init_lineno (abfd, offset, size)
bfd *abfd;
- long offset;
+ file_ptr offset;
int size;
{
int val;
- if (bfd_seek(abfd, offset, 0) < 0)
+ if (bfd_seek(abfd, offset, L_SET) < 0)
return -1;
linetab = (char *) xmalloc(size);
static int
init_stringtab(abfd, offset, objfile)
bfd *abfd;
- long offset;
+ file_ptr offset;
struct objfile *objfile;
{
long length;
int val;
unsigned char lengthbuf[4];
- if (bfd_seek(abfd, offset, 0) < 0)
+ if (bfd_seek(abfd, offset, L_SET) < 0)
return -1;
val = bfd_read((char *)lengthbuf, 1, sizeof lengthbuf, abfd);
struct section_offset *section_offset;
int mainline;
{
- int num_symbols; /* # of symbols */
- int symtab_offset; /* symbol table and */
- int stringtab_offset; /* string table file offsets */
+ int num_symbols; /* # of symbols */
+ file_ptr symtab_offset; /* symbol table and */
+ file_ptr stringtab_offset; /* string table file offsets */
int val;
bfd *abfd;
struct coff_symfile_info *info;
/* only read in the line # table if one exists */
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)
error("\"%s\": error reading line numbers\n", name);
}
/* 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)
perror_with_name(name);