From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15237 invoked by alias); 17 Jan 2006 22:05:14 -0000 Received: (qmail 15223 invoked by uid 22791); 17 Jan 2006 22:05:09 -0000 X-Spam-Check-By: sourceware.org Received: from zproxy.gmail.com (HELO zproxy.gmail.com) (64.233.162.196) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 17 Jan 2006 22:05:06 +0000 Received: by zproxy.gmail.com with SMTP id 34so1382621nzf for ; Tue, 17 Jan 2006 14:05:04 -0800 (PST) Received: by 10.36.66.3 with SMTP id o3mr6297770nza; Tue, 17 Jan 2006 14:05:03 -0800 (PST) Received: by 10.37.2.42 with HTTP; Tue, 17 Jan 2006 14:05:03 -0800 (PST) Message-ID: <8f2776cb0601171405r58f4494ek4481ca4253099d7e@mail.gmail.com> Date: Tue, 17 Jan 2006 22:05:00 -0000 From: Jim Blandy To: GDB Patches Subject: Obvious: gdb_byte changes for dwarf2read.c MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-01/txt/msg00229.txt.bz2 gdb/ChangeLog: 2006-01-17 Jim Blandy * dwarf2read.c (struct dwarf2_per_objfile, struct comp_unit_head) (struct line_header, struct partial_die_info, struct dwarf_block): Use gdb_byte for members that refer to Dwarf section contents. (dwarf2_read_abbrevs, dwarf2_read_section, dwarf_decode_lines, dwarf_decode_macros, load_comp_unit, load_partial_dies, locate_pdi_sibling, partial_read_comp_unit_head, peek_die_abbrev, read_1_byte, read_1_signed_byte, read_2_bytes, read_4_bytes, read_8_bytes, read_address, read_attribute, read_attribute_value, read_comp_unit, read_comp_unit_head, read_die_and_children, read_die_and_siblings, read_full_die, read_indirect_string, read_initial_length, read_n_bytes, read_offset, read_partial_die, read_signed_leb128, read_string, read_unsigned_leb128, skip_children, skip_leb128, skip_one_die): Same. Index: gdb/dwarf2read.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/dwarf2read.c,v retrieving revision 1.189 diff -c -p -r1.189 dwarf2read.c *** gdb/dwarf2read.c 17 Jan 2006 14:47:31 -0000 1.189 --- gdb/dwarf2read.c 17 Jan 2006 21:39:31 -0000 *************** struct dwarf2_per_objfile *** 162,174 **** unsigned int eh_frame_size; /* Loaded data from the sections. */ ! char *info_buffer; ! char *abbrev_buffer; ! char *line_buffer; ! char *str_buffer; ! char *macinfo_buffer; ! char *ranges_buffer; ! char *loc_buffer; /* A list of all the compilation units. This is used to locate the target compilation unit of a particular reference. */ --- 162,174 ---- unsigned int eh_frame_size; /* Loaded data from the sections. */ ! gdb_byte *info_buffer; ! gdb_byte *abbrev_buffer; ! gdb_byte *line_buffer; ! gdb_byte *str_buffer; ! gdb_byte *macinfo_buffer; ! gdb_byte *ranges_buffer; ! gdb_byte *loc_buffer; /* A list of all the compilation units. This is used to locate the target compilation unit of a particular reference. */ *************** struct comp_unit_head *** 239,249 **** /* Pointer to this compilation unit header in the .debug_info section. */ ! char *cu_head_ptr; /* Pointer to the first die of this compilation unit. This will be the first byte following the compilation unit header. */ ! char *first_die_ptr; /* Pointer to the next compilation unit header in the program. */ struct comp_unit_head *next; --- 239,249 ---- /* Pointer to this compilation unit header in the .debug_info section. */ ! gdb_byte *cu_head_ptr; /* Pointer to the first die of this compilation unit. This will be the first byte following the compilation unit header. */ ! gdb_byte *first_die_ptr; /* Pointer to the next compilation unit header in the program. */ struct comp_unit_head *next; *************** struct line_header *** 425,431 **** /* The start and end of the statement program following this header. These point into dwarf2_per_objfile->line_buffer. */ ! char *statement_program_start, *statement_program_end; }; /* When we construct a partial symbol table entry we only --- 425,431 ---- /* The start and end of the statement program following this header. These point into dwarf2_per_objfile->line_buffer. */ ! gdb_byte *statement_program_start, *statement_program_end; }; /* When we construct a partial symbol table entry we only *************** struct partial_die_info *** 475,481 **** /* Pointer into the info_buffer pointing at the target of DW_AT_sibling, if any. */ ! char *sibling; /* If HAS_SPECIFICATION, the offset of the DIE referred to by DW_AT_specification (or DW_AT_abstract_origin or --- 475,481 ---- /* Pointer into the info_buffer pointing at the target of DW_AT_sibling, if any. */ ! gdb_byte *sibling; /* If HAS_SPECIFICATION, the offset of the DIE referred to by DW_AT_specification (or DW_AT_abstract_origin or *************** struct function_range *** 565,571 **** struct dwarf_block { unsigned int size; ! char *data; }; #ifndef ATTR_ALLOC_CHUNK --- 565,571 ---- struct dwarf_block { unsigned int size; ! gdb_byte *data; }; #ifndef ATTR_ALLOC_CHUNK *************** static void add_partial_namespace (struc *** 739,771 **** static void add_partial_enumeration (struct partial_die_info *enum_pdi, struct dwarf2_cu *cu); ! static char *locate_pdi_sibling (struct partial_die_info *orig_pdi, ! char *info_ptr, ! bfd *abfd, ! struct dwarf2_cu *cu); static void dwarf2_psymtab_to_symtab (struct partial_symtab *); static void psymtab_to_symtab_1 (struct partial_symtab *); ! char *dwarf2_read_section (struct objfile *, asection *); static void dwarf2_read_abbrevs (bfd *abfd, struct dwarf2_cu *cu); static void dwarf2_free_abbrev_table (void *); ! static struct abbrev_info *peek_die_abbrev (char *, unsigned int *, struct dwarf2_cu *); static struct abbrev_info *dwarf2_lookup_abbrev (unsigned int, struct dwarf2_cu *); ! static struct partial_die_info *load_partial_dies (bfd *, char *, int, struct dwarf2_cu *); ! static char *read_partial_die (struct partial_die_info *, ! struct abbrev_info *abbrev, unsigned int, ! bfd *, char *, struct dwarf2_cu *); static struct partial_die_info *find_partial_die (unsigned long, struct dwarf2_cu *); --- 739,771 ---- static void add_partial_enumeration (struct partial_die_info *enum_pdi, struct dwarf2_cu *cu); ! static gdb_byte *locate_pdi_sibling (struct partial_die_info *orig_pdi, ! gdb_byte *info_ptr, ! bfd *abfd, ! struct dwarf2_cu *cu); static void dwarf2_psymtab_to_symtab (struct partial_symtab *); static void psymtab_to_symtab_1 (struct partial_symtab *); ! gdb_byte *dwarf2_read_section (struct objfile *, asection *); static void dwarf2_read_abbrevs (bfd *abfd, struct dwarf2_cu *cu); static void dwarf2_free_abbrev_table (void *); ! static struct abbrev_info *peek_die_abbrev (gdb_byte *, unsigned int *, struct dwarf2_cu *); static struct abbrev_info *dwarf2_lookup_abbrev (unsigned int, struct dwarf2_cu *); ! static struct partial_die_info *load_partial_dies (bfd *, gdb_byte *, int, struct dwarf2_cu *); ! static gdb_byte *read_partial_die (struct partial_die_info *, ! struct abbrev_info *abbrev, unsigned i= nt, ! bfd *, gdb_byte *, struct dwarf2_cu *); static struct partial_die_info *find_partial_die (unsigned long, struct dwarf2_cu *); *************** static struct partial_die_info *find_par *** 773,818 **** static void fixup_partial_die (struct partial_die_info *, struct dwarf2_cu *); ! static char *read_full_die (struct die_info **, bfd *, char *, ! struct dwarf2_cu *, int *); ! static char *read_attribute (struct attribute *, struct attr_abbrev *, ! bfd *, char *, struct dwarf2_cu *); ! static char *read_attribute_value (struct attribute *, unsigned, ! bfd *, char *, struct dwarf2_cu *); ! static unsigned int read_1_byte (bfd *, char *); ! static int read_1_signed_byte (bfd *, char *); ! static unsigned int read_2_bytes (bfd *, char *); ! static unsigned int read_4_bytes (bfd *, char *); ! static unsigned long read_8_bytes (bfd *, char *); ! static CORE_ADDR read_address (bfd *, char *ptr, struct dwarf2_cu *, unsigned int *); ! static LONGEST read_initial_length (bfd *, char *, struct comp_unit_head *, unsigned int= *); ! static LONGEST read_offset (bfd *, char *, const struct comp_unit_head *, unsigned int *); ! static char *read_n_bytes (bfd *, char *, unsigned int); ! static char *read_string (bfd *, char *, unsigned int *); ! static char *read_indirect_string (bfd *, char *, const struct comp_unit_head *, ! unsigned int *); ! static unsigned long read_unsigned_leb128 (bfd *, char *, unsigned int *); ! static long read_signed_leb128 (bfd *, char *, unsigned int *); ! static char *skip_leb128 (bfd *, char *); static void set_cu_language (unsigned int, struct dwarf2_cu *); --- 773,819 ---- static void fixup_partial_die (struct partial_die_info *, struct dwarf2_cu *); ! static gdb_byte *read_full_die (struct die_info **, bfd *, gdb_byte *, ! struct dwarf2_cu *, int *); ! static gdb_byte *read_attribute (struct attribute *, struct attr_abbrev *, ! bfd *, gdb_byte *, struct dwarf2_cu *); ! static gdb_byte *read_attribute_value (struct attribute *, unsigned, ! bfd *, gdb_byte *, struct dwarf2_c= u *); ! static unsigned int read_1_byte (bfd *, gdb_byte *); ! static int read_1_signed_byte (bfd *, gdb_byte *); ! static unsigned int read_2_bytes (bfd *, gdb_byte *); ! static unsigned int read_4_bytes (bfd *, gdb_byte *); ! static unsigned long read_8_bytes (bfd *, gdb_byte *); ! static CORE_ADDR read_address (bfd *, gdb_byte *ptr, struct dwarf2_cu *, unsigned int *); ! static LONGEST read_initial_length (bfd *, gdb_byte *, struct comp_unit_head *, unsigned int= *); ! static LONGEST read_offset (bfd *, gdb_byte *, const struct comp_unit_hea= d *, unsigned int *); ! static gdb_byte *read_n_bytes (bfd *, gdb_byte *, unsigned int); ! static char *read_string (bfd *, gdb_byte *, unsigned int *); ! static char *read_indirect_string (bfd *, gdb_byte *, ! const struct comp_unit_head *, ! unsigned int *); ! static unsigned long read_unsigned_leb128 (bfd *, gdb_byte *, unsigned in= t *); ! static long read_signed_leb128 (bfd *, gdb_byte *, unsigned int *); ! static gdb_byte *skip_leb128 (bfd *, gdb_byte *); static void set_cu_language (unsigned int, struct dwarf2_cu *); *************** static void read_type_die (struct die_in *** 862,868 **** static char *determine_prefix (struct die_info *die, struct dwarf2_cu *); ! static char *typename_concat (struct obstack *, const char *prefix, const char *suffix, struct dwarf2_cu *); static void read_typedef (struct die_info *, struct dwarf2_cu *); --- 863,871 ---- static char *determine_prefix (struct die_info *die, struct dwarf2_cu *); ! static char *typename_concat (struct obstack *, ! const char *prefix, ! const char *suffix, struct dwarf2_cu *); static void read_typedef (struct die_info *, struct dwarf2_cu *); *************** static void read_tag_string_type (struct *** 938,953 **** static void read_subroutine_type (struct die_info *, struct dwarf2_cu *); ! static struct die_info *read_comp_unit (char *, bfd *, struct dwarf2_cu *= ); ! static struct die_info *read_die_and_children (char *info_ptr, bfd *abfd, struct dwarf2_cu *, ! char **new_info_ptr, struct die_info *parent); ! static struct die_info *read_die_and_siblings (char *info_ptr, bfd *abfd, struct dwarf2_cu *, ! char **new_info_ptr, struct die_info *parent); static void free_die_list (struct die_info *); --- 941,956 ---- static void read_subroutine_type (struct die_info *, struct dwarf2_cu *); ! static struct die_info *read_comp_unit (gdb_byte *, bfd *, struct dwarf2_cu *); ! static struct die_info *read_die_and_children (gdb_byte *info_ptr, bfd *a= bfd, struct dwarf2_cu *, ! gdb_byte **new_info_ptr, struct die_info *parent); ! static struct die_info *read_die_and_siblings (gdb_byte *info_ptr, bfd *a= bfd, struct dwarf2_cu *, ! gdb_byte **new_info_ptr, struct die_info *parent); static void free_die_list (struct die_info *); *************** static void *** 1022,1029 **** dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, struct dwarf2_cu *cu); ! static char *skip_one_die (char *info_ptr, struct abbrev_info *abbrev, ! struct dwarf2_cu *cu); static void free_stack_comp_unit (void *); --- 1025,1032 ---- dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, struct dwarf2_cu *cu); ! static gdb_byte *skip_one_die (gdb_byte *info_ptr, struct abbrev_info *ab= brev, ! struct dwarf2_cu *cu); static void free_stack_comp_unit (void *); *************** dwarf2_build_psymtabs_easy (struct objfi *** 1264,1272 **** /* Read in the comp unit header information from the debug_info at info_ptr. */ ! static char * read_comp_unit_head (struct comp_unit_head *cu_header, ! char *info_ptr, bfd *abfd) { int signed_addr; unsigned int bytes_read; --- 1267,1275 ---- /* Read in the comp unit header information from the debug_info at info_ptr. */ ! static gdb_byte * read_comp_unit_head (struct comp_unit_head *cu_header, ! gdb_byte *info_ptr, bfd *abfd) { int signed_addr; unsigned int bytes_read; *************** read_comp_unit_head (struct comp_unit_he *** 1288,1298 **** return info_ptr; } ! static char * ! partial_read_comp_unit_head (struct comp_unit_head *header, char *info_pt= r, bfd *abfd) { ! char *beg_of_comp_unit =3D info_ptr; info_ptr =3D read_comp_unit_head (header, info_ptr, abfd); --- 1291,1301 ---- return info_ptr; } ! static gdb_byte * ! partial_read_comp_unit_head (struct comp_unit_head *header, gdb_byte *info_ptr, bfd *abfd) { ! gdb_byte *beg_of_comp_unit =3D info_ptr; info_ptr =3D read_comp_unit_head (header, info_ptr, abfd); *************** dwarf2_build_psymtabs_hard (struct objfi *** 1388,1395 **** /* Instead of reading this into a big buffer, we should probably use mmap() on architectures that support it. (FIXME) */ bfd *abfd =3D objfile->obfd; ! char *info_ptr; ! char *beg_of_comp_unit; struct partial_die_info comp_unit_die; struct partial_symtab *pst; struct cleanup *back_to; --- 1391,1398 ---- /* Instead of reading this into a big buffer, we should probably use mmap() on architectures that support it. (FIXME) */ bfd *abfd =3D objfile->obfd; ! gdb_byte *info_ptr; ! gdb_byte *beg_of_comp_unit; struct partial_die_info comp_unit_die; struct partial_symtab *pst; struct cleanup *back_to; *************** static void *** 1555,1561 **** load_comp_unit (struct dwarf2_per_cu_data *this_cu, struct objfile *objfi= le) { bfd *abfd =3D objfile->obfd; ! char *info_ptr, *beg_of_comp_unit; struct partial_die_info comp_unit_die; struct dwarf2_cu *cu; struct abbrev_info *abbrev; --- 1558,1564 ---- load_comp_unit (struct dwarf2_per_cu_data *this_cu, struct objfile *objfi= le) { bfd *abfd =3D objfile->obfd; ! gdb_byte *info_ptr, *beg_of_comp_unit; struct partial_die_info comp_unit_die; struct dwarf2_cu *cu; struct abbrev_info *abbrev; *************** create_all_comp_units (struct objfile *o *** 1614,1620 **** int n_allocated; int n_comp_units; struct dwarf2_per_cu_data **all_comp_units; ! char *info_ptr =3D dwarf2_per_objfile->info_buffer; n_comp_units =3D 0; n_allocated =3D 10; --- 1617,1623 ---- int n_allocated; int n_comp_units; struct dwarf2_per_cu_data **all_comp_units; ! gdb_byte *info_ptr =3D dwarf2_per_objfile->info_buffer; n_comp_units =3D 0; n_allocated =3D 10; *************** create_all_comp_units (struct objfile *o *** 1624,1630 **** while (info_ptr < dwarf2_per_objfile->info_buffer + dwarf2_per_objfile->info_size) { struct comp_unit_head cu_header; ! char *beg_of_comp_unit; struct dwarf2_per_cu_data *this_cu; unsigned long offset; unsigned int bytes_read; --- 1627,1633 ---- while (info_ptr < dwarf2_per_objfile->info_buffer + dwarf2_per_objfile->info_size) { struct comp_unit_head cu_header; ! gdb_byte *beg_of_comp_unit; struct dwarf2_per_cu_data *this_cu; unsigned long offset; unsigned int bytes_read; *************** add_partial_enumeration (struct partial_ *** 2138,2144 **** the initial number. */ static struct abbrev_info * ! peek_die_abbrev (char *info_ptr, unsigned int *bytes_read, struct dwarf2_cu *cu) { bfd *abfd =3D cu->objfile->obfd; --- 2141,2147 ---- the initial number. */ static struct abbrev_info * ! peek_die_abbrev (gdb_byte *info_ptr, unsigned int *bytes_read, struct dwarf2_cu *cu) { bfd *abfd =3D cu->objfile->obfd; *************** peek_die_abbrev (char *info_ptr, unsigne *** 2164,2171 **** pointer to the end of a series of DIEs, terminated by an empty DIE. Any children of the skipped DIEs will also be skipped. */ ! static char * ! skip_children (char *info_ptr, struct dwarf2_cu *cu) { struct abbrev_info *abbrev; unsigned int bytes_read; --- 2167,2174 ---- pointer to the end of a series of DIEs, terminated by an empty DIE. Any children of the skipped DIEs will also be skipped. */ ! static gdb_byte * ! skip_children (gdb_byte *info_ptr, struct dwarf2_cu *cu) { struct abbrev_info *abbrev; unsigned int bytes_read; *************** skip_children (char *info_ptr, struct dw *** 2186,2193 **** ABBREV. Returns a pointer to this DIE's sibling, skipping any children. */ ! static char * ! skip_one_die (char *info_ptr, struct abbrev_info *abbrev, struct dwarf2_cu *cu) { unsigned int bytes_read; --- 2189,2196 ---- ABBREV. Returns a pointer to this DIE's sibling, skipping any children. */ ! static gdb_byte * ! skip_one_die (gdb_byte *info_ptr, struct abbrev_info *abbrev, struct dwarf2_cu *cu) { unsigned int bytes_read; *************** skip_one_die (char *info_ptr, struct abb *** 2283,2290 **** /* Locate ORIG_PDI's sibling; INFO_PTR should point to the start of the next DIE after ORIG_PDI. */ ! static char * ! locate_pdi_sibling (struct partial_die_info *orig_pdi, char *info_ptr, bfd *abfd, struct dwarf2_cu *cu) { /* Do we know the sibling already? */ --- 2286,2293 ---- /* Locate ORIG_PDI's sibling; INFO_PTR should point to the start of the next DIE after ORIG_PDI. */ ! static gdb_byte * ! locate_pdi_sibling (struct partial_die_info *orig_pdi, gdb_byte *info_ptr, bfd *abfd, struct dwarf2_cu *cu) { /* Do we know the sibling already? */ *************** load_full_comp_unit (struct dwarf2_per_c *** 2485,2491 **** bfd *abfd =3D pst->objfile->obfd; struct dwarf2_cu *cu; unsigned long offset; ! char *info_ptr; struct cleanup *back_to, *free_cu_cleanup; struct attribute *attr; CORE_ADDR baseaddr; --- 2488,2494 ---- bfd *abfd =3D pst->objfile->obfd; struct dwarf2_cu *cu; unsigned long offset; ! gdb_byte *info_ptr; struct cleanup *back_to, *free_cu_cleanup; struct attribute *attr; CORE_ADDR baseaddr; *************** dwarf2_get_pc_bounds (struct die_info *d *** 3058,3064 **** CORE_ADDR base; int found_base; unsigned int dummy; ! char *buffer; CORE_ADDR marker; int low_set; --- 3061,3067 ---- CORE_ADDR base; int found_base; unsigned int dummy; ! gdb_byte *buffer; CORE_ADDR marker; int low_set; *************** dwarf2_attach_fields_to_type (struct fie *** 3445,3455 **** if (fip->nbaseclasses) { int num_bytes =3D B_BYTES (fip->nbaseclasses); ! char *pointer; ALLOCATE_CPLUS_STRUCT_TYPE (type); ! pointer =3D (char *) TYPE_ALLOC (type, num_bytes); ! TYPE_FIELD_VIRTUAL_BITS (type) =3D (B_TYPE *) pointer; B_CLRALL (TYPE_FIELD_VIRTUAL_BITS (type), fip->nbaseclasses); TYPE_N_BASECLASSES (type) =3D fip->nbaseclasses; } --- 3448,3458 ---- if (fip->nbaseclasses) { int num_bytes =3D B_BYTES (fip->nbaseclasses); ! unsigned char *pointer; ALLOCATE_CPLUS_STRUCT_TYPE (type); ! pointer =3D TYPE_ALLOC (type, num_bytes); ! TYPE_FIELD_VIRTUAL_BITS (type) =3D pointer; B_CLRALL (TYPE_FIELD_VIRTUAL_BITS (type), fip->nbaseclasses); TYPE_N_BASECLASSES (type) =3D fip->nbaseclasses; } *************** read_subrange_type (struct die_info *die *** 4836,4842 **** /* Read a whole compilation unit into a linked list of dies. */ static struct die_info * ! read_comp_unit (char *info_ptr, bfd *abfd, struct dwarf2_cu *cu) { return read_die_and_children (info_ptr, abfd, cu, &info_ptr, NULL); } --- 4839,4845 ---- /* Read a whole compilation unit into a linked list of dies. */ static struct die_info * ! read_comp_unit (gdb_byte *info_ptr, bfd *abfd, struct dwarf2_cu *cu) { return read_die_and_children (info_ptr, abfd, cu, &info_ptr, NULL); } *************** read_comp_unit (char *info_ptr, bfd *abf *** 4848,4860 **** is the parent of the die in question. */ static struct die_info * ! read_die_and_children (char *info_ptr, bfd *abfd, struct dwarf2_cu *cu, ! char **new_info_ptr, struct die_info *parent) { struct die_info *die; ! char *cur_ptr; int has_children; cur_ptr =3D read_full_die (&die, abfd, info_ptr, cu, &has_children); --- 4851,4863 ---- is the parent of the die in question. */ static struct die_info * ! read_die_and_children (gdb_byte *info_ptr, bfd *abfd, struct dwarf2_cu *cu, ! gdb_byte **new_info_ptr, struct die_info *parent) { struct die_info *die; ! gdb_byte *cur_ptr; int has_children; cur_ptr =3D read_full_die (&die, abfd, info_ptr, cu, &has_children); *************** read_die_and_children (char *info_ptr, b *** 4881,4893 **** in read_die_and_children. */ static struct die_info * ! read_die_and_siblings (char *info_ptr, bfd *abfd, struct dwarf2_cu *cu, ! char **new_info_ptr, struct die_info *parent) { struct die_info *first_die, *last_sibling; ! char *cur_ptr; cur_ptr =3D info_ptr; first_die =3D last_sibling =3D NULL; --- 4884,4896 ---- in read_die_and_children. */ static struct die_info * ! read_die_and_siblings (gdb_byte *info_ptr, bfd *abfd, struct dwarf2_cu *cu, ! gdb_byte **new_info_ptr, struct die_info *parent) { struct die_info *first_die, *last_sibling; ! gdb_byte *cur_ptr; cur_ptr =3D info_ptr; first_die =3D last_sibling =3D NULL; *************** free_die_list (struct die_info *dies) *** 4940,4958 **** /* Read the contents of the section at OFFSET and of size SIZE from the object file specified by OBJFILE into the objfile_obstack and return it. */ ! char * dwarf2_read_section (struct objfile *objfile, asection *sectp) { bfd *abfd =3D objfile->obfd; ! char *buf, *retbuf; bfd_size_type size =3D bfd_get_section_size (sectp); if (size =3D=3D 0) return NULL; ! buf =3D (char *) obstack_alloc (&objfile->objfile_obstack, size); ! retbuf ! =3D (char *) symfile_relocate_debug_section (abfd, sectp, (bfd_byte *= ) buf); if (retbuf !=3D NULL) return retbuf; --- 4943,4960 ---- /* Read the contents of the section at OFFSET and of size SIZE from the object file specified by OBJFILE into the objfile_obstack and return it. */ ! gdb_byte * dwarf2_read_section (struct objfile *objfile, asection *sectp) { bfd *abfd =3D objfile->obfd; ! gdb_byte *buf, *retbuf; bfd_size_type size =3D bfd_get_section_size (sectp); if (size =3D=3D 0) return NULL; ! buf =3D obstack_alloc (&objfile->objfile_obstack, size); ! retbuf =3D symfile_relocate_debug_section (abfd, sectp, buf); if (retbuf !=3D NULL) return retbuf; *************** static void *** 4974,4980 **** dwarf2_read_abbrevs (bfd *abfd, struct dwarf2_cu *cu) { struct comp_unit_head *cu_header =3D &cu->header; ! char *abbrev_ptr; struct abbrev_info *cur_abbrev; unsigned int abbrev_number, bytes_read, abbrev_name; unsigned int abbrev_form, hash_number; --- 4976,4982 ---- dwarf2_read_abbrevs (bfd *abfd, struct dwarf2_cu *cu) { struct comp_unit_head *cu_header =3D &cu->header; ! gdb_byte *abbrev_ptr; struct abbrev_info *cur_abbrev; unsigned int abbrev_number, bytes_read, abbrev_name; unsigned int abbrev_form, hash_number; *************** is_type_tag_for_partial (int tag) *** 5139,5145 **** /* Load all DIEs that are interesting for partial symbols into memory. */ static struct partial_die_info * ! load_partial_dies (bfd *abfd, char *info_ptr, int building_psymtab, struct dwarf2_cu *cu) { struct partial_die_info *part_die; --- 5141,5147 ---- /* Load all DIEs that are interesting for partial symbols into memory. */ static struct partial_die_info * ! load_partial_dies (bfd *abfd, gdb_byte *info_ptr, int building_psymtab, struct dwarf2_cu *cu) { struct partial_die_info *part_die; *************** load_partial_dies (bfd *abfd, char *info *** 5335,5345 **** /* Read a minimal amount of information into the minimal die structure. = */ ! static char * read_partial_die (struct partial_die_info *part_die, struct abbrev_info *abbrev, unsigned int abbrev_len, bfd *abfd, ! char *info_ptr, struct dwarf2_cu *cu) { unsigned int bytes_read, i; struct attribute attr; --- 5337,5347 ---- /* Read a minimal amount of information into the minimal die structure. = */ ! static gdb_byte * read_partial_die (struct partial_die_info *part_die, struct abbrev_info *abbrev, unsigned int abbrev_len, bfd *abfd, ! gdb_byte *info_ptr, struct dwarf2_cu *cu) { unsigned int bytes_read, i; struct attribute attr; *************** fixup_partial_die (struct partial_die_in *** 5544,5551 **** child, sibling, and parent fields. Set HAS_CHILDREN to tell whether the die has children or not. */ ! static char * ! read_full_die (struct die_info **diep, bfd *abfd, char *info_ptr, struct dwarf2_cu *cu, int *has_children) { unsigned int abbrev_number, bytes_read, i, offset; --- 5546,5553 ---- child, sibling, and parent fields. Set HAS_CHILDREN to tell whether the die has children or not. */ ! static gdb_byte * ! read_full_die (struct die_info **diep, bfd *abfd, gdb_byte *info_ptr, struct dwarf2_cu *cu, int *has_children) { unsigned int abbrev_number, bytes_read, i, offset; *************** read_full_die (struct die_info **diep, b *** 5628,5636 **** /* Read an attribute value described by an attribute form. */ ! static char * read_attribute_value (struct attribute *attr, unsigned form, ! bfd *abfd, char *info_ptr, struct dwarf2_cu *cu) { struct comp_unit_head *cu_header =3D &cu->header; --- 5630,5638 ---- /* Read an attribute value described by an attribute form. */ ! static gdb_byte * read_attribute_value (struct attribute *attr, unsigned form, ! bfd *abfd, gdb_byte *info_ptr, struct dwarf2_cu *cu) { struct comp_unit_head *cu_header =3D &cu->header; *************** read_attribute_value (struct attribute * *** 5750,5758 **** /* Read an attribute described by an abbreviated attribute. */ ! static char * read_attribute (struct attribute *attr, struct attr_abbrev *abbrev, ! bfd *abfd, char *info_ptr, struct dwarf2_cu *cu) { attr->name =3D abbrev->name; return read_attribute_value (attr, abbrev->form, abfd, info_ptr, cu); --- 5752,5760 ---- /* Read an attribute described by an abbreviated attribute. */ ! static gdb_byte * read_attribute (struct attribute *attr, struct attr_abbrev *abbrev, ! bfd *abfd, gdb_byte *info_ptr, struct dwarf2_cu *cu) { attr->name =3D abbrev->name; return read_attribute_value (attr, abbrev->form, abfd, info_ptr, cu); *************** read_attribute (struct attribute *attr, *** 5761,5809 **** /* read dwarf information from a buffer */ static unsigned int ! read_1_byte (bfd *abfd, char *buf) { ! return bfd_get_8 (abfd, (bfd_byte *) buf); } static int ! read_1_signed_byte (bfd *abfd, char *buf) { ! return bfd_get_signed_8 (abfd, (bfd_byte *) buf); } static unsigned int ! read_2_bytes (bfd *abfd, char *buf) { ! return bfd_get_16 (abfd, (bfd_byte *) buf); } static int ! read_2_signed_bytes (bfd *abfd, char *buf) { ! return bfd_get_signed_16 (abfd, (bfd_byte *) buf); } static unsigned int ! read_4_bytes (bfd *abfd, char *buf) { ! return bfd_get_32 (abfd, (bfd_byte *) buf); } static int ! read_4_signed_bytes (bfd *abfd, char *buf) { ! return bfd_get_signed_32 (abfd, (bfd_byte *) buf); } static unsigned long ! read_8_bytes (bfd *abfd, char *buf) { ! return bfd_get_64 (abfd, (bfd_byte *) buf); } static CORE_ADDR ! read_address (bfd *abfd, char *buf, struct dwarf2_cu *cu, unsigned int *bytes_read) { struct comp_unit_head *cu_header =3D &cu->header; --- 5763,5811 ---- /* read dwarf information from a buffer */ static unsigned int ! read_1_byte (bfd *abfd, gdb_byte *buf) { ! return bfd_get_8 (abfd, buf); } static int ! read_1_signed_byte (bfd *abfd, gdb_byte *buf) { ! return bfd_get_signed_8 (abfd, buf); } static unsigned int ! read_2_bytes (bfd *abfd, gdb_byte *buf) { ! return bfd_get_16 (abfd, buf); } static int ! read_2_signed_bytes (bfd *abfd, gdb_byte *buf) { ! return bfd_get_signed_16 (abfd, buf); } static unsigned int ! read_4_bytes (bfd *abfd, gdb_byte *buf) { ! return bfd_get_32 (abfd, buf); } static int ! read_4_signed_bytes (bfd *abfd, gdb_byte *buf) { ! return bfd_get_signed_32 (abfd, buf); } static unsigned long ! read_8_bytes (bfd *abfd, gdb_byte *buf) { ! return bfd_get_64 (abfd, buf); } static CORE_ADDR ! read_address (bfd *abfd, gdb_byte *buf, struct dwarf2_cu *cu, unsigned int *bytes_read) { struct comp_unit_head *cu_header =3D &cu->header; *************** read_address (bfd *abfd, char *buf, stru *** 5814,5826 **** switch (cu_header->addr_size) { case 2: ! retval =3D bfd_get_signed_16 (abfd, (bfd_byte *) buf); break; case 4: ! retval =3D bfd_get_signed_32 (abfd, (bfd_byte *) buf); break; case 8: ! retval =3D bfd_get_signed_64 (abfd, (bfd_byte *) buf); break; default: internal_error (__FILE__, __LINE__, --- 5816,5828 ---- switch (cu_header->addr_size) { case 2: ! retval =3D bfd_get_signed_16 (abfd, buf); break; case 4: ! retval =3D bfd_get_signed_32 (abfd, buf); break; case 8: ! retval =3D bfd_get_signed_64 (abfd, buf); break; default: internal_error (__FILE__, __LINE__, *************** read_address (bfd *abfd, char *buf, stru *** 5833,5845 **** switch (cu_header->addr_size) { case 2: ! retval =3D bfd_get_16 (abfd, (bfd_byte *) buf); break; case 4: ! retval =3D bfd_get_32 (abfd, (bfd_byte *) buf); break; case 8: ! retval =3D bfd_get_64 (abfd, (bfd_byte *) buf); break; default: internal_error (__FILE__, __LINE__, --- 5835,5847 ---- switch (cu_header->addr_size) { case 2: ! retval =3D bfd_get_16 (abfd, buf); break; case 4: ! retval =3D bfd_get_32 (abfd, buf); break; case 8: ! retval =3D bfd_get_64 (abfd, buf); break; default: internal_error (__FILE__, __LINE__, *************** read_address (bfd *abfd, char *buf, stru *** 5896,5915 **** ] */ static LONGEST ! read_initial_length (bfd *abfd, char *buf, struct comp_unit_head *cu_head= er, unsigned int *bytes_read) { ! LONGEST length =3D bfd_get_32 (abfd, (bfd_byte *) buf); if (length =3D=3D 0xffffffff) { ! length =3D bfd_get_64 (abfd, (bfd_byte *) buf + 4); *bytes_read =3D 12; } else if (length =3D=3D 0) { /* Handle the (non-standard) 64-bit DWARF2 format used by IRIX. */ ! length =3D bfd_get_64 (abfd, (bfd_byte *) buf); *bytes_read =3D 8; } else --- 5898,5917 ---- ] */ static LONGEST ! read_initial_length (bfd *abfd, gdb_byte *buf, struct comp_unit_head *cu_header, unsigned int *bytes_read) { ! LONGEST length =3D bfd_get_32 (abfd, buf); if (length =3D=3D 0xffffffff) { ! length =3D bfd_get_64 (abfd, buf + 4); *bytes_read =3D 12; } else if (length =3D=3D 0) { /* Handle the (non-standard) 64-bit DWARF2 format used by IRIX. */ ! length =3D bfd_get_64 (abfd, buf); *bytes_read =3D 8; } else *************** read_initial_length (bfd *abfd, char *bu *** 5940,5946 **** given by cu_header->offset_size. */ static LONGEST ! read_offset (bfd *abfd, char *buf, const struct comp_unit_head *cu_header, unsigned int *bytes_read) { LONGEST retval =3D 0; --- 5942,5948 ---- given by cu_header->offset_size. */ static LONGEST ! read_offset (bfd *abfd, gdb_byte *buf, const struct comp_unit_head *cu_he= ader, unsigned int *bytes_read) { LONGEST retval =3D 0; *************** read_offset (bfd *abfd, char *buf, const *** 5948,5958 **** switch (cu_header->offset_size) { case 4: ! retval =3D bfd_get_32 (abfd, (bfd_byte *) buf); *bytes_read =3D 4; break; case 8: ! retval =3D bfd_get_64 (abfd, (bfd_byte *) buf); *bytes_read =3D 8; break; default: --- 5950,5960 ---- switch (cu_header->offset_size) { case 4: ! retval =3D bfd_get_32 (abfd, buf); *bytes_read =3D 4; break; case 8: ! retval =3D bfd_get_64 (abfd, buf); *bytes_read =3D 8; break; default: *************** read_offset (bfd *abfd, char *buf, const *** 5964,5971 **** return retval; } ! static char * ! read_n_bytes (bfd *abfd, char *buf, unsigned int size) { /* If the size of a host char is 8 bits, we can return a pointer to the buffer, otherwise we have to copy the data to a buffer --- 5966,5973 ---- return retval; } ! static gdb_byte * ! read_n_bytes (bfd *abfd, gdb_byte *buf, unsigned int size) { /* If the size of a host char is 8 bits, we can return a pointer to the buffer, otherwise we have to copy the data to a buffer *************** read_n_bytes (bfd *abfd, char *buf, unsi *** 5975,5981 **** } static char * ! read_string (bfd *abfd, char *buf, unsigned int *bytes_read_ptr) { /* If the size of a host char is 8 bits, we can return a pointer to the string, otherwise we have to copy the string to a buffer --- 5977,5983 ---- } static char * ! read_string (bfd *abfd, gdb_byte *buf, unsigned int *bytes_read_ptr) { /* If the size of a host char is 8 bits, we can return a pointer to the string, otherwise we have to copy the string to a buffer *************** read_string (bfd *abfd, char *buf, unsig *** 5986,5997 **** *bytes_read_ptr =3D 1; return NULL; } ! *bytes_read_ptr =3D strlen (buf) + 1; ! return buf; } static char * ! read_indirect_string (bfd *abfd, char *buf, const struct comp_unit_head *cu_header, unsigned int *bytes_read_ptr) { --- 5988,5999 ---- *bytes_read_ptr =3D 1; return NULL; } ! *bytes_read_ptr =3D strlen ((char *) buf) + 1; ! return (char *) buf; } static char * ! read_indirect_string (bfd *abfd, gdb_byte *buf, const struct comp_unit_head *cu_header, unsigned int *bytes_read_ptr) { *************** read_indirect_string (bfd *abfd, char *b *** 6013,6023 **** gdb_assert (HOST_CHAR_BIT =3D=3D 8); if (dwarf2_per_objfile->str_buffer[str_offset] =3D=3D '\0') return NULL; ! return dwarf2_per_objfile->str_buffer + str_offset; } static unsigned long ! read_unsigned_leb128 (bfd *abfd, char *buf, unsigned int *bytes_read_ptr) { unsigned long result; unsigned int num_read; --- 6015,6025 ---- gdb_assert (HOST_CHAR_BIT =3D=3D 8); if (dwarf2_per_objfile->str_buffer[str_offset] =3D=3D '\0') return NULL; ! return (char *) (dwarf2_per_objfile->str_buffer + str_offset); } static unsigned long ! read_unsigned_leb128 (bfd *abfd, gdb_byte *buf, unsigned int *bytes_read_= ptr) { unsigned long result; unsigned int num_read; *************** read_unsigned_leb128 (bfd *abfd, char *b *** 6030,6036 **** i =3D 0; while (1) { ! byte =3D bfd_get_8 (abfd, (bfd_byte *) buf); buf++; num_read++; result |=3D ((unsigned long)(byte & 127) << shift); --- 6032,6038 ---- i =3D 0; while (1) { ! byte =3D bfd_get_8 (abfd, buf); buf++; num_read++; result |=3D ((unsigned long)(byte & 127) << shift); *************** read_unsigned_leb128 (bfd *abfd, char *b *** 6045,6051 **** } static long ! read_signed_leb128 (bfd *abfd, char *buf, unsigned int *bytes_read_ptr) { long result; int i, shift, num_read; --- 6047,6053 ---- } static long ! read_signed_leb128 (bfd *abfd, gdb_byte *buf, unsigned int *bytes_read_pt= r) { long result; int i, shift, num_read; *************** read_signed_leb128 (bfd *abfd, char *buf *** 6057,6063 **** i =3D 0; while (1) { ! byte =3D bfd_get_8 (abfd, (bfd_byte *) buf); buf++; num_read++; result |=3D ((long)(byte & 127) << shift); --- 6059,6065 ---- i =3D 0; while (1) { ! byte =3D bfd_get_8 (abfd, buf); buf++; num_read++; result |=3D ((long)(byte & 127) << shift); *************** read_signed_leb128 (bfd *abfd, char *buf *** 6075,6088 **** /* Return a pointer to just past the end of an LEB128 number in BUF. */ ! static char * ! skip_leb128 (bfd *abfd, char *buf) { int byte; while (1) { ! byte =3D bfd_get_8 (abfd, (bfd_byte *) buf); buf++; if ((byte & 128) =3D=3D 0) return buf; --- 6077,6090 ---- /* Return a pointer to just past the end of an LEB128 number in BUF. */ ! static gdb_byte * ! skip_leb128 (bfd *abfd, gdb_byte *buf) { int byte; while (1) { ! byte =3D bfd_get_8 (abfd, buf); buf++; if ((byte & 128) =3D=3D 0) return buf; *************** dwarf_decode_line_header (unsigned int o *** 6281,6287 **** { struct cleanup *back_to; struct line_header *lh; ! char *line_ptr; unsigned int bytes_read; int i; char *cur_dir, *cur_file; --- 6283,6289 ---- { struct cleanup *back_to; struct line_header *lh; ! gdb_byte *line_ptr; unsigned int bytes_read; int i; char *cur_dir, *cur_file; *************** dwarf_decode_line_header (unsigned int o *** 6333,6339 **** lh->opcode_base =3D read_1_byte (abfd, line_ptr); line_ptr +=3D 1; lh->standard_opcode_lengths ! =3D (unsigned char *) xmalloc (lh->opcode_base * sizeof (unsigned cha= r)); lh->standard_opcode_lengths[0] =3D 1; /* This should never be used anyway. */ for (i =3D 1; i < lh->opcode_base; ++i) --- 6335,6341 ---- lh->opcode_base =3D read_1_byte (abfd, line_ptr); line_ptr +=3D 1; lh->standard_opcode_lengths ! =3D xmalloc (lh->opcode_base * sizeof (lh->standard_opcode_lengths[0]= )); lh->standard_opcode_lengths[0] =3D 1; /* This should never be used anyway. */ for (i =3D 1; i < lh->opcode_base; ++i) *************** static void *** 6445,6452 **** dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd, struct dwarf2_cu *cu, struct partial_symtab *pst) { ! char *line_ptr; ! char *line_end; unsigned int bytes_read; unsigned char op_code, extended_op, adj_opcode; CORE_ADDR baseaddr; --- 6447,6454 ---- dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd, struct dwarf2_cu *cu, struct partial_symtab *pst) { ! gdb_byte *line_ptr; ! gdb_byte *line_end; unsigned int bytes_read; unsigned char op_code, extended_op, adj_opcode; CORE_ADDR baseaddr; *************** decode_locdesc (struct dwarf_block *blk, *** 8585,8595 **** struct comp_unit_head *cu_header =3D &cu->header; int i; int size =3D blk->size; ! char *data =3D blk->data; CORE_ADDR stack[64]; int stacki; unsigned int bytes_read, unsnd; ! unsigned char op; i =3D 0; stacki =3D 0; --- 8587,8597 ---- struct comp_unit_head *cu_header =3D &cu->header; int i; int size =3D blk->size; ! gdb_byte *data =3D blk->data; CORE_ADDR stack[64]; int stacki; unsigned int bytes_read, unsnd; ! gdb_byte op; i =3D 0; stacki =3D 0; *************** dwarf_decode_macros (struct line_header *** 9073,9079 **** char *comp_dir, bfd *abfd, struct dwarf2_cu *cu) { ! char *mac_ptr, *mac_end; struct macro_source_file *current_file =3D 0; if (dwarf2_per_objfile->macinfo_buffer =3D=3D NULL) --- 9075,9081 ---- char *comp_dir, bfd *abfd, struct dwarf2_cu *cu) { ! gdb_byte *mac_ptr, *mac_end; struct macro_source_file *current_file =3D 0; if (dwarf2_per_objfile->macinfo_buffer =3D=3D NULL)