mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-25 21:41:47 +08:00
Wed Jan 27 16:50:25 1999 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* hp-psymtab-read.c: reformatted using indent.
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
Wed Jan 27 16:50:25 1999 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
|
||||||
|
|
||||||
|
* hp-psymtab-read.c: reformatted using indent.
|
||||||
|
|
||||||
Wed Jan 27 13:20:25 1999 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
|
Wed Jan 27 13:20:25 1999 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
|
||||||
|
|
||||||
* hp-psymtab-read.c: reformatted comments, updated copyright.
|
* hp-psymtab-read.c: reformatted comments, updated copyright.
|
||||||
|
@ -99,11 +99,11 @@ trans_lang (in_lang)
|
|||||||
else if (in_lang == HP_LANGUAGE_F77)
|
else if (in_lang == HP_LANGUAGE_F77)
|
||||||
return language_fortran;
|
return language_fortran;
|
||||||
|
|
||||||
else return language_unknown;
|
else
|
||||||
|
return language_unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char main_string[] = "main";
|
static char main_string[] = "main";
|
||||||
|
|
||||||
|
|
||||||
/* Call PXDB to process our file.
|
/* Call PXDB to process our file.
|
||||||
|
|
||||||
@ -142,8 +142,8 @@ hpread_call_pxdb (file_name)
|
|||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
} /* hpread_call_pxdb */
|
} /* hpread_call_pxdb */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Return 1 if the file turns out to need pre-processing
|
/* Return 1 if the file turns out to need pre-processing
|
||||||
by PXDB, and we have thus called PXDB to do this processing
|
by PXDB, and we have thus called PXDB to do this processing
|
||||||
and the file therefore needs to be re-loaded. Otherwise
|
and the file therefore needs to be re-loaded. Otherwise
|
||||||
@ -171,8 +171,8 @@ hpread_pxdb_needed (sym_bfd)
|
|||||||
|
|
||||||
if (pinfo_section && !debug_section)
|
if (pinfo_section && !debug_section)
|
||||||
{
|
{
|
||||||
/* Debug info with DOC, has different header format. */
|
/* Debug info with DOC, has different header format.
|
||||||
/* this only happens if the file was pxdbed and compiled optimized
|
this only happens if the file was pxdbed and compiled optimized
|
||||||
otherwise the PINFO section is not there. */
|
otherwise the PINFO section is not there. */
|
||||||
header_section_size = bfd_section_size (objfile->obfd, header_section);
|
header_section_size = bfd_section_size (objfile->obfd, header_section);
|
||||||
|
|
||||||
@ -189,14 +189,17 @@ hpread_pxdb_needed (sym_bfd)
|
|||||||
tmp = bfd_get_32 (sym_bfd, (bfd_byte *) (buf + sizeof (int) * 4));
|
tmp = bfd_get_32 (sym_bfd, (bfd_byte *) (buf + sizeof (int) * 4));
|
||||||
pxdbed = (tmp >> 31) & 0x1;
|
pxdbed = (tmp >> 31) & 0x1;
|
||||||
|
|
||||||
if (!pxdbed) error ("file debug header info invalid\n");
|
if (!pxdbed)
|
||||||
|
error ("file debug header info invalid\n");
|
||||||
do_pxdb = 0;
|
do_pxdb = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
else error ("invalid $HEADER$ size in executable \n");
|
else
|
||||||
|
error ("invalid $HEADER$ size in executable \n");
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
|
|
||||||
/* this can be three different cases:
|
/* this can be three different cases:
|
||||||
1. pxdbed and not doc
|
1. pxdbed and not doc
|
||||||
@ -254,7 +257,8 @@ hpread_pxdb_needed (sym_bfd)
|
|||||||
|
|
||||||
if (pxdbed)
|
if (pxdbed)
|
||||||
do_pxdb = 0;
|
do_pxdb = 0;
|
||||||
else error ("file debug header invalid\n");
|
else
|
||||||
|
error ("file debug header invalid\n");
|
||||||
}
|
}
|
||||||
else /*not pxdbed and doc OR not pxdbed and non doc */
|
else /*not pxdbed and doc OR not pxdbed and non doc */
|
||||||
do_pxdb = 1;
|
do_pxdb = 1;
|
||||||
@ -279,9 +283,9 @@ hpread_pxdb_needed (sym_bfd)
|
|||||||
or to one to try to use the quick look-up
|
or to one to try to use the quick look-up
|
||||||
tables. */
|
tables. */
|
||||||
int psym_new_style = 1;
|
int psym_new_style = 1;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Code to handle quick lookup-tables follows */
|
/* Code to handle quick lookup-tables follows */
|
||||||
|
|
||||||
|
|
||||||
@ -328,16 +332,18 @@ int psym_new_style = 1;
|
|||||||
objfile->name); \
|
objfile->name); \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Keeping track of the start/end symbol table (LNTT) indices of
|
/* Keeping track of the start/end symbol table (LNTT) indices of
|
||||||
psymtabs created so far */
|
psymtabs created so far */
|
||||||
|
|
||||||
typedef struct {
|
typedef struct
|
||||||
|
{
|
||||||
int start;
|
int start;
|
||||||
int end;
|
int end;
|
||||||
} pst_syms_struct;
|
}
|
||||||
|
pst_syms_struct;
|
||||||
|
|
||||||
static pst_syms_struct *pst_syms_array = 0;
|
static pst_syms_struct *pst_syms_array = 0;
|
||||||
|
|
||||||
@ -406,9 +412,9 @@ find_next_pst_start (index)
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Utility functions to find the ending symbol index for a psymtab */
|
/* Utility functions to find the ending symbol index for a psymtab */
|
||||||
|
|
||||||
/* Find the next file entry that begins beyond INDEX, and return
|
/* Find the next file entry that begins beyond INDEX, and return
|
||||||
@ -424,7 +430,8 @@ find_next_file_isym (index, qFD, curr_fd, pxdb_header_p)
|
|||||||
int curr_fd;
|
int curr_fd;
|
||||||
PXDB_header_ptr pxdb_header_p;
|
PXDB_header_ptr pxdb_header_p;
|
||||||
{
|
{
|
||||||
while (VALID_CURR_FILE) {
|
while (VALID_CURR_FILE)
|
||||||
|
{
|
||||||
if (CURR_FILE_ISYM >= index)
|
if (CURR_FILE_ISYM >= index)
|
||||||
return CURR_FILE_ISYM - 1;
|
return CURR_FILE_ISYM - 1;
|
||||||
curr_fd++;
|
curr_fd++;
|
||||||
@ -445,7 +452,8 @@ find_next_proc_isym (index, qPD, curr_pd, pxdb_header_p)
|
|||||||
int curr_pd;
|
int curr_pd;
|
||||||
PXDB_header_ptr pxdb_header_p;
|
PXDB_header_ptr pxdb_header_p;
|
||||||
{
|
{
|
||||||
while (VALID_CURR_PROC) {
|
while (VALID_CURR_PROC)
|
||||||
|
{
|
||||||
if (CURR_PROC_ISYM >= index)
|
if (CURR_PROC_ISYM >= index)
|
||||||
return CURR_PROC_ISYM - 1;
|
return CURR_PROC_ISYM - 1;
|
||||||
curr_pd++;
|
curr_pd++;
|
||||||
@ -466,7 +474,8 @@ find_next_module_isym (index, qMD, curr_md, pxdb_header_p)
|
|||||||
int curr_md;
|
int curr_md;
|
||||||
PXDB_header_ptr pxdb_header_p;
|
PXDB_header_ptr pxdb_header_p;
|
||||||
{
|
{
|
||||||
while (VALID_CURR_MODULE) {
|
while (VALID_CURR_MODULE)
|
||||||
|
{
|
||||||
if (CURR_MODULE_ISYM >= index)
|
if (CURR_MODULE_ISYM >= index)
|
||||||
return CURR_MODULE_ISYM - 1;
|
return CURR_MODULE_ISYM - 1;
|
||||||
curr_md++;
|
curr_md++;
|
||||||
@ -504,12 +513,14 @@ scan_procs (curr_pd_p, qPD, max_procs, start_adr, end_adr, pst, vt_bits, objfile
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DUMPING
|
#ifdef DUMPING
|
||||||
if (dumping) {
|
if (dumping)
|
||||||
|
{
|
||||||
printf ("Scan_procs called, addresses %x to %x, proc %x\n", start_adr, end_adr, curr_pd);
|
printf ("Scan_procs called, addresses %x to %x, proc %x\n", start_adr, end_adr, curr_pd);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while((CURR_PROC_START <= end_adr) && (curr_pd < max_procs)) {
|
while ((CURR_PROC_START <= end_adr) && (curr_pd < max_procs))
|
||||||
|
{
|
||||||
|
|
||||||
char *rtn_name; /* mangled name */
|
char *rtn_name; /* mangled name */
|
||||||
char *rtn_dem_name; /* qualified demangled name */
|
char *rtn_dem_name; /* qualified demangled name */
|
||||||
@ -530,20 +541,21 @@ scan_procs (curr_pd_p, qPD, max_procs, start_adr, end_adr, pst, vt_bits, objfile
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Hack to get around HP C/C++ compilers' insistence on providing
|
/* Hack to get around HP C/C++ compilers' insistence on providing
|
||||||
* "_MAIN_" as an alternate name for "main" */
|
"_MAIN_" as an alternate name for "main" */
|
||||||
if ((strcmp (rtn_name, "_MAIN_") == 0) &&
|
if ((strcmp (rtn_name, "_MAIN_") == 0) &&
|
||||||
(strcmp (&vt_bits[(long) qPD[curr_pd].sbProc], "main") == 0))
|
(strcmp (&vt_bits[(long) qPD[curr_pd].sbProc], "main") == 0))
|
||||||
rtn_dem_name = rtn_name = main_string;
|
rtn_dem_name = rtn_name = main_string;
|
||||||
|
|
||||||
#ifdef DUMPING
|
#ifdef DUMPING
|
||||||
if( dumping ) {
|
if (dumping)
|
||||||
|
{
|
||||||
printf ("..add %s (demangled %s), index %x to this psymtab\n", rtn_name, rtn_dem_name, curr_pd);
|
printf ("..add %s (demangled %s), index %x to this psymtab\n", rtn_name, rtn_dem_name, curr_pd);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Check for module-spanning routines.
|
/* Check for module-spanning routines. */
|
||||||
*/
|
if (CURR_PROC_END > end_adr)
|
||||||
if(CURR_PROC_END > end_adr ) {
|
{
|
||||||
TELL_OBJFILE;
|
TELL_OBJFILE;
|
||||||
warning ("Procedure \"%s\" [0x%x] spans file or module boundaries.", rtn_name, curr_pd);
|
warning ("Procedure \"%s\" [0x%x] spans file or module boundaries.", rtn_name, curr_pd);
|
||||||
}
|
}
|
||||||
@ -556,17 +568,18 @@ scan_procs (curr_pd_p, qPD, max_procs, start_adr, end_adr, pst, vt_bits, objfile
|
|||||||
/* Check this routine--if it's a class member function,
|
/* Check this routine--if it's a class member function,
|
||||||
add the class to the psymtab. We only need to add
|
add the class to the psymtab. We only need to add
|
||||||
the class once in each module, so check. */
|
the class once in each module, so check. */
|
||||||
if( qPD[curr_pd].member ) {
|
if (qPD[curr_pd].member)
|
||||||
|
{
|
||||||
|
|
||||||
class = qPD[curr_pd].icd;
|
class = qPD[curr_pd].icd;
|
||||||
if( ! B_TST( class_entered, class)) { /* pai: (temp) class_entered not a parameter */
|
if (!B_TST (class_entered, class))
|
||||||
|
{ /* pai: (temp) class_entered not a parameter */
|
||||||
|
|
||||||
class_name = &vt_bits[(long) qCD[class].sbClass];
|
class_name = &vt_bits[(long) qCD[class].sbClass];
|
||||||
|
|
||||||
/* Add to both the struct and var namespace */
|
/* Add to both the struct and var namespace */
|
||||||
|
|
||||||
add_psymbol_to_list (
|
add_psymbol_to_list (class_name,
|
||||||
class_name,
|
|
||||||
strlen (class_name),
|
strlen (class_name),
|
||||||
STRUCT_NAMESPACE,
|
STRUCT_NAMESPACE,
|
||||||
LOC_UNDEF, /* "I have no storage" */
|
LOC_UNDEF, /* "I have no storage" */
|
||||||
@ -575,8 +588,7 @@ scan_procs (curr_pd_p, qPD, max_procs, start_adr, end_adr, pst, vt_bits, objfile
|
|||||||
trans_lang ((enum hp_language) qPD[curr_pd].language),
|
trans_lang ((enum hp_language) qPD[curr_pd].language),
|
||||||
objfile);
|
objfile);
|
||||||
|
|
||||||
add_psymbol_to_list (
|
add_psymbol_to_list (class_name,
|
||||||
class_name,
|
|
||||||
strlen (class_name),
|
strlen (class_name),
|
||||||
VAR_NAMESPACE,
|
VAR_NAMESPACE,
|
||||||
LOC_UNDEF, /* "I have no storage" */
|
LOC_UNDEF, /* "I have no storage" */
|
||||||
@ -601,8 +613,7 @@ scan_procs (curr_pd_p, qPD, max_procs, start_adr, end_adr, pst, vt_bits, objfile
|
|||||||
the correct list in the psymtab. - RT */
|
the correct list in the psymtab. - RT */
|
||||||
dn_bufp = hpread_get_lntt (qPD[curr_pd].isym, objfile);
|
dn_bufp = hpread_get_lntt (qPD[curr_pd].isym, objfile);
|
||||||
if (dn_bufp->dfunc.global)
|
if (dn_bufp->dfunc.global)
|
||||||
add_psymbol_with_dem_name_to_list (
|
add_psymbol_with_dem_name_to_list (rtn_name,
|
||||||
rtn_name,
|
|
||||||
strlen (rtn_name),
|
strlen (rtn_name),
|
||||||
rtn_dem_name,
|
rtn_dem_name,
|
||||||
strlen (rtn_dem_name),
|
strlen (rtn_dem_name),
|
||||||
@ -615,8 +626,7 @@ scan_procs (curr_pd_p, qPD, max_procs, start_adr, end_adr, pst, vt_bits, objfile
|
|||||||
trans_lang ((enum hp_language) qPD[curr_pd].language),
|
trans_lang ((enum hp_language) qPD[curr_pd].language),
|
||||||
objfile);
|
objfile);
|
||||||
else
|
else
|
||||||
add_psymbol_with_dem_name_to_list (
|
add_psymbol_with_dem_name_to_list (rtn_name,
|
||||||
rtn_name,
|
|
||||||
strlen (rtn_name),
|
strlen (rtn_name),
|
||||||
rtn_dem_name,
|
rtn_dem_name,
|
||||||
strlen (rtn_dem_name),
|
strlen (rtn_dem_name),
|
||||||
@ -634,7 +644,8 @@ scan_procs (curr_pd_p, qPD, max_procs, start_adr, end_adr, pst, vt_bits, objfile
|
|||||||
} /* loop over procedures */
|
} /* loop over procedures */
|
||||||
|
|
||||||
#ifdef DUMPING
|
#ifdef DUMPING
|
||||||
if( dumping ) {
|
if (dumping)
|
||||||
|
{
|
||||||
if (symbol_count == 0)
|
if (symbol_count == 0)
|
||||||
printf ("Scan_procs: no symbols found!\n");
|
printf ("Scan_procs: no symbols found!\n");
|
||||||
}
|
}
|
||||||
@ -655,18 +666,12 @@ scan_procs (curr_pd_p, qPD, max_procs, start_adr, end_adr, pst, vt_bits, objfile
|
|||||||
entry for it, so in such cases we create a psymtab for the file. */
|
entry for it, so in such cases we create a psymtab for the file. */
|
||||||
|
|
||||||
int
|
int
|
||||||
hpread_quick_traverse(
|
hpread_quick_traverse (objfile, section_offsets, gntt_bits, vt_bits, pxdb_header_p)
|
||||||
objfile, /* The object file descriptor */
|
struct objfile *objfile; /* The object file descriptor */
|
||||||
section_offsets, /* ?? Null for HP */
|
struct section_offsets *section_offsets; /* ?? Null for HP */
|
||||||
gntt_bits, /* GNTT entries, loaded in from the file */
|
char *gntt_bits; /* GNTT entries, loaded in from the file */
|
||||||
vt_bits, /* VT (string) entries ditto. */
|
char *vt_bits; /* VT (string) entries ditto. */
|
||||||
pxdb_header_p ) /* Pointer to pxdb header ditto */
|
PXDB_header_ptr pxdb_header_p; /* Pointer to pxdb header ditto */
|
||||||
|
|
||||||
struct objfile *objfile;
|
|
||||||
struct section_offsets *section_offsets;
|
|
||||||
char *gntt_bits;
|
|
||||||
char *vt_bits;
|
|
||||||
PXDB_header_ptr pxdb_header_p;
|
|
||||||
{
|
{
|
||||||
struct partial_symtab *pst;
|
struct partial_symtab *pst;
|
||||||
|
|
||||||
@ -692,9 +697,9 @@ hpread_quick_traverse(
|
|||||||
B_TYPE *class_entered;
|
B_TYPE *class_entered;
|
||||||
|
|
||||||
struct partial_symbol **global_syms; /* We'll be filling in the "global" */
|
struct partial_symbol **global_syms; /* We'll be filling in the "global" */
|
||||||
struct partial_symbol **static_syms; /* and "static" tables in the objfile */
|
struct partial_symbol **static_syms; /* and "static" tables in the objfile
|
||||||
/* as we go, so we need a pair of */
|
as we go, so we need a pair of
|
||||||
/* current pointers. */
|
current pointers. */
|
||||||
|
|
||||||
#ifdef DUMPING
|
#ifdef DUMPING
|
||||||
/* Turn this on for lots of debugging information in this routine.
|
/* Turn this on for lots of debugging information in this routine.
|
||||||
@ -710,7 +715,8 @@ hpread_quick_traverse(
|
|||||||
|
|
||||||
/* Demangling style -- if EDG style already set, don't change it,
|
/* Demangling style -- if EDG style already set, don't change it,
|
||||||
as HP style causes some problems with the KAI EDG compiler */
|
as HP style causes some problems with the KAI EDG compiler */
|
||||||
if (current_demangling_style != edg_demangling) {
|
if (current_demangling_style != edg_demangling)
|
||||||
|
{
|
||||||
/* Otherwise, ensure that we are using HP style demangling */
|
/* Otherwise, ensure that we are using HP style demangling */
|
||||||
set_demangling_style (HP_DEMANGLING_STYLE_STRING);
|
set_demangling_style (HP_DEMANGLING_STYLE_STRING);
|
||||||
}
|
}
|
||||||
@ -724,9 +730,11 @@ hpread_quick_traverse(
|
|||||||
addr += pxdb_header_p->pd_entries * sizeof (quick_procedure_entry);
|
addr += pxdb_header_p->pd_entries * sizeof (quick_procedure_entry);
|
||||||
|
|
||||||
#ifdef DUMPING
|
#ifdef DUMPING
|
||||||
if( dumping ) {
|
if (dumping)
|
||||||
|
{
|
||||||
printf ("\n Printing routines as we see them\n");
|
printf ("\n Printing routines as we see them\n");
|
||||||
for( i = 0; VALID_PROC (i); i++ ){
|
for (i = 0; VALID_PROC (i); i++)
|
||||||
|
{
|
||||||
idx = (long) qPD[i].sbProc;
|
idx = (long) qPD[i].sbProc;
|
||||||
printf ("%s %x..%x\n", &vt_bits[idx],
|
printf ("%s %x..%x\n", &vt_bits[idx],
|
||||||
(int) PROC_START (i),
|
(int) PROC_START (i),
|
||||||
@ -739,9 +747,11 @@ hpread_quick_traverse(
|
|||||||
addr += pxdb_header_p->fd_entries * sizeof (quick_file_entry);
|
addr += pxdb_header_p->fd_entries * sizeof (quick_file_entry);
|
||||||
|
|
||||||
#ifdef DUMPING
|
#ifdef DUMPING
|
||||||
if( dumping ) {
|
if (dumping)
|
||||||
|
{
|
||||||
printf ("\n Printing files as we see them\n");
|
printf ("\n Printing files as we see them\n");
|
||||||
for( i = 0; VALID_FILE (i); i++ ){
|
for (i = 0; VALID_FILE (i); i++)
|
||||||
|
{
|
||||||
idx = (long) qFD[i].sbFile;
|
idx = (long) qFD[i].sbFile;
|
||||||
printf ("%s %x..%x\n", &vt_bits[idx],
|
printf ("%s %x..%x\n", &vt_bits[idx],
|
||||||
(int) FILE_START (i),
|
(int) FILE_START (i),
|
||||||
@ -754,9 +764,11 @@ hpread_quick_traverse(
|
|||||||
addr += pxdb_header_p->md_entries * sizeof (quick_module_entry);
|
addr += pxdb_header_p->md_entries * sizeof (quick_module_entry);
|
||||||
|
|
||||||
#ifdef DUMPING
|
#ifdef DUMPING
|
||||||
if( dumping ) {
|
if (dumping)
|
||||||
|
{
|
||||||
printf ("\n Printing modules as we see them\n");
|
printf ("\n Printing modules as we see them\n");
|
||||||
for( i = 0; i < pxdb_header_p->md_entries; i++ ){
|
for (i = 0; i < pxdb_header_p->md_entries; i++)
|
||||||
|
{
|
||||||
idx = (long) qMD[i].sbMod;
|
idx = (long) qMD[i].sbMod;
|
||||||
printf ("%s\n", &vt_bits[idx]);
|
printf ("%s\n", &vt_bits[idx]);
|
||||||
}
|
}
|
||||||
@ -767,9 +779,11 @@ hpread_quick_traverse(
|
|||||||
addr += pxdb_header_p->cd_entries * sizeof (quick_class_entry);
|
addr += pxdb_header_p->cd_entries * sizeof (quick_class_entry);
|
||||||
|
|
||||||
#ifdef DUMPING
|
#ifdef DUMPING
|
||||||
if( dumping ) {
|
if (dumping)
|
||||||
|
{
|
||||||
printf ("\n Printing classes as we see them\n");
|
printf ("\n Printing classes as we see them\n");
|
||||||
for( i = 0; VALID_CLASS (i); i++ ){
|
for (i = 0; VALID_CLASS (i); i++)
|
||||||
|
{
|
||||||
idx = (long) qCD[i].sbClass;
|
idx = (long) qCD[i].sbClass;
|
||||||
printf ("%s\n", &vt_bits[idx]);
|
printf ("%s\n", &vt_bits[idx]);
|
||||||
}
|
}
|
||||||
@ -853,7 +867,8 @@ hpread_quick_traverse(
|
|||||||
end psymtabs; they seem to work well with most objects generated by aCC, but
|
end psymtabs; they seem to work well with most objects generated by aCC, but
|
||||||
who knows when that will change... */
|
who knows when that will change... */
|
||||||
|
|
||||||
while (VALID_CURR_FILE || VALID_CURR_MODULE) {
|
while (VALID_CURR_FILE || VALID_CURR_MODULE)
|
||||||
|
{
|
||||||
|
|
||||||
char *mod_name_string;
|
char *mod_name_string;
|
||||||
char *full_name_string;
|
char *full_name_string;
|
||||||
@ -862,7 +877,8 @@ hpread_quick_traverse(
|
|||||||
in them but still have qMD entries. They also have no qFD or
|
in them but still have qMD entries. They also have no qFD or
|
||||||
qPD entries. Their start address is -1 and their end address
|
qPD entries. Their start address is -1 and their end address
|
||||||
is 0. */
|
is 0. */
|
||||||
if(VALID_CURR_MODULE && (CURR_MODULE_START == -1) && (CURR_MODULE_END == NULL)) {
|
if (VALID_CURR_MODULE && (CURR_MODULE_START == -1) && (CURR_MODULE_END == NULL))
|
||||||
|
{
|
||||||
|
|
||||||
mod_name_string = &vt_bits[(long) qMD[curr_md].sbMod];
|
mod_name_string = &vt_bits[(long) qMD[curr_md].sbMod];
|
||||||
|
|
||||||
@ -885,14 +901,13 @@ hpread_quick_traverse(
|
|||||||
global_syms,
|
global_syms,
|
||||||
static_syms);
|
static_syms);
|
||||||
|
|
||||||
pst = hpread_end_psymtab (
|
pst = hpread_end_psymtab (pst,
|
||||||
pst,
|
|
||||||
NULL, /* psymtab_include_list */
|
NULL, /* psymtab_include_list */
|
||||||
0, /* includes_used */
|
0, /* includes_used */
|
||||||
end_sym * sizeof (struct dntt_type_block),
|
end_sym * sizeof (struct dntt_type_block),
|
||||||
/* byte index in LNTT of end */
|
/* byte index in LNTT of end
|
||||||
/* = capping symbol offset */
|
= capping symbol offset
|
||||||
/* = LDSYMOFF of nextfile */
|
= LDSYMOFF of nextfile */
|
||||||
NULL, /* text high */
|
NULL, /* text high */
|
||||||
NULL, /* dependency_list */
|
NULL, /* dependency_list */
|
||||||
0); /* dependencies_used */
|
0); /* dependencies_used */
|
||||||
@ -904,18 +919,21 @@ hpread_quick_traverse(
|
|||||||
}
|
}
|
||||||
else if (VALID_CURR_MODULE &&
|
else if (VALID_CURR_MODULE &&
|
||||||
((CURR_MODULE_START == 0) || (CURR_MODULE_START == -1) ||
|
((CURR_MODULE_START == 0) || (CURR_MODULE_START == -1) ||
|
||||||
(CURR_MODULE_END == 0) || (CURR_MODULE_END == -1))) {
|
(CURR_MODULE_END == 0) || (CURR_MODULE_END == -1)))
|
||||||
|
{
|
||||||
TELL_OBJFILE;
|
TELL_OBJFILE;
|
||||||
warning ("Module \"%s\" [0x%x] has non-standard addresses. It starts at 0x%x, ends at 0x%x, and will be skipped.",
|
warning ("Module \"%s\" [0x%x] has non-standard addresses. It starts at 0x%x, ends at 0x%x, and will be skipped.",
|
||||||
mod_name_string, curr_md, start_adr, end_adr);
|
mod_name_string, curr_md, start_adr, end_adr);
|
||||||
/* On to next module */
|
/* On to next module */
|
||||||
curr_md++;
|
curr_md++;
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
/* First check if we are looking at a file with code in it
|
/* First check if we are looking at a file with code in it
|
||||||
that does not overlap the current module's code range */
|
that does not overlap the current module's code range */
|
||||||
|
|
||||||
if (VALID_CURR_FILE ? (VALID_CURR_MODULE ? (CURR_FILE_END < CURR_MODULE_START) : 1) : 0) {
|
if (VALID_CURR_FILE ? (VALID_CURR_MODULE ? (CURR_FILE_END < CURR_MODULE_START) : 1) : 0)
|
||||||
|
{
|
||||||
|
|
||||||
/* Looking at file not corresponding to any module,
|
/* Looking at file not corresponding to any module,
|
||||||
create a psymtab for it */
|
create a psymtab for it */
|
||||||
@ -930,7 +948,8 @@ hpread_quick_traverse(
|
|||||||
are in between file or module ranges for some reason (probably
|
are in between file or module ranges for some reason (probably
|
||||||
indicates a compiler bug */
|
indicates a compiler bug */
|
||||||
|
|
||||||
if (CURR_PROC_START < start_adr) {
|
if (CURR_PROC_START < start_adr)
|
||||||
|
{
|
||||||
TELL_OBJFILE;
|
TELL_OBJFILE;
|
||||||
warning ("Found procedure \"%s\" [0x%x] that is not in any file or module.",
|
warning ("Found procedure \"%s\" [0x%x] that is not in any file or module.",
|
||||||
&vt_bits[(long) qPD[curr_pd].sbProc], curr_pd);
|
&vt_bits[(long) qPD[curr_pd].sbProc], curr_pd);
|
||||||
@ -943,13 +962,15 @@ hpread_quick_traverse(
|
|||||||
than the start address of the next module, so check for that and
|
than the start address of the next module, so check for that and
|
||||||
adjust accordingly */
|
adjust accordingly */
|
||||||
|
|
||||||
if (VALID_FILE (curr_fd + 1) && (FILE_START (curr_fd + 1) <= end_adr)) {
|
if (VALID_FILE (curr_fd + 1) && (FILE_START (curr_fd + 1) <= end_adr))
|
||||||
|
{
|
||||||
TELL_OBJFILE;
|
TELL_OBJFILE;
|
||||||
warning ("File \"%s\" [0x%x] has ending address after starting address of next file; adjusting ending address down.",
|
warning ("File \"%s\" [0x%x] has ending address after starting address of next file; adjusting ending address down.",
|
||||||
full_name_string, curr_fd);
|
full_name_string, curr_fd);
|
||||||
end_adr = FILE_START (curr_fd + 1) - 1; /* Is -4 (or -8 for 64-bit) better? */
|
end_adr = FILE_START (curr_fd + 1) - 1; /* Is -4 (or -8 for 64-bit) better? */
|
||||||
}
|
}
|
||||||
if (VALID_MODULE (curr_md) && (CURR_MODULE_START <= end_adr)) {
|
if (VALID_MODULE (curr_md) && (CURR_MODULE_START <= end_adr))
|
||||||
|
{
|
||||||
TELL_OBJFILE;
|
TELL_OBJFILE;
|
||||||
warning ("File \"%s\" [0x%x] has ending address after starting address of next module; adjusting ending address down.",
|
warning ("File \"%s\" [0x%x] has ending address after starting address of next module; adjusting ending address down.",
|
||||||
full_name_string, curr_fd);
|
full_name_string, curr_fd);
|
||||||
@ -958,7 +979,8 @@ hpread_quick_traverse(
|
|||||||
|
|
||||||
|
|
||||||
#ifdef DUMPING
|
#ifdef DUMPING
|
||||||
if( dumping ) {
|
if (dumping)
|
||||||
|
{
|
||||||
printf ("Make new psymtab for file %s (%x to %x).\n",
|
printf ("Make new psymtab for file %s (%x to %x).\n",
|
||||||
full_name_string, start_adr, end_adr);
|
full_name_string, start_adr, end_adr);
|
||||||
}
|
}
|
||||||
@ -996,20 +1018,24 @@ hpread_quick_traverse(
|
|||||||
|
|
||||||
end_sym = 0;
|
end_sym = 0;
|
||||||
/* First check for starting index before previous psymtab */
|
/* First check for starting index before previous psymtab */
|
||||||
if (pst_syms_count && start_sym < pst_syms_array[pst_syms_count - 1].end) {
|
if (pst_syms_count && start_sym < pst_syms_array[pst_syms_count - 1].end)
|
||||||
|
{
|
||||||
end_sym = find_next_pst_start (start_sym);
|
end_sym = find_next_pst_start (start_sym);
|
||||||
}
|
}
|
||||||
/* Look for next start index of a file or module, or procedure */
|
/* Look for next start index of a file or module, or procedure */
|
||||||
if (!end_sym) {
|
if (!end_sym)
|
||||||
|
{
|
||||||
int next_file_isym = find_next_file_isym (start_sym, qFD, curr_fd + 1, pxdb_header_p);
|
int next_file_isym = find_next_file_isym (start_sym, qFD, curr_fd + 1, pxdb_header_p);
|
||||||
int next_module_isym = find_next_module_isym (start_sym, qMD, curr_md, pxdb_header_p);
|
int next_module_isym = find_next_module_isym (start_sym, qMD, curr_md, pxdb_header_p);
|
||||||
int next_proc_isym = find_next_proc_isym (start_sym, qPD, curr_pd, pxdb_header_p);
|
int next_proc_isym = find_next_proc_isym (start_sym, qPD, curr_pd, pxdb_header_p);
|
||||||
|
|
||||||
if (next_file_isym && next_module_isym) {
|
if (next_file_isym && next_module_isym)
|
||||||
|
{
|
||||||
/* pick lower of next file or module start index */
|
/* pick lower of next file or module start index */
|
||||||
end_sym = min (next_file_isym, next_module_isym);
|
end_sym = min (next_file_isym, next_module_isym);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
/* one of them is zero, pick the other */
|
/* one of them is zero, pick the other */
|
||||||
end_sym = max (next_file_isym, next_module_isym);
|
end_sym = max (next_file_isym, next_module_isym);
|
||||||
}
|
}
|
||||||
@ -1026,19 +1052,19 @@ hpread_quick_traverse(
|
|||||||
end_sym = pxdb_header_p->globals;
|
end_sym = pxdb_header_p->globals;
|
||||||
|
|
||||||
#ifdef DUMPING
|
#ifdef DUMPING
|
||||||
if (dumping) {
|
if (dumping)
|
||||||
|
{
|
||||||
printf ("File psymtab indices: %x to %x\n", start_sym, end_sym);
|
printf ("File psymtab indices: %x to %x\n", start_sym, end_sym);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pst = hpread_end_psymtab (
|
pst = hpread_end_psymtab (pst,
|
||||||
pst,
|
|
||||||
NULL, /* psymtab_include_list */
|
NULL, /* psymtab_include_list */
|
||||||
0, /* includes_used */
|
0, /* includes_used */
|
||||||
end_sym * sizeof (struct dntt_type_block),
|
end_sym * sizeof (struct dntt_type_block),
|
||||||
/* byte index in LNTT of end */
|
/* byte index in LNTT of end
|
||||||
/* = capping symbol offset */
|
= capping symbol offset
|
||||||
/* = LDSYMOFF of nextfile */
|
= LDSYMOFF of nextfile */
|
||||||
end_adr, /* text high */
|
end_adr, /* text high */
|
||||||
NULL, /* dependency_list */
|
NULL, /* dependency_list */
|
||||||
0); /* dependencies_used */
|
0); /* dependencies_used */
|
||||||
@ -1049,7 +1075,8 @@ hpread_quick_traverse(
|
|||||||
warning ("No symbols in psymtab for file \"%s\" [0x%x].", full_name_string, curr_fd);
|
warning ("No symbols in psymtab for file \"%s\" [0x%x].", full_name_string, curr_fd);
|
||||||
|
|
||||||
#ifdef DUMPING
|
#ifdef DUMPING
|
||||||
if( dumping ) {
|
if (dumping)
|
||||||
|
{
|
||||||
printf ("Made new psymtab for file %s (%x to %x), sym %x to %x.\n",
|
printf ("Made new psymtab for file %s (%x to %x), sym %x to %x.\n",
|
||||||
full_name_string, start_adr, end_adr, CURR_FILE_ISYM, end_sym);
|
full_name_string, start_adr, end_adr, CURR_FILE_ISYM, end_sym);
|
||||||
}
|
}
|
||||||
@ -1061,7 +1088,8 @@ hpread_quick_traverse(
|
|||||||
|
|
||||||
curr_fd++;
|
curr_fd++;
|
||||||
} /* Psymtab for file */
|
} /* Psymtab for file */
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
/* We have a module for which we create a psymtab */
|
/* We have a module for which we create a psymtab */
|
||||||
|
|
||||||
mod_name_string = &vt_bits[(long) qMD[curr_md].sbMod];
|
mod_name_string = &vt_bits[(long) qMD[curr_md].sbMod];
|
||||||
@ -1071,8 +1099,10 @@ hpread_quick_traverse(
|
|||||||
|
|
||||||
/* So, first pick the lower of the file's and module's start addresses */
|
/* So, first pick the lower of the file's and module's start addresses */
|
||||||
start_adr = CURR_MODULE_START;
|
start_adr = CURR_MODULE_START;
|
||||||
if (VALID_CURR_FILE) {
|
if (VALID_CURR_FILE)
|
||||||
if (CURR_FILE_START < CURR_MODULE_START) {
|
{
|
||||||
|
if (CURR_FILE_START < CURR_MODULE_START)
|
||||||
|
{
|
||||||
TELL_OBJFILE;
|
TELL_OBJFILE;
|
||||||
warning ("File \"%s\" [0x%x] crosses beginning of module \"%s\".",
|
warning ("File \"%s\" [0x%x] crosses beginning of module \"%s\".",
|
||||||
&vt_bits[(long) qFD[curr_fd].sbFile],
|
&vt_bits[(long) qFD[curr_fd].sbFile],
|
||||||
@ -1096,15 +1126,18 @@ hpread_quick_traverse(
|
|||||||
|
|
||||||
end_adr = CURR_MODULE_END;
|
end_adr = CURR_MODULE_END;
|
||||||
|
|
||||||
if (VALID_CURR_FILE) {
|
if (VALID_CURR_FILE)
|
||||||
while (VALID_CURR_FILE && (CURR_FILE_START < end_adr)) {
|
{
|
||||||
|
while (VALID_CURR_FILE && (CURR_FILE_START < end_adr))
|
||||||
|
{
|
||||||
|
|
||||||
#ifdef DUMPING
|
#ifdef DUMPING
|
||||||
if (dumping)
|
if (dumping)
|
||||||
printf ("Maybe skipping file %s which overlaps with module %s\n",
|
printf ("Maybe skipping file %s which overlaps with module %s\n",
|
||||||
&vt_bits[(long) qFD[curr_fd].sbFile], mod_name_string);
|
&vt_bits[(long) qFD[curr_fd].sbFile], mod_name_string);
|
||||||
#endif
|
#endif
|
||||||
if (CURR_FILE_END > end_adr) {
|
if (CURR_FILE_END > end_adr)
|
||||||
|
{
|
||||||
TELL_OBJFILE;
|
TELL_OBJFILE;
|
||||||
warning ("File \"%s\" [0x%x] crosses end of module \"%s\".",
|
warning ("File \"%s\" [0x%x] crosses end of module \"%s\".",
|
||||||
&vt_bits[(long) qFD[curr_fd].sbFile],
|
&vt_bits[(long) qFD[curr_fd].sbFile],
|
||||||
@ -1120,13 +1153,15 @@ hpread_quick_traverse(
|
|||||||
than the start address of the next module, so check for that and
|
than the start address of the next module, so check for that and
|
||||||
adjust accordingly */
|
adjust accordingly */
|
||||||
|
|
||||||
if (VALID_MODULE (curr_md + 1) && (MODULE_START (curr_md + 1) <= end_adr)) {
|
if (VALID_MODULE (curr_md + 1) && (MODULE_START (curr_md + 1) <= end_adr))
|
||||||
|
{
|
||||||
TELL_OBJFILE;
|
TELL_OBJFILE;
|
||||||
warning ("Module \"%s\" [0x%x] has ending address after starting address of next module; adjusting ending address down.",
|
warning ("Module \"%s\" [0x%x] has ending address after starting address of next module; adjusting ending address down.",
|
||||||
mod_name_string, curr_md);
|
mod_name_string, curr_md);
|
||||||
end_adr = MODULE_START (curr_md + 1) - 1; /* Is -4 (or -8 for 64-bit) better? */
|
end_adr = MODULE_START (curr_md + 1) - 1; /* Is -4 (or -8 for 64-bit) better? */
|
||||||
}
|
}
|
||||||
if (VALID_FILE (curr_fd + 1) && (FILE_START (curr_fd + 1) <= end_adr)) {
|
if (VALID_FILE (curr_fd + 1) && (FILE_START (curr_fd + 1) <= end_adr))
|
||||||
|
{
|
||||||
TELL_OBJFILE;
|
TELL_OBJFILE;
|
||||||
warning ("Module \"%s\" [0x%x] has ending address after starting address of next file; adjusting ending address down.",
|
warning ("Module \"%s\" [0x%x] has ending address after starting address of next file; adjusting ending address down.",
|
||||||
mod_name_string, curr_md);
|
mod_name_string, curr_md);
|
||||||
@ -1163,7 +1198,8 @@ hpread_quick_traverse(
|
|||||||
are in between file or module ranges for some reason (probably
|
are in between file or module ranges for some reason (probably
|
||||||
indicates a compiler bug */
|
indicates a compiler bug */
|
||||||
|
|
||||||
if (CURR_PROC_START < start_adr) {
|
if (CURR_PROC_START < start_adr)
|
||||||
|
{
|
||||||
TELL_OBJFILE;
|
TELL_OBJFILE;
|
||||||
warning ("Found procedure \"%s\" [0x%x] that is not in any file or module.",
|
warning ("Found procedure \"%s\" [0x%x] that is not in any file or module.",
|
||||||
&vt_bits[(long) qPD[curr_pd].sbProc], curr_pd);
|
&vt_bits[(long) qPD[curr_pd].sbProc], curr_pd);
|
||||||
@ -1173,7 +1209,8 @@ hpread_quick_traverse(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DUMPING
|
#ifdef DUMPING
|
||||||
if( dumping ) {
|
if (dumping)
|
||||||
|
{
|
||||||
printf ("Make new psymtab for module %s (%x to %x), using file %s\n",
|
printf ("Make new psymtab for module %s (%x to %x), using file %s\n",
|
||||||
mod_name_string, start_adr, end_adr, full_name_string);
|
mod_name_string, start_adr, end_adr, full_name_string);
|
||||||
}
|
}
|
||||||
@ -1211,20 +1248,24 @@ hpread_quick_traverse(
|
|||||||
|
|
||||||
end_sym = 0;
|
end_sym = 0;
|
||||||
/* First check for starting index before previous psymtab */
|
/* First check for starting index before previous psymtab */
|
||||||
if (pst_syms_count && start_sym < pst_syms_array[pst_syms_count - 1].end) {
|
if (pst_syms_count && start_sym < pst_syms_array[pst_syms_count - 1].end)
|
||||||
|
{
|
||||||
end_sym = find_next_pst_start (start_sym);
|
end_sym = find_next_pst_start (start_sym);
|
||||||
}
|
}
|
||||||
/* Look for next start index of a file or module, or procedure */
|
/* Look for next start index of a file or module, or procedure */
|
||||||
if (!end_sym) {
|
if (!end_sym)
|
||||||
|
{
|
||||||
int next_file_isym = find_next_file_isym (start_sym, qFD, curr_fd + 1, pxdb_header_p);
|
int next_file_isym = find_next_file_isym (start_sym, qFD, curr_fd + 1, pxdb_header_p);
|
||||||
int next_module_isym = find_next_module_isym (start_sym, qMD, curr_md + 1, pxdb_header_p);
|
int next_module_isym = find_next_module_isym (start_sym, qMD, curr_md + 1, pxdb_header_p);
|
||||||
int next_proc_isym = find_next_proc_isym (start_sym, qPD, curr_pd, pxdb_header_p);
|
int next_proc_isym = find_next_proc_isym (start_sym, qPD, curr_pd, pxdb_header_p);
|
||||||
|
|
||||||
if (next_file_isym && next_module_isym) {
|
if (next_file_isym && next_module_isym)
|
||||||
|
{
|
||||||
/* pick lower of next file or module start index */
|
/* pick lower of next file or module start index */
|
||||||
end_sym = min (next_file_isym, next_module_isym);
|
end_sym = min (next_file_isym, next_module_isym);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
/* one of them is zero, pick the other */
|
/* one of them is zero, pick the other */
|
||||||
end_sym = max (next_file_isym, next_module_isym);
|
end_sym = max (next_file_isym, next_module_isym);
|
||||||
}
|
}
|
||||||
@ -1241,19 +1282,19 @@ hpread_quick_traverse(
|
|||||||
end_sym = pxdb_header_p->globals;
|
end_sym = pxdb_header_p->globals;
|
||||||
|
|
||||||
#ifdef DUMPING
|
#ifdef DUMPING
|
||||||
if (dumping) {
|
if (dumping)
|
||||||
|
{
|
||||||
printf ("Module psymtab indices: %x to %x\n", start_sym, end_sym);
|
printf ("Module psymtab indices: %x to %x\n", start_sym, end_sym);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pst = hpread_end_psymtab (
|
pst = hpread_end_psymtab (pst,
|
||||||
pst,
|
|
||||||
NULL, /* psymtab_include_list */
|
NULL, /* psymtab_include_list */
|
||||||
0, /* includes_used */
|
0, /* includes_used */
|
||||||
end_sym * sizeof (struct dntt_type_block),
|
end_sym * sizeof (struct dntt_type_block),
|
||||||
/* byte index in LNTT of end */
|
/* byte index in LNTT of end
|
||||||
/* = capping symbol offset */
|
= capping symbol offset
|
||||||
/* = LDSYMOFF of nextfile */
|
= LDSYMOFF of nextfile */
|
||||||
end_adr, /* text high */
|
end_adr, /* text high */
|
||||||
NULL, /* dependency_list */
|
NULL, /* dependency_list */
|
||||||
0); /* dependencies_used */
|
0); /* dependencies_used */
|
||||||
@ -1264,7 +1305,8 @@ hpread_quick_traverse(
|
|||||||
warning ("No symbols in psymtab for module \"%s\" [0x%x].", mod_name_string, curr_md);
|
warning ("No symbols in psymtab for module \"%s\" [0x%x].", mod_name_string, curr_md);
|
||||||
|
|
||||||
#ifdef DUMPING
|
#ifdef DUMPING
|
||||||
if( dumping ) {
|
if (dumping)
|
||||||
|
{
|
||||||
printf ("Made new psymtab for module %s (%x to %x), sym %x to %x.\n",
|
printf ("Made new psymtab for module %s (%x to %x), sym %x to %x.\n",
|
||||||
mod_name_string, start_adr, end_adr, CURR_MODULE_ISYM, end_sym);
|
mod_name_string, start_adr, end_adr, CURR_MODULE_ISYM, end_sym);
|
||||||
}
|
}
|
||||||
@ -1283,13 +1325,15 @@ hpread_quick_traverse(
|
|||||||
|
|
||||||
/* There may be some routines after all files and modules -- these will get
|
/* There may be some routines after all files and modules -- these will get
|
||||||
inserted in a separate new module of their own */
|
inserted in a separate new module of their own */
|
||||||
if (VALID_CURR_PROC) {
|
if (VALID_CURR_PROC)
|
||||||
|
{
|
||||||
start_adr = CURR_PROC_START;
|
start_adr = CURR_PROC_START;
|
||||||
end_adr = qPD[pxdb_header_p->pd_entries - 1].adrEnd;
|
end_adr = qPD[pxdb_header_p->pd_entries - 1].adrEnd;
|
||||||
TELL_OBJFILE;
|
TELL_OBJFILE;
|
||||||
warning ("Found functions beyond end of all files and modules [0x%x].", curr_pd);
|
warning ("Found functions beyond end of all files and modules [0x%x].", curr_pd);
|
||||||
#ifdef DUMPING
|
#ifdef DUMPING
|
||||||
if( dumping ) {
|
if (dumping)
|
||||||
|
{
|
||||||
printf ("Orphan functions at end, PD %d and beyond (%x to %x)\n",
|
printf ("Orphan functions at end, PD %d and beyond (%x to %x)\n",
|
||||||
curr_pd, start_adr, end_adr);
|
curr_pd, start_adr, end_adr);
|
||||||
}
|
}
|
||||||
@ -1311,9 +1355,9 @@ hpread_quick_traverse(
|
|||||||
NULL, /* psymtab_include_list */
|
NULL, /* psymtab_include_list */
|
||||||
0, /* includes_used */
|
0, /* includes_used */
|
||||||
pxdb_header_p->globals * sizeof (struct dntt_type_block),
|
pxdb_header_p->globals * sizeof (struct dntt_type_block),
|
||||||
/* byte index in LNTT of end */
|
/* byte index in LNTT of end
|
||||||
/* = capping symbol offset */
|
= capping symbol offset
|
||||||
/* = LDSYMOFF of nextfile */
|
= LDSYMOFF of nextfile */
|
||||||
end_adr, /* text high */
|
end_adr, /* text high */
|
||||||
NULL, /* dependency_list */
|
NULL, /* dependency_list */
|
||||||
0); /* dependencies_used */
|
0); /* dependencies_used */
|
||||||
@ -1346,8 +1390,8 @@ hpread_quick_traverse(
|
|||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
} /* End of hpread_quick_traverse. */
|
} /* End of hpread_quick_traverse. */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Get appropriate header, based on pxdb type.
|
/* Get appropriate header, based on pxdb type.
|
||||||
Return value: 1 if ok, 0 if not */
|
Return value: 1 if ok, 0 if not */
|
||||||
int
|
int
|
||||||
@ -1363,7 +1407,8 @@ hpread_get_header( objfile, pxdb_header_p )
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
header_section = bfd_get_section_by_name (objfile->obfd, "$HEADER$");
|
header_section = bfd_get_section_by_name (objfile->obfd, "$HEADER$");
|
||||||
if( !header_section ) {
|
if (!header_section)
|
||||||
|
{
|
||||||
/* We don't have either PINFO or DEBUG sections. But
|
/* We don't have either PINFO or DEBUG sections. But
|
||||||
stuff like "libc.sl" has no debug info. There's no
|
stuff like "libc.sl" has no debug info. There's no
|
||||||
need to warn the user of this, as it may be ok. The
|
need to warn the user of this, as it may be ok. The
|
||||||
@ -1383,24 +1428,28 @@ hpread_get_header( objfile, pxdb_header_p )
|
|||||||
$DEBUG$ case). */
|
$DEBUG$ case). */
|
||||||
debug_section = bfd_get_section_by_name (objfile->obfd, "$DEBUG$");
|
debug_section = bfd_get_section_by_name (objfile->obfd, "$DEBUG$");
|
||||||
pinfo_section = bfd_get_section_by_name (objfile->obfd, "$PINFO$");
|
pinfo_section = bfd_get_section_by_name (objfile->obfd, "$PINFO$");
|
||||||
if( debug_section ) {
|
if (debug_section)
|
||||||
|
{
|
||||||
/* The expected case: normal pxdb header. */
|
/* The expected case: normal pxdb header. */
|
||||||
bfd_get_section_contents (objfile->obfd, header_section,
|
bfd_get_section_contents (objfile->obfd, header_section,
|
||||||
pxdb_header_p, 0, sizeof (PXDB_header));
|
pxdb_header_p, 0, sizeof (PXDB_header));
|
||||||
|
|
||||||
if( !pxdb_header_p->pxdbed ) {
|
if (!pxdb_header_p->pxdbed)
|
||||||
|
{
|
||||||
/* This shouldn't happen if we check in "symfile.c". */
|
/* This shouldn't happen if we check in "symfile.c". */
|
||||||
return 0;
|
return 0;
|
||||||
} /* DEBUG section */
|
} /* DEBUG section */
|
||||||
}
|
}
|
||||||
|
|
||||||
else if( pinfo_section ) {
|
else if (pinfo_section)
|
||||||
|
{
|
||||||
/* The DOC case; we need to translate this into a
|
/* The DOC case; we need to translate this into a
|
||||||
regular header. */
|
regular header. */
|
||||||
DOC_info_PXDB_header doc_header;
|
DOC_info_PXDB_header doc_header;
|
||||||
|
|
||||||
#ifdef DUMPING
|
#ifdef DUMPING
|
||||||
if( dumping ) {
|
if (dumping)
|
||||||
|
{
|
||||||
printf ("==OOps, PINFO, let's try to handle this, %s.\n", objfile->name);
|
printf ("==OOps, PINFO, let's try to handle this, %s.\n", objfile->name);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1410,7 +1459,8 @@ hpread_get_header( objfile, pxdb_header_p )
|
|||||||
&doc_header, 0,
|
&doc_header, 0,
|
||||||
sizeof (DOC_info_PXDB_header));
|
sizeof (DOC_info_PXDB_header));
|
||||||
|
|
||||||
if( !doc_header.pxdbed ) {
|
if (!doc_header.pxdbed)
|
||||||
|
{
|
||||||
/* This shouldn't happen if we check in "symfile.c". */
|
/* This shouldn't happen if we check in "symfile.c". */
|
||||||
warning ("File \"%s\" not processed by pxdb!", objfile->name);
|
warning ("File \"%s\" not processed by pxdb!", objfile->name);
|
||||||
return 0;
|
return 0;
|
||||||
@ -1449,8 +1499,8 @@ hpread_get_header( objfile, pxdb_header_p )
|
|||||||
return 1;
|
return 1;
|
||||||
} /* End of hpread_get_header */
|
} /* End of hpread_get_header */
|
||||||
#endif /* QUICK_LOOK_UP */
|
#endif /* QUICK_LOOK_UP */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Initialization for reading native HP C debug symbols from OBJFILE.
|
/* Initialization for reading native HP C debug symbols from OBJFILE.
|
||||||
|
|
||||||
Its only purpose in life is to set up the symbol reader's private
|
Its only purpose in life is to set up the symbol reader's private
|
||||||
@ -1638,11 +1688,13 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
|
|||||||
abfd = symfile_bfd_open (objfile->name);
|
abfd = symfile_bfd_open (objfile->name);
|
||||||
if (!hpread_pxdb_needed (abfd))
|
if (!hpread_pxdb_needed (abfd))
|
||||||
{
|
{
|
||||||
if ( psym_new_style ) {
|
if (psym_new_style)
|
||||||
|
{
|
||||||
PXDB_header pxdb_header;
|
PXDB_header pxdb_header;
|
||||||
int found_modules_in_program;
|
int found_modules_in_program;
|
||||||
|
|
||||||
if( hpread_get_header( objfile, &pxdb_header )) {
|
if (hpread_get_header (objfile, &pxdb_header))
|
||||||
|
{
|
||||||
/* Build a minimal table. No types, no global variables,
|
/* Build a minimal table. No types, no global variables,
|
||||||
no include files.... */
|
no include files.... */
|
||||||
#ifdef DUMPING
|
#ifdef DUMPING
|
||||||
@ -1663,8 +1715,7 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
|
|||||||
So, if modules (other than those in end.c) are
|
So, if modules (other than those in end.c) are
|
||||||
not found we give up on the quick table stuff,
|
not found we give up on the quick table stuff,
|
||||||
and fall back on the slower method */
|
and fall back on the slower method */
|
||||||
found_modules_in_program = hpread_quick_traverse(
|
found_modules_in_program = hpread_quick_traverse (objfile,
|
||||||
objfile,
|
|
||||||
section_offsets,
|
section_offsets,
|
||||||
GNTT (objfile),
|
GNTT (objfile),
|
||||||
VT (objfile),
|
VT (objfile),
|
||||||
@ -1689,7 +1740,8 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DUMPING
|
#ifdef DUMPING
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
if (dumping)
|
if (dumping)
|
||||||
printf ("\nGoing on to old method for %s\n", objfile->name);
|
printf ("\nGoing on to old method for %s\n", objfile->name);
|
||||||
}
|
}
|
||||||
@ -1703,7 +1755,8 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
|
|||||||
handled the same way as after bxdb has been run, and gdb gets very
|
handled the same way as after bxdb has been run, and gdb gets very
|
||||||
very confused. Ileave this in anyway, in case one day we want to
|
very confused. Ileave this in anyway, in case one day we want to
|
||||||
support non pxdb-ed files. */
|
support non pxdb-ed files. */
|
||||||
else scan_start = 0;
|
else
|
||||||
|
scan_start = 0;
|
||||||
|
|
||||||
bfd_close (abfd); /* close the bfd we opened to check for pxdb */
|
bfd_close (abfd); /* close the bfd we opened to check for pxdb */
|
||||||
|
|
||||||
@ -1747,7 +1800,8 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
|
|||||||
{
|
{
|
||||||
#ifdef QUICK_LOOK_UP
|
#ifdef QUICK_LOOK_UP
|
||||||
if (scan_start == hp_symnum
|
if (scan_start == hp_symnum
|
||||||
&& symcount == hp_symnum + 1) {
|
&& symcount == hp_symnum + 1)
|
||||||
|
{
|
||||||
/* If there are NO globals in an executable,
|
/* If there are NO globals in an executable,
|
||||||
PXDB's index to the globals will point to
|
PXDB's index to the globals will point to
|
||||||
the last record in the file, which
|
the last record in the file, which
|
||||||
@ -1850,7 +1904,8 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
|
|||||||
is supposed to be. */
|
is supposed to be. */
|
||||||
|
|
||||||
/* First end the previous psymtab */
|
/* First end the previous psymtab */
|
||||||
if (pst) {
|
if (pst)
|
||||||
|
{
|
||||||
hpread_end_psymtab (pst, psymtab_include_list, includes_used,
|
hpread_end_psymtab (pst, psymtab_include_list, includes_used,
|
||||||
((hp_symnum - 1)
|
((hp_symnum - 1)
|
||||||
* sizeof (struct dntt_type_block)),
|
* sizeof (struct dntt_type_block)),
|
||||||
@ -1866,7 +1921,8 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
|
|||||||
SET_NAMESTRING (dn_bufp, &namestring, objfile);
|
SET_NAMESTRING (dn_bufp, &namestring, objfile);
|
||||||
valu = hpread_get_textlow (i, hp_symnum, objfile, symcount);
|
valu = hpread_get_textlow (i, hp_symnum, objfile, symcount);
|
||||||
valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
|
valu += ANOFFSET (section_offsets, SECT_OFF_TEXT);
|
||||||
if (!pst) {
|
if (!pst)
|
||||||
|
{
|
||||||
pst = hpread_start_psymtab (objfile, section_offsets,
|
pst = hpread_start_psymtab (objfile, section_offsets,
|
||||||
namestring, valu,
|
namestring, valu,
|
||||||
(hp_symnum
|
(hp_symnum
|
||||||
@ -1932,7 +1988,8 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
|
|||||||
|
|
||||||
#ifdef QUICK_LOOK_UP
|
#ifdef QUICK_LOOK_UP
|
||||||
if (scan_start == hp_symnum
|
if (scan_start == hp_symnum
|
||||||
&& symcount == hp_symnum + 1) {
|
&& symcount == hp_symnum + 1)
|
||||||
|
{
|
||||||
/* If there are NO globals in an executable,
|
/* If there are NO globals in an executable,
|
||||||
PXDB's index to the globals will point to
|
PXDB's index to the globals will point to
|
||||||
the last record in the file, which is
|
the last record in the file, which is
|
||||||
@ -1982,7 +2039,8 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
|
|||||||
storage = LOC_UNDEF;
|
storage = LOC_UNDEF;
|
||||||
|
|
||||||
SET_NAMESTRING (dn_bufp, &namestring, objfile);
|
SET_NAMESTRING (dn_bufp, &namestring, objfile);
|
||||||
if (!pst) {
|
if (!pst)
|
||||||
|
{
|
||||||
pst = hpread_start_psymtab (objfile, section_offsets,
|
pst = hpread_start_psymtab (objfile, section_offsets,
|
||||||
"globals", 0,
|
"globals", 0,
|
||||||
(hp_symnum
|
(hp_symnum
|
||||||
@ -2031,20 +2089,25 @@ hpread_build_psymtabs (objfile, section_offsets, mainline)
|
|||||||
We do the same for templates, so that "ptype t"
|
We do the same for templates, so that "ptype t"
|
||||||
where "t" is a template also works. */
|
where "t" is a template also works. */
|
||||||
if (dn_bufp->dblock.kind == DNTT_TYPE_TAGDEF &&
|
if (dn_bufp->dblock.kind == DNTT_TYPE_TAGDEF &&
|
||||||
dn_bufp->dtype.type.dnttp.index < LNTT_SYMCOUNT (objfile)) {
|
dn_bufp->dtype.type.dnttp.index < LNTT_SYMCOUNT (objfile))
|
||||||
|
{
|
||||||
int global = dn_bufp->dtag.global;
|
int global = dn_bufp->dtag.global;
|
||||||
/* Look ahead to see if it's a C++ class */
|
/* Look ahead to see if it's a C++ class */
|
||||||
dn_bufp = hpread_get_lntt (dn_bufp->dtype.type.dnttp.index, objfile);
|
dn_bufp = hpread_get_lntt (dn_bufp->dtype.type.dnttp.index, objfile);
|
||||||
if (dn_bufp->dblock.kind == DNTT_TYPE_CLASS ||
|
if (dn_bufp->dblock.kind == DNTT_TYPE_CLASS ||
|
||||||
dn_bufp->dblock.kind == DNTT_TYPE_ENUM ||
|
dn_bufp->dblock.kind == DNTT_TYPE_ENUM ||
|
||||||
dn_bufp->dblock.kind == DNTT_TYPE_TEMPLATE) {
|
dn_bufp->dblock.kind == DNTT_TYPE_TEMPLATE)
|
||||||
if (global) {
|
{
|
||||||
|
if (global)
|
||||||
|
{
|
||||||
add_psymbol_to_list (namestring, strlen (namestring),
|
add_psymbol_to_list (namestring, strlen (namestring),
|
||||||
VAR_NAMESPACE, storage,
|
VAR_NAMESPACE, storage,
|
||||||
&objfile->global_psymbols,
|
&objfile->global_psymbols,
|
||||||
dn_bufp->dsvar.location,
|
dn_bufp->dsvar.location,
|
||||||
0, language_unknown, objfile);
|
0, language_unknown, objfile);
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
add_psymbol_to_list (namestring, strlen (namestring),
|
add_psymbol_to_list (namestring, strlen (namestring),
|
||||||
VAR_NAMESPACE, storage,
|
VAR_NAMESPACE, storage,
|
||||||
&objfile->static_psymbols,
|
&objfile->static_psymbols,
|
||||||
@ -2167,7 +2230,8 @@ hpread_get_textlow (global, index, objfile, symcount)
|
|||||||
dn_bufp = hpread_get_gntt (index++, objfile);
|
dn_bufp = hpread_get_gntt (index++, objfile);
|
||||||
else
|
else
|
||||||
dn_bufp = hpread_get_lntt (index++, objfile);
|
dn_bufp = hpread_get_lntt (index++, objfile);
|
||||||
} while (dn_bufp->dblock.kind != DNTT_TYPE_FUNCTION
|
}
|
||||||
|
while (dn_bufp->dblock.kind != DNTT_TYPE_FUNCTION
|
||||||
&& dn_bufp->dblock.kind != DNTT_TYPE_DOC_FUNCTION
|
&& dn_bufp->dblock.kind != DNTT_TYPE_DOC_FUNCTION
|
||||||
&& dn_bufp->dblock.kind != DNTT_TYPE_END
|
&& dn_bufp->dblock.kind != DNTT_TYPE_END
|
||||||
&& index < symcount);
|
&& index < symcount);
|
||||||
@ -2271,9 +2335,9 @@ hpread_end_psymtab (pst, include_list, num_includes, capping_symbol_offset,
|
|||||||
objfile->static_psymbols.next - (objfile->static_psymbols.list + pst->statics_offset);
|
objfile->static_psymbols.next - (objfile->static_psymbols.list + pst->statics_offset);
|
||||||
|
|
||||||
#ifdef DUMPING
|
#ifdef DUMPING
|
||||||
if( dumping ) {
|
if (dumping)
|
||||||
printf(
|
{
|
||||||
"\nPst %s, LDSYMOFF %x (%x), LDSYMLEN %x (%x), globals %d, statics %d\n",
|
printf ("\nPst %s, LDSYMOFF %x (%x), LDSYMLEN %x (%x), globals %d, statics %d\n",
|
||||||
pst->filename,
|
pst->filename,
|
||||||
LDSYMOFF (pst),
|
LDSYMOFF (pst),
|
||||||
LDSYMOFF (pst) / sizeof (struct dntt_type_block),
|
LDSYMOFF (pst) / sizeof (struct dntt_type_block),
|
||||||
@ -2369,3 +2433,5 @@ hpread_end_psymtab (pst, include_list, num_includes, capping_symbol_offset,
|
|||||||
***c - basic - offset:4
|
***c - basic - offset:4
|
||||||
*** End:
|
*** End:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user