#include <stdlib.h>
#include <string.h>
-/* check for the existance of a file, given its full pathname */
+/* check for the existence of a file, given its full pathname */
int
-file_exists (filename)
- char *filename;
+file_exists (char *filename)
{
if (filename)
return (access (filename, F_OK) == 0);
/* Translate from the "hp_language" enumeration in hp-symtab.h
used in the debug info to gdb's generic enumeration in defs.h. */
static enum language
-trans_lang (in_lang)
- enum hp_language in_lang;
+trans_lang (enum hp_language in_lang)
{
if (in_lang == HP_LANGUAGE_C)
return language_c;
/* Call PXDB to process our file.
Approach copied from DDE's "dbgk_run_pxdb". Note: we
- don't check for BSD location of pxdb, nor for existance
+ don't check for BSD location of pxdb, nor for existence
of pxdb itself, etc.
NOTE: uses system function and string functions directly.
Return value: 1 if ok, 0 if not */
int
-hpread_call_pxdb (file_name)
- char *file_name;
+hpread_call_pxdb (char *file_name)
{
char *p;
int status;
and the file therefore needs to be re-loaded. Otherwise
return 0. */
int
-hpread_pxdb_needed (sym_bfd)
- bfd *sym_bfd;
+hpread_pxdb_needed (bfd *sym_bfd)
{
asection *pinfo_section, *debug_section, *header_section;
unsigned int do_pxdb;
If so, call pxdb. */
void
-do_pxdb (sym_bfd)
- bfd *sym_bfd;
+do_pxdb (bfd *sym_bfd)
{
/* The following code is HP-specific. The "right" way of
doing this is unknown, but we bet would involve a target-
/* Set up psymtab symbol index stuff */
static void
-init_pst_syms ()
+init_pst_syms (void)
{
pst_syms_count = 0;
pst_syms_size = 20;
/* Clean up psymtab symbol index stuff */
static void
-clear_pst_syms ()
+clear_pst_syms (void)
{
pst_syms_count = 0;
pst_syms_size = 0;
- free (pst_syms_array);
+ xfree (pst_syms_array);
pst_syms_array = 0;
}
/* Add information about latest psymtab to symbol index table */
static void
-record_pst_syms (start_sym, end_sym)
- int start_sym;
- int end_sym;
+record_pst_syms (int start_sym, int end_sym)
{
if (++pst_syms_count > pst_syms_size)
{
Return 0 => not found */
static int
-find_next_pst_start (index)
- int index;
+find_next_pst_start (int index)
{
int i;
Return 0 => not found */
static int
-find_next_file_isym (index, qFD, curr_fd, pxdb_header_p)
- int index;
- quick_file_entry *qFD;
- int curr_fd;
- PXDB_header_ptr pxdb_header_p;
+find_next_file_isym (int index, quick_file_entry *qFD, int curr_fd,
+ PXDB_header_ptr pxdb_header_p)
{
while (VALID_CURR_FILE)
{
Return 0 => not found */
static int
-find_next_proc_isym (index, qPD, curr_pd, pxdb_header_p)
- int index;
- quick_procedure_entry *qPD;
- int curr_pd;
- PXDB_header_ptr pxdb_header_p;
+find_next_proc_isym (int index, quick_procedure_entry *qPD, int curr_pd,
+ PXDB_header_ptr pxdb_header_p)
{
while (VALID_CURR_PROC)
{
Return 0 => not found */
static int
-find_next_module_isym (index, qMD, curr_md, pxdb_header_p)
- int index;
- quick_module_entry *qMD;
- int curr_md;
- PXDB_header_ptr pxdb_header_p;
+find_next_module_isym (int index, quick_module_entry *qMD, int curr_md,
+ PXDB_header_ptr pxdb_header_p)
{
while (VALID_CURR_MODULE)
{
pointed to by CURR_PD_P, and between code addresses START_ADR and END_ADR.
Other parameters are explained in comments below. */
-/* This used to be inline in hpread_quick_traverse, but now that we do essentially the
- same thing for two different cases (modules and module-less files), it's better
- organized in a separate routine, although it does take lots of arguments. pai/1997-10-08 */
+/* This used to be inline in hpread_quick_traverse, but now that we do
+ essentially the same thing for two different cases (modules and
+ module-less files), it's better organized in a separate routine,
+ although it does take lots of arguments. pai/1997-10-08
+
+ CURR_PD_P is the pointer to the current proc index. QPD is the
+ procedure quick lookup table. MAX_PROCS is the number of entries
+ in the proc. table. START_ADR is the beginning of the code range
+ for the current psymtab. end_adr is the end of the code range for
+ the current psymtab. PST is the current psymtab. VT_bits is
+ a pointer to the strings table of SOM debug space. OBJFILE is
+ the current object file. */
static int
-scan_procs (curr_pd_p, qPD, max_procs, start_adr, end_adr, pst, vt_bits, objfile)
- int *curr_pd_p; /* pointer to current proc index */
- quick_procedure_entry *qPD; /* the procedure quick lookup table */
- int max_procs; /* number of entries in proc. table */
- CORE_ADDR start_adr; /* beginning of code range for current psymtab */
- CORE_ADDR end_adr; /* end of code range for current psymtab */
- struct partial_symtab *pst; /* current psymtab */
- char *vt_bits; /* strings table of SOM debug space */
- struct objfile *objfile; /* current object file */
+scan_procs (int *curr_pd_p, quick_procedure_entry *qPD, int max_procs,
+ CORE_ADDR start_adr, CORE_ADDR end_adr, struct partial_symtab *pst,
+ char *vt_bits, struct objfile *objfile)
{
union dnttentry *dn_bufp;
int symbol_count = 0; /* Total number of symbols in this psymtab */
entry for it, so in such cases we create a psymtab for the file. */
int
-hpread_quick_traverse (objfile, gntt_bits, vt_bits, pxdb_header_p)
- struct objfile *objfile; /* The object file descriptor */
- char *gntt_bits; /* GNTT entries, loaded in from the file */
- char *vt_bits; /* VT (string) entries ditto. */
- PXDB_header_ptr pxdb_header_p; /* Pointer to pxdb header ditto */
+hpread_quick_traverse (struct objfile *objfile, char *gntt_bits,
+ char *vt_bits, PXDB_header_ptr pxdb_header_p)
{
struct partial_symtab *pst;
/* Prepare for the next psymtab. */
global_syms = objfile->global_psymbols.next;
static_syms = objfile->static_psymbols.next;
- free (class_entered);
+ xfree (class_entered);
curr_fd++;
} /* Psymtab for file */
/* Prepare for the next psymtab. */
global_syms = objfile->global_psymbols.next;
static_syms = objfile->static_psymbols.next;
- free (class_entered);
+ xfree (class_entered);
curr_md++;
curr_fd++;
/* Get appropriate header, based on pxdb type.
Return value: 1 if ok, 0 if not */
int
-hpread_get_header (objfile, pxdb_header_p)
- struct objfile *objfile;
- PXDB_header_ptr pxdb_header_p;
+hpread_get_header (struct objfile *objfile, PXDB_header_ptr pxdb_header_p)
{
asection *pinfo_section, *debug_section, *header_section;
FIXME, there should be a cleaner peephole into the BFD environment
here. */
void
-hpread_symfile_init (objfile)
- struct objfile *objfile;
+hpread_symfile_init (struct objfile *objfile)
{
asection *vt_section, *slt_section, *lntt_section, *gntt_section;
opposed to a shared lib or dynamically loaded file). */
void
-hpread_build_psymtabs (objfile, mainline)
- struct objfile *objfile;
- int mainline;
+hpread_build_psymtabs (struct objfile *objfile, int mainline)
{
#ifdef DUMPING
objfile struct from the global list of known objfiles. */
void
-hpread_symfile_finish (objfile)
- struct objfile *objfile;
+hpread_symfile_finish (struct objfile *objfile)
{
if (objfile->sym_private != NULL)
{
/* Various small functions to get entries in the debug symbol sections. */
union dnttentry *
-hpread_get_lntt (index, objfile)
- int index;
- struct objfile *objfile;
+hpread_get_lntt (int index, struct objfile *objfile)
{
return (union dnttentry *)
&(LNTT (objfile)[(index * sizeof (struct dntt_type_block))]);
}
static union dnttentry *
-hpread_get_gntt (index, objfile)
- int index;
- struct objfile *objfile;
+hpread_get_gntt (int index, struct objfile *objfile)
{
return (union dnttentry *)
&(GNTT (objfile)[(index * sizeof (struct dntt_type_block))]);
}
union sltentry *
-hpread_get_slt (index, objfile)
- int index;
- struct objfile *objfile;
+hpread_get_slt (int index, struct objfile *objfile)
{
return (union sltentry *) &(SLT (objfile)[index * sizeof (union sltentry)]);
}
/* Get the low address associated with some symbol (typically the start
of a particular source file or module). Since that information is not
- stored as part of the DNTT_TYPE_MODULE or DNTT_TYPE_SRCFILE symbol we must infer it from
- the existance of DNTT_TYPE_FUNCTION symbols. */
+ stored as part of the DNTT_TYPE_MODULE or DNTT_TYPE_SRCFILE symbol we
+ must infer it from the existence of DNTT_TYPE_FUNCTION symbols. */
static unsigned long
-hpread_get_textlow (global, index, objfile, symcount)
- int global;
- int index;
- struct objfile *objfile;
- int symcount;
+hpread_get_textlow (int global, int index, struct objfile *objfile,
+ int symcount)
{
union dnttentry *dn_bufp;
struct minimal_symbol *msymbol;
(normal). */
static struct partial_symtab *
-hpread_start_psymtab (objfile,
- filename, textlow, ldsymoff, global_syms, static_syms)
- struct objfile *objfile;
- char *filename;
- CORE_ADDR textlow;
- int ldsymoff;
- struct partial_symbol **global_syms;
- struct partial_symbol **static_syms;
+hpread_start_psymtab (struct objfile *objfile, char *filename,
+ CORE_ADDR textlow, int ldsymoff,
+ struct partial_symbol **global_syms,
+ struct partial_symbol **static_syms)
{
int offset = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
extern void hpread_psymtab_to_symtab ();
FIXME: List variables and peculiarities of same. */
static struct partial_symtab *
-hpread_end_psymtab (pst, include_list, num_includes, capping_symbol_offset,
- capping_text, dependency_list, number_dependencies)
- struct partial_symtab *pst;
- char **include_list;
- int num_includes;
- int capping_symbol_offset;
- CORE_ADDR capping_text;
- struct partial_symtab **dependency_list;
- int number_dependencies;
+hpread_end_psymtab (struct partial_symtab *pst, char **include_list,
+ int num_includes, int capping_symbol_offset,
+ CORE_ADDR capping_text,
+ struct partial_symtab **dependency_list,
+ int number_dependencies)
{
int i;
struct objfile *objfile = pst->objfile;