} \
else \
*NAMEP = (SYM)->dsfile.name + VT (OBJFILE)
-
-/* Each partial symbol table entry contains a pointer to private data for the
- read_symtab() function to use when expanding a partial symbol table entry
- to a full symbol table entry.
-
- For hpuxread this structure contains the offset within the file symbol table
- of first local symbol for this file, and length (in bytes) of the section
- of the symbol table devoted to this file's symbols (actually, the section
- bracketed may contain more than just this file's symbols).
-
- If ldsymlen is 0, the only reason for this thing's existence is the
- dependency list. Nothing else will happen when it is read in. */
-
-#define LDSYMOFF(p) (((struct symloc *)((p)->read_symtab_private))->ldsymoff)
-#define LDSYMLEN(p) (((struct symloc *)((p)->read_symtab_private))->ldsymlen)
-#define SYMLOC(p) ((struct symloc *)((p)->read_symtab_private))
+\f
+/* We put a pointer to this structure in the read_symtab_private field
+ of the psymtab. */
struct symloc
{
+ /* The offset within the file symbol table of first local symbol for
+ this file. */
+
int ldsymoff;
+
+ /* Length (in bytes) of the section of the symbol table devoted to
+ this file's symbols (actually, the section bracketed may contain
+ more than just this file's symbols). If ldsymlen is 0, the only
+ reason for this thing's existence is the dependency list.
+ Nothing else will happen when it is read in. */
+
int ldsymlen;
};
+#define LDSYMOFF(p) (((struct symloc *)((p)->read_symtab_private))->ldsymoff)
+#define LDSYMLEN(p) (((struct symloc *)((p)->read_symtab_private))->ldsymlen)
+#define SYMLOC(p) ((struct symloc *)((p)->read_symtab_private))
+\f
/* FIXME: Shouldn't this stuff be in a .h file somewhere? */
/* Nonzero means give verbose info on gdb action. */
extern int info_verbose;
struct objfile *, CORE_ADDR, int, char *, int));
static sltpointer hpread_record_lines
- PARAMS ((struct subfile *, sltpointer, sltpointer, struct objfile *));
+ PARAMS ((struct subfile *, sltpointer, sltpointer,
+ struct objfile *, CORE_ADDR));
static struct type *hpread_read_function_type
PARAMS ((dnttpointer, union dnttentry *, struct objfile *));
if (pst && past_first_source_file)
{
- texthigh += ANOFFSET (section_offsets, SECT_OFF_TEXT);
hpread_end_psymtab (pst, psymtab_include_list,
includes_used,
(hp_symnum
case DNTT_TYPE_ENTRY:
/* The beginning of a function. DNTT_TYPE_ENTRY may also denote
a secondary entry point. */
+ valu = dn_bufp->dfunc.hiaddr + ANOFFSET (section_offsets,
+ SECT_OFF_TEXT);
+ if (valu > texthigh)
+ texthigh = valu;
valu = dn_bufp->dfunc.lowaddr +
ANOFFSET (section_offsets, SECT_OFF_TEXT);
- if (dn_bufp->dfunc.hiaddr > texthigh)
- texthigh = dn_bufp->dfunc.hiaddr;
SET_NAMESTRING (dn_bufp, &namestring, objfile);
ADD_PSYMBOL_TO_LIST (namestring, strlen (namestring),
VAR_NAMESPACE, LOC_BLOCK,
and file blocks right now. */
if (dn_bufp->dend.endkind == DNTT_TYPE_MODULE)
{
- texthigh += ANOFFSET (section_offsets, SECT_OFF_TEXT);
hpread_end_psymtab (pst, psymtab_include_list, includes_used,
(hp_symnum
* sizeof (struct dntt_type_block)),
return 0;
/* The minimal symbols are typically more accurate for some reason. */
- msymbol = lookup_minimal_symbol (dn_bufp->dfunc.name + VT (objfile),
+ msymbol = lookup_minimal_symbol (dn_bufp->dfunc.name + VT (objfile), NULL,
objfile);
if (msymbol)
return SYMBOL_VALUE_ADDRESS (msymbol);
TYPE_CODE (type) = TYPE_CODE_RANGE;
TYPE_LENGTH (type) = dn_bufp->dsubr.bitlength / 8;
TYPE_NFIELDS (type) = 2;
- TYPE_FIELDS (type) = (struct field *) obstack_alloc
- (&objfile->type_obstack, 2 * sizeof (struct field));
+ TYPE_FIELDS (type)
+ = (struct field *) obstack_alloc (&objfile->type_obstack,
+ 2 * sizeof (struct field));
if (dn_bufp->dsubr.dyn_low)
TYPE_FIELD_BITPOS (type, 0) = 0;
}
static sltpointer
-hpread_record_lines (subfile, s_idx, e_idx, objfile)
+hpread_record_lines (subfile, s_idx, e_idx, objfile, offset)
struct subfile *subfile;
sltpointer s_idx, e_idx;
struct objfile *objfile;
+ CORE_ADDR offset;
{
union sltentry *sl_bufp;
/* Only record "normal" entries in the SLT. */
if (sl_bufp->snorm.sltdesc == SLT_NORMAL
|| sl_bufp->snorm.sltdesc == SLT_EXIT)
- record_line (subfile, sl_bufp->snorm.line, sl_bufp->snorm.address);
+ record_line (subfile, sl_bufp->snorm.line,
+ sl_bufp->snorm.address + offset);
s_idx++;
}
return e_idx;
finish the symbol table of the previous source file
(if any) and start accumulating a new symbol table. */
- valu = text_offset + offset; /* Relocate for dynamic loading */
+ valu = text_offset;
if (!last_source_file)
- start_symtab (name, NULL, valu);
-
- SL_INDEX (objfile) = hpread_record_lines (current_subfile,
- SL_INDEX (objfile),
- dn_bufp->dsfile.address,
- objfile);
+ {
+ start_symtab (name, NULL, valu);
+ SL_INDEX (objfile) = dn_bufp->dsfile.address;
+ }
+ else
+ {
+ SL_INDEX (objfile) = hpread_record_lines (current_subfile,
+ SL_INDEX (objfile),
+ dn_bufp->dsfile.address,
+ objfile, offset);
+ }
start_subfile (name, NULL);
break;
SL_INDEX (objfile) = hpread_record_lines (current_subfile,
SL_INDEX (objfile),
dn_bufp->dfunc.address,
- objfile);
+ objfile, offset);
WITHIN_FUNCTION (objfile) = 1;
CURRENT_FUNCTION_VALUE (objfile) = valu;
SL_INDEX (objfile) = hpread_record_lines (current_subfile,
SL_INDEX (objfile),
dn_bufp->dbegin.address,
- objfile);
+ objfile, offset);
SYMBOL_LINE (sym) = hpread_get_line (dn_bufp->dbegin.address, objfile);
record_line (current_subfile, SYMBOL_LINE (sym), valu);
break;
SL_INDEX (objfile) = hpread_record_lines (current_subfile,
SL_INDEX (objfile),
dn_bufp->dbegin.address,
- objfile);
+ objfile, offset);
valu = hpread_get_location (dn_bufp->dbegin.address, objfile);
valu += offset; /* Relocate for dynamic loading */
desc = hpread_get_depth (dn_bufp->dbegin.address, objfile);
SL_INDEX (objfile) = hpread_record_lines (current_subfile,
SL_INDEX (objfile),
dn_bufp->dend.address + 1,
- objfile);
+ objfile, offset);
switch (dn_bufp->dend.endkind)
{
case DNTT_TYPE_MODULE: