projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* sh-opc.h (sh_table): Complete last element entry to avoid
[deliverable/binutils-gdb.git]
/
gdb
/
dstread.c
diff --git
a/gdb/dstread.c
b/gdb/dstread.c
index c10c1fe18cc15e9911643562042cdf6c120be099..c3a73f064cdd4e0bd50220d329d80c46153b6158 100644
(file)
--- a/
gdb/dstread.c
+++ b/
gdb/dstread.c
@@
-1,6
+1,7
@@
/* Read apollo DST symbol tables and convert to internal format, for GDB.
Contributed by Troy Rollo, University of NSW (troy@cbme.unsw.edu.au).
/* Read apollo DST symbol tables and convert to internal format, for GDB.
Contributed by Troy Rollo, University of NSW (troy@cbme.unsw.edu.au).
- Copyright 1993 Free Software Foundation, Inc.
+ Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+ Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
@@
-52,46
+53,33
@@
static int prev_line_number;
static int line_vector_length;
static int line_vector_length;
-static int
-init_dst_sections PARAMS ((int));
+static int init_dst_sections (int);
-static void
-read_dst_symtab PARAMS ((struct objfile *));
+static void read_dst_symtab (struct objfile *);
-static void
-find_dst_sections PARAMS ((bfd *, sec_ptr, PTR));
+static void find_dst_sections (bfd *, sec_ptr, PTR);
-static void
-dst_symfile_init PARAMS ((struct objfile *));
+static void dst_symfile_init (struct objfile *);
-static void
-dst_new_init PARAMS ((struct objfile *));
+static void dst_new_init (struct objfile *);
-static void
-dst_symfile_read PARAMS ((struct objfile *, int));
+static void dst_symfile_read (struct objfile *, int);
-static void
-dst_symfile_finish PARAMS ((struct objfile *));
+static void dst_symfile_finish (struct objfile *);
-static void
-dst_end_symtab PARAMS ((struct objfile *));
+static void dst_end_symtab (struct objfile *);
-static void
-complete_symtab PARAMS ((char *, CORE_ADDR, unsigned int));
+static void complete_symtab (char *, CORE_ADDR, unsigned int);
-static void
-dst_start_symtab PARAMS ((void));
+static void dst_start_symtab (void);
-static void
-dst_record_line PARAMS ((int, CORE_ADDR));
+static void dst_record_line (int, CORE_ADDR);
/* Manage the vector of line numbers. */
/* FIXME: Use record_line instead. */
static void
/* Manage the vector of line numbers. */
/* FIXME: Use record_line instead. */
static void
-dst_record_line (line, pc)
- int line;
- CORE_ADDR pc;
+dst_record_line (int line, CORE_ADDR pc)
{
struct linetable_entry *e;
/* Make sure line vector is big enough. */
{
struct linetable_entry *e;
/* Make sure line vector is big enough. */
@@
-115,12
+103,12
@@
dst_record_line (line, pc)
/* FIXME: use start_symtab, like coffread.c now does. */
static void
/* FIXME: use start_symtab, like coffread.c now does. */
static void
-dst_start_symtab ()
+dst_start_symtab (
void
)
{
/* Initialize the source file line number information for this file. */
if (line_vector) /* Unlikely, but maybe possible? */
{
/* Initialize the source file line number information for this file. */
if (line_vector) /* Unlikely, but maybe possible? */
-
free ((PTR)
line_vector);
+
xfree (
line_vector);
line_vector_index = 0;
line_vector_length = 1000;
prev_line_number = -2; /* Force first line number to be explicit */
line_vector_index = 0;
line_vector_length = 1000;
prev_line_number = -2; /* Force first line number to be explicit */
@@
-135,10
+123,7
@@
dst_start_symtab ()
text address for the file, and SIZE is the number of bytes of text. */
static void
text address for the file, and SIZE is the number of bytes of text. */
static void
-complete_symtab (name, start_addr, size)
- char *name;
- CORE_ADDR start_addr;
- unsigned int size;
+complete_symtab (char *name, CORE_ADDR start_addr, unsigned int size)
{
last_source_file = savestring (name, strlen (name));
cur_src_start_addr = start_addr;
{
last_source_file = savestring (name, strlen (name));
cur_src_start_addr = start_addr;
@@
-159,8
+144,7
@@
complete_symtab (name, start_addr, size)
/* FIXME: Use end_symtab, like coffread.c now does. */
static void
/* FIXME: Use end_symtab, like coffread.c now does. */
static void
-dst_end_symtab (objfile)
- struct objfile *objfile;
+dst_end_symtab (struct objfile *objfile)
{
register struct symtab *symtab;
register struct blockvector *blockvector;
{
register struct symtab *symtab;
register struct blockvector *blockvector;
@@
-205,8
+189,7
@@
dst_end_symtab (objfile)
The ultimate result is a new symtab (or, FIXME, eventually a psymtab). */
static void
The ultimate result is a new symtab (or, FIXME, eventually a psymtab). */
static void
-dst_symfile_init (objfile)
- struct objfile *objfile;
+dst_symfile_init (struct objfile *objfile)
{
asection *section;
bfd *abfd = objfile->obfd;
{
asection *section;
bfd *abfd = objfile->obfd;
@@
-221,10
+204,7
@@
dst_symfile_init (objfile)
/* ARGSUSED */
static void
/* ARGSUSED */
static void
-find_dst_sections (abfd, asect, vpinfo)
- bfd *abfd;
- sec_ptr asect;
- PTR vpinfo;
+find_dst_sections (bfd *abfd, sec_ptr asect, PTR vpinfo)
{
int size, count;
long base;
{
int size, count;
long base;
@@
-263,9
+243,7
@@
static bfd *symfile_bfd;
/* ARGSUSED */
static void
/* ARGSUSED */
static void
-dst_symfile_read (objfile, mainline)
- struct objfile *objfile;
- int mainline;
+dst_symfile_read (struct objfile *objfile, int mainline)
{
bfd *abfd = objfile->obfd;
char *name = bfd_get_filename (abfd);
{
bfd *abfd = objfile->obfd;
char *name = bfd_get_filename (abfd);
@@
-288,7
+266,7
@@
dst_symfile_read (objfile, mainline)
error ("\"%s\": error reading debugging symbol tables\n", name);
init_minimal_symbol_collection ();
error ("\"%s\": error reading debugging symbol tables\n", name);
init_minimal_symbol_collection ();
- make_cleanup
(discard_minimal_symbols, 0
);
+ make_cleanup
_discard_minimal_symbols (
);
/* Now that the executable file is positioned at symbol table,
process it and define symbols accordingly. */
/* Now that the executable file is positioned at symbol table,
process it and define symbols accordingly. */
@@
-312,8
+290,7
@@
dst_symfile_read (objfile, mainline)
}
static void
}
static void
-dst_new_init (ignore)
- struct objfile *ignore;
+dst_new_init (struct objfile *ignore)
{
/* Nothin' to do */
}
{
/* Nothin' to do */
}
@@
-324,8
+301,7
@@
dst_new_init (ignore)
objfile struct from the global list of known objfiles. */
static void
objfile struct from the global list of known objfiles. */
static void
-dst_symfile_finish (objfile)
- struct objfile *objfile;
+dst_symfile_finish (struct objfile *objfile)
{
/* Nothing to do */
}
{
/* Nothing to do */
}
@@
-338,9
+314,7
@@
dst_symfile_finish (objfile)
* this is what was really intended.
*/
static int
* this is what was really intended.
*/
static int
-get_dst_line (buffer, pc)
- signed char **buffer;
- long *pc;
+get_dst_line (signed char **buffer, long *pc)
{
static last_pc = 0;
static long last_line = 0;
{
static last_pc = 0;
static long last_line = 0;
@@
-444,18
+418,14
@@
get_dst_line (buffer, pc)
}
static void
}
static void
-enter_all_lines (buffer, address)
- char *buffer;
- long address;
+enter_all_lines (char *buffer, long address)
{
if (buffer)
while (get_dst_line (&buffer, &address));
}
static int
{
if (buffer)
while (get_dst_line (&buffer, &address));
}
static int
-get_dst_entry (buffer, ret_entry)
- char *buffer;
- dst_rec_ptr_t *ret_entry;
+get_dst_entry (char *buffer, dst_rec_ptr_t *ret_entry)
{
int size;
dst_rec_ptr_t entry;
{
int size;
dst_rec_ptr_t entry;
@@
-677,10
+647,7
@@
get_dst_entry (buffer, ret_entry)
}
static int
}
static int
-next_dst_entry (buffer, entry, table)
- char **buffer;
- dst_rec_ptr_t *entry;
- dst_sec *table;
+next_dst_entry (char **buffer, dst_rec_ptr_t *entry, dst_sec *table)
{
if (*buffer - table->buffer >= table->size)
{
{
if (*buffer - table->buffer >= table->size)
{
@@
-698,8
+665,7
@@
next_dst_entry (buffer, entry, table)
static dst_rec_ptr_t section_table = NULL;
char *
static dst_rec_ptr_t section_table = NULL;
char *
-get_sec_ref (ref)
- dst_sect_ref_t *ref;
+get_sec_ref (dst_sect_ref_t *ref)
{
dst_sec *section = NULL;
long offset;
{
dst_sec *section = NULL;
long offset;
@@
-731,8
+697,7
@@
dst_get_addr (int section, long offset)
}
CORE_ADDR
}
CORE_ADDR
-dst_sym_addr (ref)
- dst_sect_ref_t *ref;
+dst_sym_addr (dst_sect_ref_t *ref)
{
if (!section_table || !ref->sect_index)
return 0;
{
if (!section_table || !ref->sect_index)
return 0;
@@
-741,8
+706,7
@@
dst_sym_addr (ref)
}
static struct type *
}
static struct type *
-create_new_type (objfile)
- struct objfile *objfile;
+create_new_type (struct objfile *objfile)
{
struct type *type;
{
struct type *type;
@@
-753,9
+717,7
@@
create_new_type (objfile)
}
static struct symbol *
}
static struct symbol *
-create_new_symbol (objfile, name)
- struct objfile *objfile;
- char *name;
+create_new_symbol (struct objfile *objfile, char *name)
{
struct symbol *sym = (struct symbol *)
obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol));
{
struct symbol *sym = (struct symbol *)
obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol));
@@
-769,14
+731,11
@@
create_new_symbol (objfile, name)
return sym;
};
return sym;
};
-static struct type *
- decode_dst_type PARAMS ((struct objfile *, dst_rec_ptr_t));
+static struct type *decode_dst_type (struct objfile *, dst_rec_ptr_t);
static struct type *
static struct type *
-decode_type_desc (objfile, type_desc, base)
- struct objfile *objfile;
- dst_type_t *type_desc;
- dst_rec_ptr_t base;
+decode_type_desc (struct objfile *objfile, dst_type_t *type_desc,
+ dst_rec_ptr_t base)
{
struct type *type;
dst_rec_ptr_t entry;
{
struct type *type;
dst_rec_ptr_t entry;
@@
-874,8
+833,7
@@
struct structure_list
static struct structure_list *struct_list = NULL;
static struct type *
static struct structure_list *struct_list = NULL;
static struct type *
-find_dst_structure (name)
- char *name;
+find_dst_structure (char *name)
{
struct structure_list *element;
{
struct structure_list *element;
@@
-887,11
+845,8
@@
find_dst_structure (name)
static struct type *
static struct type *
-decode_dst_structure (objfile, entry, code, version)
- struct objfile *objfile;
- dst_rec_ptr_t entry;
- int code;
- int version;
+decode_dst_structure (struct objfile *objfile, dst_rec_ptr_t entry, int code,
+ int version)
{
struct type *type, *child_type;
char *struct_name;
{
struct type *type, *child_type;
char *struct_name;
@@
-907,13
+862,13
@@
decode_dst_structure (objfile, entry, code, version)
type = find_dst_structure (name);
if (type)
{
type = find_dst_structure (name);
if (type)
{
-
free ((PTR)
name);
+
xfree (
name);
return type;
}
type = create_new_type (objfile);
TYPE_NAME (type) = obstack_copy0 (&objfile->symbol_obstack,
name, strlen (name));
return type;
}
type = create_new_type (objfile);
TYPE_NAME (type) = obstack_copy0 (&objfile->symbol_obstack,
name, strlen (name));
-
free ((PTR)
name);
+
xfree (
name);
TYPE_CODE (type) = code;
TYPE_LENGTH (type) = DST_record (entry).size;
TYPE_NFIELDS (type) = DST_record (entry).nfields;
TYPE_CODE (type) = code;
TYPE_LENGTH (type) = DST_record (entry).size;
TYPE_NFIELDS (type) = DST_record (entry).nfields;
@@
-993,9
+948,7
@@
decode_dst_structure (objfile, entry, code, version)
}
static struct type *
}
static struct type *
-decode_dst_type (objfile, entry)
- struct objfile *objfile;
- dst_rec_ptr_t entry;
+decode_dst_type (struct objfile *objfile, dst_rec_ptr_t entry)
{
struct type *child_type, *type, *range_type, *index_type;
{
struct type *child_type, *type, *range_type, *index_type;
@@
-1059,9
+1012,7
@@
static struct symbol_list *dst_global_symbols = NULL;
static int total_globals = 0;
static void
static int total_globals = 0;
static void
-decode_dst_locstring (locstr, sym)
- char *locstr;
- struct symbol *sym;
+decode_dst_locstring (char *locstr, struct symbol *sym)
{
dst_loc_entry_t *entry, *next_entry;
CORE_ADDR temp;
{
dst_loc_entry_t *entry, *next_entry;
CORE_ADDR temp;
@@
-1178,11
+1129,8
@@
decode_dst_locstring (locstr, sym)
}
static struct symbol_list *
}
static struct symbol_list *
-process_dst_symbols (objfile, entry, name, nsyms_ret)
- struct objfile *objfile;
- dst_rec_ptr_t entry;
- char *name;
- int *nsyms_ret;
+process_dst_symbols (struct objfile *objfile, dst_rec_ptr_t entry, char *name,
+ int *nsyms_ret)
{
struct symbol_list *list = NULL, *element;
struct symbol *sym;
{
struct symbol_list *list = NULL, *element;
struct symbol *sym;
@@
-1320,11
+1268,8
@@
process_dst_symbols (objfile, entry, name, nsyms_ret)
static struct symbol *
static struct symbol *
-process_dst_function (objfile, entry, name, address)
- struct objfile *objfile;
- dst_rec_ptr_t entry;
- char *name;
- CORE_ADDR address;
+process_dst_function (struct objfile *objfile, dst_rec_ptr_t entry, char *name,
+ CORE_ADDR address)
{
struct symbol *sym;
struct type *type, *ftype;
{
struct symbol *sym;
struct type *type, *ftype;
@@
-1381,9
+1326,7
@@
process_dst_function (objfile, entry, name, address)
}
static struct block *
}
static struct block *
-process_dst_block (objfile, entry)
- struct objfile *objfile;
- dst_rec_ptr_t entry;
+process_dst_block (struct objfile *objfile, dst_rec_ptr_t entry)
{
struct block *block;
struct symbol *function = NULL;
{
struct block *block;
struct symbol *function = NULL;
@@
-1459,7
+1402,7
@@
process_dst_block (objfile, entry)
block->sym[symnum] = symlist->symbol;
block->sym[symnum] = symlist->symbol;
-
free ((PTR)
symlist);
+
xfree (
symlist);
symlist = nextsym;
symnum++;
}
symlist = nextsym;
symnum++;
}
@@
-1510,8
+1453,7
@@
process_dst_block (objfile, entry)
static void
static void
-read_dst_symtab (objfile)
- struct objfile *objfile;
+read_dst_symtab (struct objfile *objfile)
{
char *buffer;
dst_rec_ptr_t entry, file_table, root_block;
{
char *buffer;
dst_rec_ptr_t entry, file_table, root_block;
@@
-1556,7
+1498,7
@@
read_dst_symtab (objfile)
global_block->sym[symnum] =
dst_global_symbols->symbol;
global_block->sym[symnum] =
dst_global_symbols->symbol;
-
free ((PTR)
dst_global_symbols);
+
xfree (
dst_global_symbols);
dst_global_symbols = nextsym;
}
dst_global_symbols = NULL;
dst_global_symbols = nextsym;
}
dst_global_symbols = NULL;
@@
-1593,7
+1535,7
@@
read_dst_symtab (objfile)
{
element = struct_list;
struct_list = element->next;
{
element = struct_list;
struct_list = element->next;
-
free ((PTR)
element);
+
xfree (
element);
}
}
\f
}
}
\f
@@
-1607,9
+1549,7
@@
static unsigned long linetab_size;
external (unswapped) format in memory; we'll swap them as we enter
them into GDB's data structures. */
static int
external (unswapped) format in memory; we'll swap them as we enter
them into GDB's data structures. */
static int
-init_one_section (chan, secinfo)
- int chan;
- dst_sec *secinfo;
+init_one_section (int chan, dst_sec *secinfo)
{
if (secinfo->size == 0
|| lseek (chan, secinfo->position, 0) == -1
{
if (secinfo->size == 0
|| lseek (chan, secinfo->position, 0) == -1
@@
-1621,8
+1561,7
@@
init_one_section (chan, secinfo)
}
static int
}
static int
-init_dst_sections (chan)
- int chan;
+init_dst_sections (int chan)
{
if (!init_one_section (chan, &blocks_info) ||
{
if (!init_one_section (chan, &blocks_info) ||
@@
-1639,9
+1578,7
@@
struct section_offsets dst_symfile_faker =
{0};
void
{0};
void
-dst_symfile_offsets (objfile, addr)
- struct objfile *objfile;
- struct section_addr_info *addrs;
+dst_symfile_offsets (struct objfile *objfile, struct section_addr_info *addrs)
{
objfile->num_sections = 1;
objfile->section_offsets = &dst_symfile_faker;
{
objfile->num_sections = 1;
objfile->section_offsets = &dst_symfile_faker;
@@
-1664,7
+1601,7
@@
static struct sym_fns dst_sym_fns =
};
void
};
void
-_initialize_dstread ()
+_initialize_dstread (
void
)
{
add_symtab_fns (&dst_sym_fns);
}
{
add_symtab_fns (&dst_sym_fns);
}
This page took
0.028364 seconds
and
4
git commands to generate.