#include <stdio.h>#include <assert.h>#include <bfd.h>#include "ieee.h"#include "bucomm.h"#include <libiberty.h>#include "debug.h"#include "budbg.h"Include dependency graph for ieee.c:

Go to the source code of this file.
Classes | |
| struct | ieee_block |
| struct | ieee_blockstack |
| struct | ieee_var |
| struct | ieee_vars |
| struct | ieee_type |
| struct | ieee_types |
| struct | ieee_tag |
| struct | ieee_info |
| struct | ieee_buf |
| struct | ieee_buflist |
| struct | ieee_range |
| struct | ieee_type_class |
| struct | ieee_write_type |
| struct | ieee_type_stack |
| struct | ieee_name_type |
| struct | ieee_name_type_hash_table |
| struct | ieee_name_type_hash_entry |
| struct | ieee_defined_enum |
| struct | ieee_modified_type |
| struct | ieee_modified_array_type |
| struct | ieee_pending_parm |
| struct | ieee_handle |
Defines | |
| #define | BLOCKSTACK_SIZE (16) |
| #define | BUILTIN_TYPE_COUNT (60) |
| #define | BASEFLAGS_PRIVATE (0x1) |
| #define | BASEFLAGS_VIRTUAL (0x2) |
| #define | BASEFLAGS_FRIEND (0x10) |
| #define | CXXFLAGS_VISIBILITY (0x3) |
| #define | CXXFLAGS_VISIBILITY_PUBLIC (0x0) |
| #define | CXXFLAGS_VISIBILITY_PRIVATE (0x1) |
| #define | CXXFLAGS_VISIBILITY_PROTECTED (0x2) |
| #define | CXXFLAGS_STATIC (0x4) |
| #define | CXXFLAGS_OVERRIDE (0x8) |
| #define | CXXFLAGS_FRIEND (0x10) |
| #define | CXXFLAGS_CONST (0x20) |
| #define | CXXFLAGS_VOLATILE (0x40) |
| #define | CXXFLAGS_OVERLOADED (0x80) |
| #define | CXXFLAGS_OPERATOR (0x100) |
| #define | CXXFLAGS_CTORDTOR (0x400) |
| #define | CXXFLAGS_CTOR (0x200) |
| #define | CXXFLAGS_INLINE (0x800) |
| #define | EXPR_STACK_SIZE (10) |
| #define | IEEE_BUFSIZE (490) |
| #define | ieee_buffer_emptyp(buflist) ((buflist)->head == NULL) |
| #define | ieee_write_byte(info, b) |
| #define | ieee_name_type_hash_lookup(table, string, create, copy) |
| #define | ieee_name_type_hash_traverse(table, func, info) |
Enumerations | |
| enum | builtin_types { builtin_unknown = 0, builtin_void = 1, builtin_signed_char = 2, builtin_unsigned_char = 3, builtin_signed_short_int = 4, builtin_unsigned_short_int = 5, builtin_signed_long = 6, builtin_unsigned_long = 7, builtin_signed_long_long = 8, builtin_unsigned_long_long = 9, builtin_float = 10, builtin_double = 11, builtin_long_double = 12, builtin_long_long_double = 13, builtin_quoted_string = 14, builtin_instruction_address = 15, builtin_int = 16, builtin_unsigned = 17, builtin_unsigned_int = 18, builtin_char = 19, builtin_long = 20, builtin_short = 21, builtin_unsigned_short = 22, builtin_short_int = 23, builtin_signed_short = 24, builtin_bcd_float = 25 } |
Functions | |
| static void ieee_error | PARAMS ((struct ieee_info *, const bfd_byte *, const char *)) |
| static void ieee_eof | PARAMS ((struct ieee_info *)) |
| static char *savestring | PARAMS ((const char *, unsigned long)) |
| static boolean ieee_read_number | PARAMS ((struct ieee_info *, const bfd_byte **, bfd_vma *)) |
| static boolean ieee_read_optional_number | PARAMS ((struct ieee_info *, const bfd_byte **, bfd_vma *, boolean *)) |
| static boolean ieee_read_id | PARAMS ((struct ieee_info *, const bfd_byte **, const char **, unsigned long *)) |
| static boolean ieee_read_optional_id | PARAMS ((struct ieee_info *, const bfd_byte **, const char **, unsigned long *, boolean *)) |
| static debug_type ieee_builtin_type | PARAMS ((struct ieee_info *, const bfd_byte *, unsigned int)) |
| static boolean ieee_alloc_type | PARAMS ((struct ieee_info *, unsigned int, boolean)) |
| static boolean ieee_read_type_index | PARAMS ((struct ieee_info *, const bfd_byte **, debug_type *)) |
| static int ieee_regno_to_genreg | PARAMS ((bfd *, int)) |
| static boolean parse_ieee_bb | PARAMS ((struct ieee_info *, const bfd_byte **)) |
| static boolean ieee_read_cxx_misc | PARAMS ((struct ieee_info *, const bfd_byte **, unsigned long)) |
| static void | ieee_error (struct ieee_info *info, const bfd_byte *p, const char *s) |
| static void | ieee_eof (struct ieee_info *info) |
| static char * | savestring (char *start, unsigned long len) const |
| static boolean | ieee_read_number (struct ieee_info *info, const bfd_byte **pp, bfd_vma *pv) |
| static boolean | ieee_read_optional_number (struct ieee_info *info, const bfd_byte **pp, bfd_vma *pv, boolean *ppresent) |
| static boolean | ieee_read_id (struct ieee_info *info, const bfd_byte **pp, const char **pname, unsigned long *pnamlen) |
| static boolean | ieee_read_optional_id (struct ieee_info *info, const bfd_byte **pp, const char **pname, unsigned long *pnamlen, boolean *ppresent) |
| static boolean | ieee_read_expression (struct ieee_info *info, const bfd_byte **pp, bfd_vma *pv) |
| static debug_type | ieee_builtin_type (struct ieee_info *info, const bfd_byte *p, unsigned int indx) |
| static boolean | ieee_alloc_type (struct ieee_info *info, unsigned int indx, boolean ref) |
| static boolean | ieee_read_type_index (struct ieee_info *info, const bfd_byte **pp, debug_type *ptype) |
| boolean | parse_ieee (PTR dhandle, bfd *abfd, const bfd_byte *bytes, bfd_size_type len) |
| static boolean | parse_ieee_bb (struct ieee_info *info, const bfd_byte **pp) |
| static boolean | parse_ieee_be (struct ieee_info *info, const bfd_byte **pp) |
| static boolean | parse_ieee_nn (struct ieee_info *info, const bfd_byte **pp) |
| static boolean | parse_ieee_ty (struct ieee_info *info, const bfd_byte **pp) |
| static boolean | parse_ieee_atn (struct ieee_info *info, const bfd_byte **pp) |
| static boolean | ieee_read_cxx_misc (struct ieee_info *info, const bfd_byte **pp, unsigned long count) |
| static boolean | ieee_read_cxx_class (struct ieee_info *info, const bfd_byte **pp, unsigned long count) |
| static boolean | ieee_read_cxx_defaults (struct ieee_info *info, const bfd_byte **pp, unsigned long count) |
| static boolean | ieee_read_reference (struct ieee_info *info, const bfd_byte **pp) |
| static boolean | ieee_require_asn (struct ieee_info *info, const bfd_byte **pp, bfd_vma *pv) |
| static boolean | ieee_require_atn65 (struct ieee_info *info, const bfd_byte **pp, const char **pname, unsigned long *pnamlen) |
| static int | ieee_regno_to_genreg (bfd *abfd, int r) |
| static int | ieee_genreg_to_regno (bfd *abfd, int r) |
| static boolean ieee_init_buffer | PARAMS ((struct ieee_handle *, struct ieee_buflist *)) |
| static boolean ieee_append_buffer | PARAMS ((struct ieee_handle *, struct ieee_buflist *, struct ieee_buflist *)) |
| static boolean ieee_real_write_byte | PARAMS ((struct ieee_handle *, int)) |
| static boolean ieee_write_number | PARAMS ((struct ieee_handle *, bfd_vma)) |
| static boolean ieee_write_id | PARAMS ((struct ieee_handle *, const char *)) |
| static boolean ieee_write_asn | PARAMS ((struct ieee_handle *, unsigned int, bfd_vma)) |
| static boolean ieee_write_atn65 | PARAMS ((struct ieee_handle *, unsigned int, const char *)) |
| static boolean ieee_push_type | PARAMS ((struct ieee_handle *, unsigned int, unsigned int, boolean, boolean)) |
| static unsigned int ieee_pop_type | PARAMS ((struct ieee_handle *)) |
| static unsigned int ieee_pop_type_used | PARAMS ((struct ieee_handle *, boolean)) |
| static boolean ieee_add_range | PARAMS ((struct ieee_handle *, boolean, bfd_vma, bfd_vma)) |
| static boolean ieee_define_type | PARAMS ((struct ieee_handle *, unsigned int, boolean, boolean)) |
| static boolean ieee_define_named_type | PARAMS ((struct ieee_handle *, const char *, unsigned int, unsigned int, boolean, boolean, struct ieee_buflist *)) |
| static struct ieee_modified_type *ieee_get_modified_info | PARAMS ((struct ieee_handle *, unsigned int)) |
| static struct bfd_hash_entry *ieee_name_type_newfunc | PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)) |
| static boolean ieee_write_undefined_tag | PARAMS ((struct ieee_name_type_hash_entry *, PTR)) |
| static void ieee_add_bb11_blocks | PARAMS ((bfd *, asection *, PTR)) |
| static boolean ieee_add_bb11 | PARAMS ((struct ieee_handle *, asection *, bfd_vma, bfd_vma)) |
| static unsigned int ieee_vis_to_flags | PARAMS ((enum debug_visibility)) |
| static boolean ieee_class_method_var | PARAMS ((struct ieee_handle *, const char *, enum debug_visibility, boolean, boolean, boolean, bfd_vma, boolean)) |
| static boolean ieee_start_compilation_unit | PARAMS ((PTR, const char *)) |
| static boolean ieee_empty_type | PARAMS ((PTR)) |
| static boolean ieee_int_type | PARAMS ((PTR, unsigned int, boolean)) |
| static boolean ieee_float_type | PARAMS ((PTR, unsigned int)) |
| static boolean ieee_enum_type | PARAMS ((PTR, const char *, const char **, bfd_signed_vma *)) |
| static boolean ieee_function_type | PARAMS ((PTR, int, boolean)) |
| static boolean ieee_range_type | PARAMS ((PTR, bfd_signed_vma, bfd_signed_vma)) |
| static boolean ieee_array_type | PARAMS ((PTR, bfd_signed_vma, bfd_signed_vma, boolean)) |
| static boolean ieee_set_type | PARAMS ((PTR, boolean)) |
| static boolean ieee_method_type | PARAMS ((PTR, boolean, int, boolean)) |
| static boolean ieee_start_struct_type | PARAMS ((PTR, const char *, unsigned int, boolean, unsigned int)) |
| static boolean ieee_struct_field | PARAMS ((PTR, const char *, bfd_vma, bfd_vma, enum debug_visibility)) |
| static boolean ieee_start_class_type | PARAMS ((PTR, const char *, unsigned int, boolean, unsigned int, boolean, boolean)) |
| static boolean ieee_class_static_member | PARAMS ((PTR, const char *, const char *, enum debug_visibility)) |
| static boolean ieee_class_baseclass | PARAMS ((PTR, bfd_vma, boolean, enum debug_visibility)) |
| static boolean ieee_class_method_variant | PARAMS ((PTR, const char *, enum debug_visibility, boolean, boolean, bfd_vma, boolean)) |
| static boolean ieee_class_static_method_variant | PARAMS ((PTR, const char *, enum debug_visibility, boolean, boolean)) |
| static boolean ieee_tag_type | PARAMS ((PTR, const char *, unsigned int, enum debug_type_kind)) |
| static boolean ieee_int_constant | PARAMS ((PTR, const char *, bfd_vma)) |
| static boolean ieee_float_constant | PARAMS ((PTR, const char *, double)) |
| static boolean ieee_variable | PARAMS ((PTR, const char *, enum debug_var_kind, bfd_vma)) |
| static boolean ieee_start_function | PARAMS ((PTR, const char *, boolean)) |
| static boolean ieee_function_parameter | PARAMS ((PTR, const char *, enum debug_parm_kind, bfd_vma)) |
| static boolean ieee_start_block | PARAMS ((PTR, bfd_vma)) |
| static boolean ieee_lineno | PARAMS ((PTR, const char *, unsigned long, bfd_vma)) |
| static boolean | ieee_init_buffer (struct ieee_handle *info, struct ieee_buflist *buflist) |
| static boolean | ieee_change_buffer (struct ieee_handle *info, struct ieee_buflist *buflist) |
| static boolean | ieee_append_buffer (struct ieee_handle *info, struct ieee_buflist *mainbuf, struct ieee_buflist *newbuf) |
| static boolean | ieee_real_write_byte (struct ieee_handle *info, int b) |
| static boolean | ieee_write_2bytes (struct ieee_handle *info, int i) |
| static boolean | ieee_write_number (struct ieee_handle *info, bfd_vma v) |
| static boolean | ieee_write_id (struct ieee_handle *info, const char *s) |
| static boolean | ieee_write_asn (struct ieee_handle *info, unsigned int indx, bfd_vma val) |
| static boolean | ieee_write_atn65 (struct ieee_handle *info, unsigned int indx, const char *s) |
| static boolean | ieee_push_type (struct ieee_handle *info, unsigned int indx, unsigned int size, boolean unsignedp, boolean localp) |
| static unsigned int | ieee_pop_type (struct ieee_handle *info) |
| static void | ieee_pop_unused_type (struct ieee_handle *info) |
| static unsigned int | ieee_pop_type_used (struct ieee_handle *info, boolean used) |
| static boolean | ieee_add_range (struct ieee_handle *info, boolean global, bfd_vma low, bfd_vma high) |
| static boolean | ieee_start_range (struct ieee_handle *info, bfd_vma low) |
| static boolean | ieee_end_range (struct ieee_handle *info, bfd_vma high) |
| static boolean | ieee_define_type (struct ieee_handle *info, unsigned int size, boolean unsignedp, boolean localp) |
| static boolean | ieee_define_named_type (struct ieee_handle *info, const char *name, unsigned int indx, unsigned int size, boolean unsignedp, boolean localp, struct ieee_buflist *buflist) |
| static struct ieee_modified_type * | ieee_get_modified_info (struct ieee_handle *info, unsigned int indx) |
| static struct bfd_hash_entry * | ieee_name_type_newfunc (struct bfd_hash_entry *entry, struct bfd_hash_table *table, const char *string) |
| boolean | write_ieee_debugging_info (bfd *abfd, PTR dhandle) |
| static boolean | ieee_write_undefined_tag (struct ieee_name_type_hash_entry *h, PTR p) |
| static boolean | ieee_start_compilation_unit (PTR p, const char *filename) |
| static boolean | ieee_finish_compilation_unit (struct ieee_handle *info) |
| static void | ieee_add_bb11_blocks (bfd *abfd, asection *sec, PTR data) |
| static boolean | ieee_add_bb11 (struct ieee_handle *info, asection *sec, bfd_vma low, bfd_vma high) |
| static boolean | ieee_start_source (PTR p, const char *filename) |
| static boolean | ieee_empty_type (PTR p) |
| static boolean | ieee_void_type (PTR p) |
| static boolean | ieee_int_type (PTR p, unsigned int size, boolean unsignedp) |
| static boolean | ieee_float_type (PTR p, unsigned int size) |
| static boolean | ieee_complex_type (PTR p, unsigned int size) |
| static boolean | ieee_bool_type (PTR p, unsigned int size) |
| static boolean | ieee_enum_type (PTR p, const char *tag, const char **names, bfd_signed_vma *vals) |
| static boolean | ieee_pointer_type (PTR p) |
| static boolean | ieee_function_type (PTR p, int argcount, boolean varargs) |
| static boolean | ieee_reference_type (PTR p) |
| static boolean | ieee_range_type (PTR p, bfd_signed_vma low, bfd_signed_vma high) |
| static boolean | ieee_array_type (PTR p, bfd_signed_vma low, bfd_signed_vma high, boolean stringp) |
| static boolean | ieee_set_type (PTR p, boolean bitstringp) |
| static boolean | ieee_offset_type (PTR p) |
| static boolean | ieee_method_type (PTR p, boolean domain, int argcount, boolean varargs) |
| static boolean | ieee_const_type (PTR p) |
| static boolean | ieee_volatile_type (PTR p) |
| static unsigned int | ieee_vis_to_flags (enum debug_visibility visibility) |
| static boolean | ieee_start_struct_type (PTR p, const char *tag, unsigned int id, boolean structp, unsigned int size) |
| static boolean | ieee_struct_field (PTR p, const char *name, bfd_vma bitpos, bfd_vma bitsize, enum debug_visibility visibility) |
| static boolean | ieee_end_struct_type (PTR p) |
| static boolean | ieee_start_class_type (PTR p, const char *tag, unsigned int id, boolean structp, unsigned int size, boolean vptr, boolean ownvptr) |
| static boolean | ieee_class_static_member (PTR p, const char *name, const char *physname, enum debug_visibility visibility) |
| static boolean | ieee_class_baseclass (PTR p, bfd_vma bitpos, boolean virtual, enum debug_visibility visibility) |
| static boolean | ieee_class_start_method (PTR p, const char *name) |
| static boolean | ieee_class_method_var (struct ieee_handle *info, const char *physname, enum debug_visibility visibility, boolean staticp, boolean constp, boolean volatilep, bfd_vma voffset, boolean context) |
| static boolean | ieee_class_method_variant (PTR p, const char *physname, enum debug_visibility visibility, boolean constp, boolean volatilep, bfd_vma voffset, boolean context) |
| static boolean | ieee_class_static_method_variant (PTR p, const char *physname, enum debug_visibility visibility, boolean constp, boolean volatilep) |
| static boolean | ieee_class_end_method (PTR p) |
| static boolean | ieee_end_class_type (PTR p) |
| static boolean | ieee_typedef_type (PTR p, const char *name) |
| static boolean | ieee_tag_type (PTR p, const char *name, unsigned int id, enum debug_type_kind kind) |
| static boolean | ieee_typdef (PTR p, const char *name) |
| static boolean | ieee_tag (PTR p, const char *name) |
| static boolean | ieee_int_constant (PTR p, const char *name, bfd_vma val) |
| static boolean | ieee_float_constant (PTR p, const char *name, double val) |
| static boolean | ieee_typed_constant (PTR p, const char *name, bfd_vma val) |
| static boolean | ieee_variable (PTR p, const char *name, enum debug_var_kind kind, bfd_vma val) |
| static boolean | ieee_start_function (PTR p, const char *name, boolean global) |
| static boolean | ieee_function_parameter (PTR p, const char *name, enum debug_parm_kind kind, bfd_vma val) |
| static boolean | ieee_output_pending_parms (struct ieee_handle *info) |
| static boolean | ieee_start_block (PTR p, bfd_vma addr) |
| static boolean | ieee_end_block (PTR p, bfd_vma addr) |
| static boolean | ieee_end_function (PTR p) |
| static boolean | ieee_lineno (PTR p, const char *filename, unsigned long lineno, bfd_vma addr) |
Variables | |
| static struct debug_write_fns | ieee_fns |
| #define BASEFLAGS_FRIEND (0x10) |
| #define BASEFLAGS_PRIVATE (0x1) |
Definition at line 209 of file ieee.c.
Referenced by ieee_class_baseclass(), and ieee_read_cxx_class().
| #define BASEFLAGS_VIRTUAL (0x2) |
Definition at line 211 of file ieee.c.
Referenced by ieee_class_baseclass(), and ieee_read_cxx_class().
| #define BLOCKSTACK_SIZE (16) |
| #define BUILTIN_TYPE_COUNT (60) |
| #define CXXFLAGS_CONST (0x20) |
Definition at line 235 of file ieee.c.
Referenced by ieee_class_method_var(), and ieee_read_cxx_class().
| #define CXXFLAGS_FRIEND (0x10) |
| #define CXXFLAGS_STATIC (0x4) |
Definition at line 229 of file ieee.c.
Referenced by ieee_class_method_var(), ieee_class_static_member(), and ieee_read_cxx_class().
| #define CXXFLAGS_VISIBILITY (0x3) |
| #define CXXFLAGS_VISIBILITY_PRIVATE (0x1) |
Definition at line 225 of file ieee.c.
Referenced by ieee_read_cxx_class(), and ieee_vis_to_flags().
| #define CXXFLAGS_VISIBILITY_PROTECTED (0x2) |
Definition at line 227 of file ieee.c.
Referenced by ieee_read_cxx_class(), and ieee_vis_to_flags().
| #define CXXFLAGS_VISIBILITY_PUBLIC (0x0) |
Definition at line 223 of file ieee.c.
Referenced by ieee_read_cxx_class(), and ieee_vis_to_flags().
| #define CXXFLAGS_VOLATILE (0x40) |
Definition at line 237 of file ieee.c.
Referenced by ieee_class_method_var(), and ieee_read_cxx_class().
| #define EXPR_STACK_SIZE (10) |
Referenced by ieee_read_expression().
| #define ieee_buffer_emptyp | ( | buflist | ) | ((buflist)->head == NULL) |
Definition at line 4110 of file ieee.c.
Referenced by ieee_add_bb11(), ieee_class_baseclass(), ieee_define_named_type(), ieee_end_class_type(), ieee_end_function(), ieee_end_struct_type(), ieee_finish_compilation_unit(), ieee_lineno(), ieee_pop_type_used(), ieee_start_function(), ieee_struct_field(), ieee_variable(), ieee_write_undefined_tag(), and write_ieee_debugging_info().
| #define IEEE_BUFSIZE (490) |
| #define ieee_name_type_hash_lookup | ( | table, | |||
| string, | |||||
| create, | |||||
| copy | ) |
Value:
((struct ieee_name_type_hash_entry *) \ bfd_hash_lookup (&(table)->root, (string), (create), (copy)))
Definition at line 4672 of file ieee.c.
Referenced by ieee_start_struct_type(), ieee_tag_type(), ieee_typdef(), and ieee_typedef_type().
| #define ieee_write_byte | ( | info, | |||
| b | ) |
Value:
((info)->curbuf->c < IEEE_BUFSIZE \ ? ((info)->curbuf->buf[(info)->curbuf->c++] = (b), true) \ : ieee_real_write_byte ((info), (b)))
Definition at line 4159 of file ieee.c.
Referenced by ieee_add_bb11(), ieee_define_named_type(), ieee_end_block(), ieee_end_class_type(), ieee_end_function(), ieee_end_struct_type(), ieee_finish_compilation_unit(), ieee_lineno(), ieee_output_pending_parms(), ieee_pop_type_used(), ieee_start_block(), ieee_start_compilation_unit(), ieee_start_function(), ieee_struct_field(), ieee_variable(), ieee_write_2bytes(), ieee_write_id(), ieee_write_number(), ieee_write_undefined_tag(), and write_ieee_debugging_info().
| enum builtin_types |
Definition at line 173 of file ieee.c.
00174 { 00175 builtin_unknown = 0, 00176 builtin_void = 1, 00177 builtin_signed_char = 2, 00178 builtin_unsigned_char = 3, 00179 builtin_signed_short_int = 4, 00180 builtin_unsigned_short_int = 5, 00181 builtin_signed_long = 6, 00182 builtin_unsigned_long = 7, 00183 builtin_signed_long_long = 8, 00184 builtin_unsigned_long_long = 9, 00185 builtin_float = 10, 00186 builtin_double = 11, 00187 builtin_long_double = 12, 00188 builtin_long_long_double = 13, 00189 builtin_quoted_string = 14, 00190 builtin_instruction_address = 15, 00191 builtin_int = 16, 00192 builtin_unsigned = 17, 00193 builtin_unsigned_int = 18, 00194 builtin_char = 19, 00195 builtin_long = 20, 00196 builtin_short = 21, 00197 builtin_unsigned_short = 22, 00198 builtin_short_int = 23, 00199 builtin_signed_short = 24, 00200 builtin_bcd_float = 25 00201 };
| static boolean ieee_add_bb11 | ( | struct ieee_handle * | info, | |
| asection * | sec, | |||
| bfd_vma | low, | |||
| bfd_vma | high | |||
| ) | [static] |
Definition at line 5175 of file ieee.c.
References filename, free, ieee_bb_record_enum, ieee_be_record_enum, ieee_buffer_emptyp, ieee_change_buffer(), IEEE_SECTION_NUMBER_BASE, ieee_write_byte, ieee_write_id(), ieee_write_number(), NULL, and strrchr().
Referenced by ieee_add_bb11_blocks().
05180 { 05181 int kind; 05182 05183 if (! ieee_buffer_emptyp (&info->vars)) 05184 { 05185 if (! ieee_change_buffer (info, &info->vars)) 05186 return false; 05187 } 05188 else 05189 { 05190 const char *filename, *modname; 05191 char *c, *s; 05192 05193 /* Start the enclosing BB10 block. */ 05194 filename = bfd_get_filename (info->abfd); 05195 modname = strrchr (filename, '/'); 05196 if (modname != NULL) 05197 ++modname; 05198 else 05199 { 05200 modname = strrchr (filename, '\\'); 05201 if (modname != NULL) 05202 ++modname; 05203 else 05204 modname = filename; 05205 } 05206 c = xstrdup (modname); 05207 s = strrchr (c, '.'); 05208 if (s != NULL) 05209 *s = '\0'; 05210 05211 if (! ieee_change_buffer (info, &info->vars) 05212 || ! ieee_write_byte (info, (int) ieee_bb_record_enum) 05213 || ! ieee_write_byte (info, 10) 05214 || ! ieee_write_number (info, 0) 05215 || ! ieee_write_id (info, c) 05216 || ! ieee_write_id (info, "") 05217 || ! ieee_write_number (info, 0) 05218 || ! ieee_write_id (info, "GNU objcopy")) 05219 return false; 05220 05221 free (c); 05222 } 05223 05224 if ((sec->flags & SEC_CODE) != 0) 05225 kind = 1; 05226 else if ((sec->flags & SEC_READONLY) != 0) 05227 kind = 3; 05228 else 05229 kind = 2; 05230 05231 if (! ieee_write_byte (info, (int) ieee_bb_record_enum) 05232 || ! ieee_write_byte (info, 11) 05233 || ! ieee_write_number (info, 0) 05234 || ! ieee_write_id (info, "") 05235 || ! ieee_write_number (info, kind) 05236 || ! ieee_write_number (info, sec->index + IEEE_SECTION_NUMBER_BASE) 05237 || ! ieee_write_number (info, low) 05238 || ! ieee_write_byte (info, (int) ieee_be_record_enum) 05239 || ! ieee_write_number (info, high - low)) 05240 return false; 05241 05242 return true; 05243 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static void ieee_add_bb11_blocks | ( | bfd * | abfd, | |
| asection * | sec, | |||
| PTR | data | |||
| ) | [static] |
Definition at line 5130 of file ieee.c.
References ieee_handle::global_ranges, ieee_range::high, ieee_add_bb11(), info, ieee_range::low, ieee_range::next, and NULL.
Referenced by write_ieee_debugging_info().
05134 { 05135 struct ieee_handle *info = (struct ieee_handle *) data; 05136 bfd_vma low, high; 05137 struct ieee_range *r; 05138 05139 low = bfd_get_section_vma (abfd, sec); 05140 high = low + bfd_section_size (abfd, sec); 05141 05142 /* Find the first range at or after this section. The ranges are 05143 sorted by address. */ 05144 for (r = info->global_ranges; r != NULL; r = r->next) 05145 if (r->high > low) 05146 break; 05147 05148 while (low < high) 05149 { 05150 if (r == NULL || r->low >= high) 05151 { 05152 if (! ieee_add_bb11 (info, sec, low, high)) 05153 info->error = true; 05154 return; 05155 } 05156 05157 if (low < r->low 05158 && r->low - low > 0x100) 05159 { 05160 if (! ieee_add_bb11 (info, sec, low, r->low)) 05161 { 05162 info->error = true; 05163 return; 05164 } 05165 } 05166 low = r->high; 05167 05168 r = r->next; 05169 } 05170 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_add_range | ( | struct ieee_handle * | info, | |
| boolean | global, | |||
| bfd_vma | low, | |||
| bfd_vma | high | |||
| ) | [static] |
Definition at line 4418 of file ieee.c.
References free, ieee_range::high, ieee_range::low, n, ieee_range::next, and NULL.
Referenced by ieee_end_range(), ieee_finish_compilation_unit(), and ieee_variable().
04423 { 04424 struct ieee_range **plist, *r, **pr; 04425 04426 if (low == (bfd_vma) -1 || high == (bfd_vma) -1 || low == high) 04427 return true; 04428 04429 if (global) 04430 plist = &info->global_ranges; 04431 else 04432 plist = &info->ranges; 04433 04434 for (r = *plist; r != NULL; r = r->next) 04435 { 04436 if (high >= r->low && low <= r->high) 04437 { 04438 /* The new range overlaps r. */ 04439 if (low < r->low) 04440 r->low = low; 04441 if (high > r->high) 04442 r->high = high; 04443 pr = &r->next; 04444 while (*pr != NULL && (*pr)->low <= r->high) 04445 { 04446 struct ieee_range *n; 04447 04448 if ((*pr)->high > r->high) 04449 r->high = (*pr)->high; 04450 n = (*pr)->next; 04451 free (*pr); 04452 *pr = n; 04453 } 04454 return true; 04455 } 04456 } 04457 04458 r = (struct ieee_range *) xmalloc (sizeof *r); 04459 memset (r, 0, sizeof *r); 04460 04461 r->low = low; 04462 r->high = high; 04463 04464 /* Store the ranges sorted by address. */ 04465 for (pr = plist; *pr != NULL; pr = &(*pr)->next) 04466 if ((*pr)->low > high) 04467 break; 04468 r->next = *pr; 04469 *pr = r; 04470 04471 return true; 04472 }
Here is the caller graph for this function:

| static boolean ieee_alloc_type | ( | struct ieee_info * | info, | |
| unsigned int | indx, | |||
| boolean | ref | |||
| ) | [static] |
Definition at line 800 of file ieee.c.
References debug_make_indirect_type(), DEBUG_TYPE_NULL, memset, NULL, ieee_type::pslot, ieee_type::type, xmalloc(), and xrealloc().
Referenced by ieee_read_type_index(), parse_ieee_bb(), and parse_ieee_ty().
00804 { 00805 unsigned int nalloc; 00806 register struct ieee_type *t; 00807 struct ieee_type *tend; 00808 00809 if (indx >= info->types.alloc) 00810 { 00811 nalloc = info->types.alloc; 00812 if (nalloc == 0) 00813 nalloc = 4; 00814 while (indx >= nalloc) 00815 nalloc *= 2; 00816 00817 info->types.types = ((struct ieee_type *) 00818 xrealloc (info->types.types, 00819 nalloc * sizeof *info->types.types)); 00820 00821 memset (info->types.types + info->types.alloc, 0, 00822 (nalloc - info->types.alloc) * sizeof *info->types.types); 00823 00824 tend = info->types.types + nalloc; 00825 for (t = info->types.types + info->types.alloc; t < tend; t++) 00826 t->type = DEBUG_TYPE_NULL; 00827 00828 info->types.alloc = nalloc; 00829 } 00830 00831 if (ref) 00832 { 00833 t = info->types.types + indx; 00834 if (t->type == NULL) 00835 { 00836 t->pslot = (debug_type *) xmalloc (sizeof *t->pslot); 00837 *t->pslot = DEBUG_TYPE_NULL; 00838 t->type = debug_make_indirect_type (info->dhandle, t->pslot, 00839 (const char *) NULL); 00840 if (t->type == NULL) 00841 return false; 00842 } 00843 } 00844 00845 return true; 00846 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_append_buffer | ( | struct ieee_handle * | info, | |
| struct ieee_buflist * | mainbuf, | |||
| struct ieee_buflist * | newbuf | |||
| ) | [static] |
Definition at line 4140 of file ieee.c.
References ieee_buflist::head, ieee_buf::next, NULL, and ieee_buflist::tail.
Referenced by ieee_end_class_type(), ieee_end_function(), ieee_end_struct_type(), ieee_finish_compilation_unit(), ieee_pop_type_used(), and write_ieee_debugging_info().
04144 { 04145 if (newbuf->head != NULL) 04146 { 04147 if (mainbuf->head == NULL) 04148 mainbuf->head = newbuf->head; 04149 else 04150 mainbuf->tail->next = newbuf->head; 04151 mainbuf->tail = newbuf->tail; 04152 } 04153 return true; 04154 }
Here is the caller graph for this function:

| static boolean ieee_array_type | ( | PTR | p, | |
| bfd_signed_vma | low, | |||
| bfd_signed_vma | high, | |||
| boolean | stringp | |||
| ) | [static] |
Definition at line 5717 of file ieee.c.
References ieee_modified_type::arrays, ieee_modified_array_type::high, ieee_define_type(), ieee_get_modified_info(), ieee_pop_type(), ieee_pop_unused_type(), ieee_push_type(), ieee_write_number(), ieee_modified_array_type::indx, ieee_write_type::localp, ieee_modified_array_type::low, memset, ieee_modified_array_type::next, NULL, ieee_write_type::size, ieee_type_stack::type, ieee_handle::type_stack, and xmalloc().
05722 { 05723 struct ieee_handle *info = (struct ieee_handle *) p; 05724 unsigned int eleindx; 05725 boolean localp; 05726 unsigned int size; 05727 struct ieee_modified_type *m = NULL; 05728 struct ieee_modified_array_type *a; 05729 05730 /* IEEE does not store the range, so we just ignore it. */ 05731 ieee_pop_unused_type (info); 05732 localp = info->type_stack->type.localp; 05733 size = info->type_stack->type.size; 05734 eleindx = ieee_pop_type (info); 05735 05736 /* If we don't know the range, treat the size as exactly one 05737 element. */ 05738 if (low < high) 05739 size *= (high - low) + 1; 05740 05741 if (! localp) 05742 { 05743 m = ieee_get_modified_info (info, eleindx); 05744 if (m == NULL) 05745 return false; 05746 05747 for (a = m->arrays; a != NULL; a = a->next) 05748 { 05749 if (a->low == low && a->high == high) 05750 return ieee_push_type (info, a->indx, size, false, false); 05751 } 05752 } 05753 05754 if (! ieee_define_type (info, size, false, localp) 05755 || ! ieee_write_number (info, low == 0 ? 'Z' : 'C') 05756 || ! ieee_write_number (info, eleindx)) 05757 return false; 05758 if (low != 0) 05759 { 05760 if (! ieee_write_number (info, low)) 05761 return false; 05762 } 05763 05764 if (! ieee_write_number (info, high + 1)) 05765 return false; 05766 05767 if (! localp) 05768 { 05769 a = (struct ieee_modified_array_type *) xmalloc (sizeof *a); 05770 memset (a, 0, sizeof *a); 05771 05772 a->indx = info->type_stack->type.indx; 05773 a->low = low; 05774 a->high = high; 05775 05776 a->next = m->arrays; 05777 m->arrays = a; 05778 } 05779 05780 return true; 05781 }
Here is the call graph for this function:

| static boolean ieee_bool_type | ( | PTR | p, | |
| unsigned int | size | |||
| ) | [static] |
Definition at line 5402 of file ieee.c.
References ieee_int_type().
05405 { 05406 return ieee_int_type (p, size, true); 05407 }
Here is the call graph for this function:

| static debug_type ieee_builtin_type | ( | struct ieee_info * | info, | |
| const bfd_byte * | p, | |||
| unsigned int | indx | |||
| ) | [static] |
Definition at line 609 of file ieee.c.
References assert, builtin_bcd_float, builtin_char, builtin_double, builtin_float, builtin_instruction_address, builtin_int, builtin_long, builtin_long_double, builtin_long_long_double, builtin_quoted_string, builtin_short, builtin_short_int, builtin_signed_char, builtin_signed_long, builtin_signed_long_long, builtin_signed_short, builtin_signed_short_int, BUILTIN_TYPE_COUNT, builtin_unknown, builtin_unsigned, builtin_unsigned_char, builtin_unsigned_int, builtin_unsigned_long, builtin_unsigned_long_long, builtin_unsigned_short, builtin_unsigned_short_int, builtin_void, debug_make_array_type(), debug_make_float_type(), debug_make_int_type(), debug_make_pointer_type(), debug_make_void_type(), debug_name_type(), DEBUG_TYPE_NULL, dhandle, ieee_error(), name, NULL, and ieee_tag::type.
Referenced by ieee_read_cxx_class(), ieee_read_type_index(), parse_ieee_bb(), and parse_ieee_ty().
00613 { 00614 PTR dhandle; 00615 debug_type type; 00616 const char *name; 00617 00618 if (indx < BUILTIN_TYPE_COUNT 00619 && info->types.builtins[indx] != DEBUG_TYPE_NULL) 00620 return info->types.builtins[indx]; 00621 00622 dhandle = info->dhandle; 00623 00624 if (indx >= 32 && indx < 64) 00625 { 00626 type = debug_make_pointer_type (dhandle, 00627 ieee_builtin_type (info, p, indx - 32)); 00628 assert (indx < BUILTIN_TYPE_COUNT); 00629 info->types.builtins[indx] = type; 00630 return type; 00631 } 00632 00633 switch ((enum builtin_types) indx) 00634 { 00635 default: 00636 ieee_error (info, p, "unknown builtin type"); 00637 return NULL; 00638 00639 case builtin_unknown: 00640 type = debug_make_void_type (dhandle); 00641 name = NULL; 00642 break; 00643 00644 case builtin_void: 00645 type = debug_make_void_type (dhandle); 00646 name = "void"; 00647 break; 00648 00649 case builtin_signed_char: 00650 type = debug_make_int_type (dhandle, 1, false); 00651 name = "signed char"; 00652 break; 00653 00654 case builtin_unsigned_char: 00655 type = debug_make_int_type (dhandle, 1, true); 00656 name = "unsigned char"; 00657 break; 00658 00659 case builtin_signed_short_int: 00660 type = debug_make_int_type (dhandle, 2, false); 00661 name = "signed short int"; 00662 break; 00663 00664 case builtin_unsigned_short_int: 00665 type = debug_make_int_type (dhandle, 2, true); 00666 name = "unsigned short int"; 00667 break; 00668 00669 case builtin_signed_long: 00670 type = debug_make_int_type (dhandle, 4, false); 00671 name = "signed long"; 00672 break; 00673 00674 case builtin_unsigned_long: 00675 type = debug_make_int_type (dhandle, 4, true); 00676 name = "unsigned long"; 00677 break; 00678 00679 case builtin_signed_long_long: 00680 type = debug_make_int_type (dhandle, 8, false); 00681 name = "signed long long"; 00682 break; 00683 00684 case builtin_unsigned_long_long: 00685 type = debug_make_int_type (dhandle, 8, true); 00686 name = "unsigned long long"; 00687 break; 00688 00689 case builtin_float: 00690 type = debug_make_float_type (dhandle, 4); 00691 name = "float"; 00692 break; 00693 00694 case builtin_double: 00695 type = debug_make_float_type (dhandle, 8); 00696 name = "double"; 00697 break; 00698 00699 case builtin_long_double: 00700 /* FIXME: The size for this type should depend upon the 00701 processor. */ 00702 type = debug_make_float_type (dhandle, 12); 00703 name = "long double"; 00704 break; 00705 00706 case builtin_long_long_double: 00707 type = debug_make_float_type (dhandle, 16); 00708 name = "long long double"; 00709 break; 00710 00711 case builtin_quoted_string: 00712 type = debug_make_array_type (dhandle, 00713 ieee_builtin_type (info, p, 00714 ((unsigned int) 00715 builtin_char)), 00716 ieee_builtin_type (info, p, 00717 ((unsigned int) 00718 builtin_int)), 00719 0, -1, true); 00720 name = "QUOTED STRING"; 00721 break; 00722 00723 case builtin_instruction_address: 00724 /* FIXME: This should be a code address. */ 00725 type = debug_make_int_type (dhandle, 4, true); 00726 name = "instruction address"; 00727 break; 00728 00729 case builtin_int: 00730 /* FIXME: The size for this type should depend upon the 00731 processor. */ 00732 type = debug_make_int_type (dhandle, 4, false); 00733 name = "int"; 00734 break; 00735 00736 case builtin_unsigned: 00737 /* FIXME: The size for this type should depend upon the 00738 processor. */ 00739 type = debug_make_int_type (dhandle, 4, true); 00740 name = "unsigned"; 00741 break; 00742 00743 case builtin_unsigned_int: 00744 /* FIXME: The size for this type should depend upon the 00745 processor. */ 00746 type = debug_make_int_type (dhandle, 4, true); 00747 name = "unsigned int"; 00748 break; 00749 00750 case builtin_char: 00751 type = debug_make_int_type (dhandle, 1, false); 00752 name = "char"; 00753 break; 00754 00755 case builtin_long: 00756 type = debug_make_int_type (dhandle, 4, false); 00757 name = "long"; 00758 break; 00759 00760 case builtin_short: 00761 type = debug_make_int_type (dhandle, 2, false); 00762 name = "short"; 00763 break; 00764 00765 case builtin_unsigned_short: 00766 type = debug_make_int_type (dhandle, 2, true); 00767 name = "unsigned short"; 00768 break; 00769 00770 case builtin_short_int: 00771 type = debug_make_int_type (dhandle, 2, false); 00772 name = "short int"; 00773 break; 00774 00775 case builtin_signed_short: 00776 type = debug_make_int_type (dhandle, 2, false); 00777 name = "signed short"; 00778 break; 00779 00780 case builtin_bcd_float: 00781 ieee_error (info, p, "BCD float type not supported"); 00782 return DEBUG_TYPE_NULL; 00783 } 00784 00785 if (name != NULL) 00786 type = debug_name_type (dhandle, name, type); 00787 00788 assert (indx < BUILTIN_TYPE_COUNT); 00789 00790 info->types.builtins[indx] = type; 00791 00792 return type; 00793 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_change_buffer | ( | struct ieee_handle * | info, | |
| struct ieee_buflist * | buflist | |||
| ) | [static] |
Definition at line 4115 of file ieee.c.
References buf, ieee_buflist::head, NULL, ieee_buflist::tail, and xmalloc().
Referenced by ieee_add_bb11(), ieee_class_baseclass(), ieee_class_method_var(), ieee_class_static_member(), ieee_define_named_type(), ieee_end_block(), ieee_end_class_type(), ieee_end_function(), ieee_end_struct_type(), ieee_finish_compilation_unit(), ieee_function_parameter(), ieee_lineno(), ieee_output_pending_parms(), ieee_pop_type_used(), ieee_start_block(), ieee_start_class_type(), ieee_start_compilation_unit(), ieee_start_function(), ieee_struct_field(), ieee_variable(), ieee_write_undefined_tag(), and write_ieee_debugging_info().
04118 { 04119 if (buflist->head == NULL) 04120 { 04121 struct ieee_buf *buf; 04122 04123 buf = (struct ieee_buf *) xmalloc (sizeof *buf); 04124 buf->next = NULL; 04125 buf->c = 0; 04126 buflist->head = buf; 04127 buflist->tail = buf; 04128 } 04129 04130 info->current = buflist; 04131 info->curbuf = buflist->tail; 04132 04133 return true; 04134 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_class_baseclass | ( | PTR | p, | |
| bfd_vma | bitpos, | |||
| boolean | virtual, | |||
| enum debug_visibility | visibility | |||
| ) | [static] |
Definition at line 6347 of file ieee.c.
References assert, BASEFLAGS_PRIVATE, BASEFLAGS_VIRTUAL, ieee_write_type::classdef, DEBUG_VISIBILITY_PRIVATE, flags, free, ieee_buffer_emptyp, ieee_change_buffer(), ieee_pop_type(), ieee_write_asn(), ieee_write_atn65(), ieee_write_id(), ieee_write_number(), ieee_type_class::indx, ieee_write_type::localp, ieee_write_type::name, ieee_type_stack::next, NULL, ieee_type_class::pmiscbuf, ieee_write_type::strdef, strlen(), ieee_type_stack::type, ieee_handle::type_stack, and xmalloc().
06352 { 06353 struct ieee_handle *info = (struct ieee_handle *) p; 06354 const char *bname; 06355 boolean localp; 06356 unsigned int bindx; 06357 char *fname; 06358 unsigned int flags; 06359 unsigned int nindx; 06360 06361 assert (info->type_stack != NULL 06362 && info->type_stack->type.name != NULL 06363 && info->type_stack->next != NULL 06364 && info->type_stack->next->type.classdef != NULL 06365 && ! ieee_buffer_emptyp (&info->type_stack->next->type.strdef)); 06366 06367 bname = info->type_stack->type.name; 06368 localp = info->type_stack->type.localp; 06369 bindx = ieee_pop_type (info); 06370 06371 /* We are currently defining both a struct and a class. We must 06372 write out a field definition in the struct which holds the base 06373 class. The stabs debugging reader will create a field named 06374 _vb$CLASS for a virtual base class, so we just use that. FIXME: 06375 we should not depend upon a detail of stabs debugging. */ 06376 if (virtual) 06377 { 06378 fname = (char *) xmalloc (strlen (bname) + sizeof "_vb$"); 06379 sprintf (fname, "_vb$%s", bname); 06380 flags = BASEFLAGS_VIRTUAL; 06381 } 06382 else 06383 { 06384 if (localp) 06385 info->type_stack->type.localp = true; 06386 06387 fname = (char *) xmalloc (strlen (bname) + sizeof "_b$"); 06388 sprintf (fname, "_b$%s", bname); 06389 06390 if (! ieee_change_buffer (info, &info->type_stack->type.strdef) 06391 || ! ieee_write_id (info, fname) 06392 || ! ieee_write_number (info, bindx) 06393 || ! ieee_write_number (info, bitpos / 8)) 06394 return false; 06395 flags = 0; 06396 } 06397 06398 if (visibility == DEBUG_VISIBILITY_PRIVATE) 06399 flags |= BASEFLAGS_PRIVATE; 06400 06401 nindx = info->type_stack->type.classdef->indx; 06402 06403 if (! ieee_change_buffer (info, &info->type_stack->type.classdef->pmiscbuf) 06404 || ! ieee_write_asn (info, nindx, 'b') 06405 || ! ieee_write_asn (info, nindx, flags) 06406 || ! ieee_write_atn65 (info, nindx, bname) 06407 || ! ieee_write_asn (info, nindx, 0) 06408 || ! ieee_write_atn65 (info, nindx, fname)) 06409 return false; 06410 info->type_stack->type.classdef->pmisccount += 5; 06411 06412 free (fname); 06413 06414 return true; 06415 }
Here is the call graph for this function:

| static boolean ieee_class_end_method | ( | PTR | p | ) | [static] |
Definition at line 6547 of file ieee.c.
References assert, ieee_write_type::classdef, ieee_type_class::method, NULL, ieee_type_stack::type, and ieee_handle::type_stack.
06549 { 06550 struct ieee_handle *info = (struct ieee_handle *) p; 06551 06552 assert (info->type_stack != NULL 06553 && info->type_stack->type.classdef != NULL 06554 && info->type_stack->type.classdef->method != NULL); 06555 06556 info->type_stack->type.classdef->method = NULL; 06557 06558 return true; 06559 }
| static boolean ieee_class_method_var | ( | struct ieee_handle * | info, | |
| const char * | physname, | |||
| enum debug_visibility | visibility, | |||
| boolean | staticp, | |||
| boolean | constp, | |||
| boolean | volatilep, | |||
| bfd_vma | voffset, | |||
| boolean | context | |||
| ) | [static] |
Definition at line 6438 of file ieee.c.
References assert, CXXFLAGS_CONST, CXXFLAGS_STATIC, CXXFLAGS_VOLATILE, flags, ieee_change_buffer(), ieee_pop_unused_type(), ieee_vis_to_flags(), ieee_write_asn(), ieee_write_atn65(), and NULL.
Referenced by ieee_class_method_variant(), and ieee_class_static_method_variant().
06448 { 06449 unsigned int flags; 06450 unsigned int nindx; 06451 boolean virtual; 06452 06453 /* We don't need the type of the method. An IEEE consumer which 06454 wants the type must track down the function by the physical name 06455 and get the type from that. */ 06456 ieee_pop_unused_type (info); 06457 06458 /* We don't use the context. FIXME: We probably ought to use it to 06459 adjust the voffset somehow, but I don't really know how. */ 06460 if (context) 06461 ieee_pop_unused_type (info); 06462 06463 assert (info->type_stack != NULL 06464 && info->type_stack->type.classdef != NULL 06465 && info->type_stack->type.classdef->method != NULL); 06466 06467 flags = ieee_vis_to_flags (visibility); 06468 06469 /* FIXME: We never set CXXFLAGS_OVERRIDE, CXXFLAGS_OPERATOR, 06470 CXXFLAGS_CTORDTOR, CXXFLAGS_CTOR, or CXXFLAGS_INLINE. */ 06471 06472 if (staticp) 06473 flags |= CXXFLAGS_STATIC; 06474 if (constp) 06475 flags |= CXXFLAGS_CONST; 06476 if (volatilep) 06477 flags |= CXXFLAGS_VOLATILE; 06478 06479 nindx = info->type_stack->type.classdef->indx; 06480 06481 virtual = context || voffset > 0; 06482 06483 if (! ieee_change_buffer (info, 06484 &info->type_stack->type.classdef->pmiscbuf) 06485 || ! ieee_write_asn (info, nindx, virtual ? 'v' : 'm') 06486 || ! ieee_write_asn (info, nindx, flags) 06487 || ! ieee_write_atn65 (info, nindx, 06488 info->type_stack->type.classdef->method) 06489 || ! ieee_write_atn65 (info, nindx, physname)) 06490 return false; 06491 06492 if (virtual) 06493 { 06494 if (voffset > info->type_stack->type.classdef->voffset) 06495 info->type_stack->type.classdef->voffset = voffset; 06496 if (! ieee_write_asn (info, nindx, voffset)) 06497 return false; 06498 ++info->type_stack->type.classdef->pmisccount; 06499 } 06500 06501 if (! ieee_write_asn (info, nindx, 0)) 06502 return false; 06503 06504 info->type_stack->type.classdef->pmisccount += 5; 06505 06506 return true; 06507 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_class_method_variant | ( | PTR | p, | |
| const char * | physname, | |||
| enum debug_visibility | visibility, | |||
| boolean | constp, | |||
| boolean | volatilep, | |||
| bfd_vma | voffset, | |||
| boolean | context | |||
| ) | [static] |
Definition at line 6512 of file ieee.c.
References ieee_class_method_var().
06521 { 06522 struct ieee_handle *info = (struct ieee_handle *) p; 06523 06524 return ieee_class_method_var (info, physname, visibility, false, constp, 06525 volatilep, voffset, context); 06526 }
Here is the call graph for this function:

| static boolean ieee_class_start_method | ( | PTR | p, | |
| const char * | name | |||
| ) | [static] |
Definition at line 6420 of file ieee.c.
References assert, ieee_write_type::classdef, ieee_type_class::method, NULL, ieee_type_stack::type, and ieee_handle::type_stack.
06423 { 06424 struct ieee_handle *info = (struct ieee_handle *) p; 06425 06426 assert (info->type_stack != NULL 06427 && info->type_stack->type.classdef != NULL 06428 && info->type_stack->type.classdef->method == NULL); 06429 06430 info->type_stack->type.classdef->method = name; 06431 06432 return true; 06433 }
| static boolean ieee_class_static_member | ( | PTR | p, | |
| const char * | name, | |||
| const char * | physname, | |||
| enum debug_visibility | visibility | |||
| ) | [static] |
Definition at line 6310 of file ieee.c.
References assert, ieee_write_type::classdef, CXXFLAGS_STATIC, flags, ieee_change_buffer(), ieee_pop_unused_type(), ieee_vis_to_flags(), ieee_write_asn(), ieee_write_atn65(), ieee_type_class::indx, NULL, ieee_type_class::pmiscbuf, ieee_type_stack::type, and ieee_handle::type_stack.
06315 { 06316 struct ieee_handle *info = (struct ieee_handle *) p; 06317 unsigned int flags; 06318 unsigned int nindx; 06319 06320 /* We don't care about the type. Hopefully there will be a call to 06321 ieee_variable declaring the physical name and the type, since 06322 that is where an IEEE consumer must get the type. */ 06323 ieee_pop_unused_type (info); 06324 06325 assert (info->type_stack != NULL 06326 && info->type_stack->type.classdef != NULL); 06327 06328 flags = ieee_vis_to_flags (visibility); 06329 flags |= CXXFLAGS_STATIC; 06330 06331 nindx = info->type_stack->type.classdef->indx; 06332 06333 if (! ieee_change_buffer (info, &info->type_stack->type.classdef->pmiscbuf) 06334 || ! ieee_write_asn (info, nindx, 'd') 06335 || ! ieee_write_asn (info, nindx, flags) 06336 || ! ieee_write_atn65 (info, nindx, name) 06337 || ! ieee_write_atn65 (info, nindx, physname)) 06338 return false; 06339 info->type_stack->type.classdef->pmisccount += 4; 06340 06341 return true; 06342 }
Here is the call graph for this function:

| static boolean ieee_class_static_method_variant | ( | PTR | p, | |
| const char * | physname, | |||
| enum debug_visibility | visibility, | |||
| boolean | constp, | |||
| boolean | volatilep | |||
| ) | [static] |
Definition at line 6531 of file ieee.c.
References ieee_class_method_var().
06537 { 06538 struct ieee_handle *info = (struct ieee_handle *) p; 06539 06540 return ieee_class_method_var (info, physname, visibility, true, constp, 06541 volatilep, 0, false); 06542 }
Here is the call graph for this function:

| static boolean ieee_complex_type | ( | PTR | p, | |
| unsigned int | size | |||
| ) | [static] |
Definition at line 5354 of file ieee.c.
References ieee_handle::complex_double_index, ieee_handle::complex_float_index, ieee_define_type(), ieee_push_type(), ieee_write_id(), ieee_write_number(), and info.
05357 { 05358 struct ieee_handle *info = (struct ieee_handle *) p; 05359 char code; 05360 05361 switch (size) 05362 { 05363 case 4: 05364 if (info->complex_float_index != 0) 05365 return ieee_push_type (info, info->complex_float_index, size * 2, 05366 false, false); 05367 code = 'c'; 05368 break; 05369 case 12: 05370 case 16: 05371 /* These cases can be output by gcc -gstabs. Outputting the 05372 wrong type is better than crashing. */ 05373 case 8: 05374 if (info->complex_double_index != 0) 05375 return ieee_push_type (info, info->complex_double_index, size * 2, 05376 false, false); 05377 code = 'd'; 05378 break; 05379 default: 05380 fprintf (stderr, "IEEE unsupported complex type size %u\n", size); 05381 return false; 05382 } 05383 05384 /* FIXME: I don't know what the string is for. */ 05385 if (! ieee_define_type (info, size * 2, false, false) 05386 || ! ieee_write_number (info, code) 05387 || ! ieee_write_id (info, "")) 05388 return false; 05389 05390 if (size == 4) 05391 info->complex_float_index = info->type_stack->type.indx; 05392 else 05393 info->complex_double_index = info->type_stack->type.indx; 05394 05395 return true; 05396 }
Here is the call graph for this function:

| static boolean ieee_const_type | ( | PTR | p | ) | [static] |
Definition at line 5851 of file ieee.c.
References ieee_modified_type::const_qualified, ieee_define_type(), ieee_get_modified_info(), ieee_pop_type(), ieee_push_type(), ieee_write_number(), ieee_write_type::localp, NULL, ieee_write_type::size, ieee_type_stack::type, ieee_handle::type_stack, and ieee_write_type::unsignedp.
05853 { 05854 struct ieee_handle *info = (struct ieee_handle *) p; 05855 unsigned int size; 05856 boolean unsignedp, localp; 05857 unsigned int indx; 05858 struct ieee_modified_type *m = NULL; 05859 05860 size = info->type_stack->type.size; 05861 unsignedp = info->type_stack->type.unsignedp; 05862 localp = info->type_stack->type.localp; 05863 indx = ieee_pop_type (info); 05864 05865 if (! localp) 05866 { 05867 m = ieee_get_modified_info (info, indx); 05868 if (m == NULL) 05869 return false; 05870 05871 if (m->const_qualified > 0) 05872 return ieee_push_type (info, m->const_qualified, size, unsignedp, 05873 false); 05874 } 05875 05876 if (! ieee_define_type (info, size, unsignedp, localp) 05877 || ! ieee_write_number (info, 'n') 05878 || ! ieee_write_number (info, 1) 05879 || ! ieee_write_number (info, indx)) 05880 return false; 05881 05882 if (! localp) 05883 m->const_qualified = info->type_stack->type.indx; 05884 05885 return true; 05886 }
Here is the call graph for this function:

| static boolean ieee_define_named_type | ( | struct ieee_handle * | info, | |
| const char * | name, | |||
| unsigned int | indx, | |||
| unsigned int | size, | |||
| boolean | unsignedp, | |||
| boolean | localp, | |||
| struct ieee_buflist * | buflist | |||
| ) | [static] |
Definition at line 4526 of file ieee.c.
References ieee_bb_record_enum, ieee_buffer_emptyp, ieee_change_buffer(), ieee_nn_record, ieee_push_type(), ieee_ty_record_enum, ieee_write_byte, ieee_write_id(), ieee_write_number(), and NULL.
Referenced by ieee_define_type(), ieee_function_type(), ieee_start_function(), ieee_start_struct_type(), and ieee_typdef().
04534 { 04535 unsigned int type_indx; 04536 unsigned int name_indx; 04537 04538 if (indx != (unsigned int) -1) 04539 type_indx = indx; 04540 else 04541 { 04542 type_indx = info->type_indx; 04543 ++info->type_indx; 04544 } 04545 04546 name_indx = info->name_indx; 04547 ++info->name_indx; 04548 04549 if (name == NULL) 04550 name = ""; 04551 04552 /* If we were given a buffer, use it; otherwise, use either the 04553 local or the global type information, and make sure that the type 04554 block is started. */ 04555 if (buflist != NULL) 04556 { 04557 if (! ieee_change_buffer (info, buflist)) 04558 return false; 04559 } 04560 else if (localp) 04561 { 04562 if (! ieee_buffer_emptyp (&info->types)) 04563 { 04564 if (! ieee_change_buffer (info, &info->types)) 04565 return false; 04566 } 04567 else 04568 { 04569 if (! ieee_change_buffer (info, &info->types) 04570 || ! ieee_write_byte (info, (int) ieee_bb_record_enum) 04571 || ! ieee_write_byte (info, 1) 04572 || ! ieee_write_number (info, 0) 04573 || ! ieee_write_id (info, info->modname)) 04574 return false; 04575 } 04576 } 04577 else 04578 { 04579 if (! ieee_buffer_emptyp (&info->global_types)) 04580 { 04581 if (! ieee_change_buffer (info, &info->global_types)) 04582 return false; 04583 } 04584 else 04585 { 04586 if (! ieee_change_buffer (info, &info->global_types) 04587 || ! ieee_write_byte (info, (int) ieee_bb_record_enum) 04588 || ! ieee_write_byte (info, 2) 04589 || ! ieee_write_number (info, 0) 04590 || ! ieee_write_id (info, "")) 04591 return false; 04592 } 04593 } 04594 04595 /* Push the new type on the type stack, write out an NN record, and 04596 write out the start of a TY record. The caller will then finish 04597 the TY record. */ 04598 if (! ieee_push_type (info, type_indx, size, unsignedp, localp)) 04599 return false; 04600 04601 return (ieee_write_byte (info, (int) ieee_nn_record) 04602 && ieee_write_number (info, name_indx) 04603 && ieee_write_id (info, name) 04604 && ieee_write_byte (info, (int) ieee_ty_record_enum) 04605 && ieee_write_number (info, type_indx) 04606 && ieee_write_byte (info, 0xce) 04607 && ieee_write_number (info, name_indx)); 04608 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_define_type | ( | struct ieee_handle * | info, | |
| unsigned int | size, | |||
| boolean | unsignedp, | |||
| boolean | localp | |||
| ) | [static] |
Definition at line 4512 of file ieee.c.
References ieee_define_named_type(), and NULL.
Referenced by ieee_array_type(), ieee_complex_type(), ieee_const_type(), ieee_pointer_type(), ieee_range_type(), ieee_set_type(), ieee_struct_field(), and ieee_volatile_type().
04517 { 04518 return ieee_define_named_type (info, (const char *) NULL, 04519 (unsigned int) -1, size, unsignedp, 04520 localp, (struct ieee_buflist *) NULL); 04521 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_empty_type | ( | PTR | p | ) | [static] |
Definition at line 5263 of file ieee.c.
References builtin_unknown, ieee_push_type(), and info.
05265 { 05266 struct ieee_handle *info = (struct ieee_handle *) p; 05267 05268 return ieee_push_type (info, (int) builtin_unknown, 0, false, false); 05269 }
Here is the call graph for this function:

| static boolean ieee_end_block | ( | PTR | p, | |
| bfd_vma | addr | |||
| ) | [static] |
Definition at line 7433 of file ieee.c.
References ieee_be_record_enum, ieee_change_buffer(), ieee_end_range(), ieee_write_byte, ieee_write_number(), and ieee_handle::vars.
07436 { 07437 struct ieee_handle *info = (struct ieee_handle *) p; 07438 07439 /* The address we are given is the end of the block, but IEEE seems 07440 to want to the address of the last byte in the block, so we 07441 subtract one. */ 07442 if (! ieee_change_buffer (info, &info->vars) 07443 || ! ieee_write_byte (info, (int) ieee_be_record_enum) 07444 || ! ieee_write_number (info, addr - 1)) 07445 return false; 07446 07447 if (! ieee_end_range (info, addr)) 07448 return false; 07449 07450 --info->block_depth; 07451 07452 if (addr > info->highaddr) 07453 info->highaddr = addr; 07454 07455 return true; 07456 }
Here is the call graph for this function:

| static boolean ieee_end_class_type | ( | PTR | p | ) | [static] |
Definition at line 6564 of file ieee.c.
References assert, ieee_write_type::classdef, ieee_handle::cxx, ieee_append_buffer(), ieee_atn_record_enum, ieee_buffer_emptyp, ieee_change_buffer(), ieee_end_struct_type(), ieee_nn_record, ieee_write_2bytes(), ieee_write_asn(), ieee_write_atn65(), ieee_write_byte, ieee_write_id(), ieee_write_number(), ieee_write_type::ignorep, ieee_type_class::indx, NULL, ieee_type_class::ownvptr, ieee_type_class::pmiscbuf, ieee_type_stack::type, ieee_handle::type_stack, and ieee_type_class::vclass.
06566 { 06567 struct ieee_handle *info = (struct ieee_handle *) p; 06568 unsigned int nindx; 06569 06570 assert (info->type_stack != NULL 06571 && info->type_stack->type.classdef != NULL); 06572 06573 /* If we were ignoring this class definition because it was a 06574 duplicate definition, just through away whatever bytes we have 06575 accumulated. Leave the type on the stack. */ 06576 if (info->type_stack->type.ignorep) 06577 return true; 06578 06579 nindx = info->type_stack->type.classdef->indx; 06580 06581 /* If we have a virtual table, we can write out the information now. */ 06582 if (info->type_stack->type.classdef->vclass != NULL 06583 || info->type_stack->type.classdef->ownvptr) 06584 { 06585 if (! ieee_change_buffer (info, 06586 &info->type_stack->type.classdef->pmiscbuf) 06587 || ! ieee_write_asn (info, nindx, 'z') 06588 || ! ieee_write_atn65 (info, nindx, "") 06589 || ! ieee_write_asn (info, nindx, 06590 info->type_stack->type.classdef->voffset)) 06591 return false; 06592 if (info->type_stack->type.classdef->ownvptr) 06593 { 06594 if (! ieee_write_atn65 (info, nindx, "")) 06595 return false; 06596 } 06597 else 06598 { 06599 if (! ieee_write_atn65 (info, nindx, 06600 info->type_stack->type.classdef->vclass)) 06601 return false; 06602 } 06603 if (! ieee_write_asn (info, nindx, 0)) 06604 return false; 06605 info->type_stack->type.classdef->pmisccount += 5; 06606 } 06607 06608 /* Now that we know the number of pmisc records, we can write out 06609 the atn62 which starts the pmisc records, and append them to the 06610 C++ buffers. */ 06611 06612 if (! ieee_change_buffer (info, &info->cxx) 06613 || ! ieee_write_byte (info, (int) ieee_nn_record) 06614 || ! ieee_write_number (info, nindx) 06615 || ! ieee_write_id (info, "") 06616 || ! ieee_write_2bytes (info, (int) ieee_atn_record_enum) 06617 || ! ieee_write_number (info, nindx) 06618 || ! ieee_write_number (info, 0) 06619 || ! ieee_write_number (info, 62) 06620 || ! ieee_write_number (info, 80) 06621 || ! ieee_write_number (info, 06622 info->type_stack->type.classdef->pmisccount)) 06623 return false; 06624 06625 if (! ieee_append_buffer (info, &info->cxx, 06626 &info->type_stack->type.classdef->pmiscbuf)) 06627 return false; 06628 if (! ieee_buffer_emptyp (&info->type_stack->type.classdef->refs)) 06629 { 06630 if (! ieee_append_buffer (info, &info->cxx, 06631 &info->type_stack->type.classdef->refs)) 06632 return false; 06633 } 06634 06635 return ieee_end_struct_type (p); 06636 }
Here is the call graph for this function:

| static boolean ieee_end_function | ( | PTR | p | ) | [static] |
Definition at line 7461 of file ieee.c.
References assert, ieee_handle::block_depth, ieee_handle::fntype, ieee_append_buffer(), ieee_bb_record_enum, ieee_buffer_emptyp, ieee_change_buffer(), ieee_init_buffer(), ieee_write_byte, ieee_write_id(), ieee_write_number(), and NULL.
07463 { 07464 struct ieee_handle *info = (struct ieee_handle *) p; 07465 07466 assert (info->block_depth == 1); 07467 07468 --info->block_depth; 07469 07470 /* Now we can finish up fntype, and add it to the typdef section. 07471 At this point, fntype is the 'x' type up to the argument count, 07472 and fnargs is the argument types. We must add the argument 07473 count, and we must add the level. FIXME: We don't record varargs 07474 functions correctly. In fact, stabs debugging does not give us 07475 enough information to do so. */ 07476 if (! ieee_change_buffer (info, &info->fntype) 07477 || ! ieee_write_number (info, info->fnargcount) 07478 || ! ieee_change_buffer (info, &info->fnargs) 07479 || ! ieee_write_number (info, 0)) 07480 return false; 07481 07482 /* Make sure the typdef block has been started. */ 07483 if (ieee_buffer_emptyp (&info->types)) 07484 { 07485 if (! ieee_change_buffer (info, &info->types) 07486 || ! ieee_write_byte (info, (int) ieee_bb_record_enum) 07487 || ! ieee_write_byte (info, 1) 07488 || ! ieee_write_number (info, 0) 07489 || ! ieee_write_id (info, info->modname)) 07490 return false; 07491 } 07492 07493 if (! ieee_append_buffer (info, &info->types, &info->fntype) 07494 || ! ieee_append_buffer (info, &info->types, &info->fnargs)) 07495 return false; 07496 07497 info->fnname = NULL; 07498 if (! ieee_init_buffer (info, &info->fntype) 07499 || ! ieee_init_buffer (info, &info->fnargs)) 07500 return false; 07501 info->fnargcount = 0; 07502 07503 return true; 07504 }
Here is the call graph for this function:

| static boolean ieee_end_range | ( | struct ieee_handle * | info, | |
| bfd_vma | high | |||
| ) | [static] |
Definition at line 4494 of file ieee.c.
References assert, free, ieee_add_range(), ieee_range::low, ieee_range::next, and NULL.
Referenced by ieee_end_block().
04497 { 04498 struct ieee_range *r; 04499 bfd_vma low; 04500 04501 assert (info->pending_ranges != NULL); 04502 r = info->pending_ranges; 04503 low = r->low; 04504 info->pending_ranges = r->next; 04505 free (r); 04506 return ieee_add_range (info, false, low, high); 04507 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_end_struct_type | ( | PTR | p | ) | [static] |
Definition at line 6174 of file ieee.c.
References assert, ieee_handle::global_types, ieee_append_buffer(), ieee_bb_record_enum, ieee_buffer_emptyp, ieee_change_buffer(), ieee_init_buffer(), ieee_write_byte, ieee_write_id(), ieee_write_number(), ieee_write_type::ignorep, ieee_write_type::localp, NULL, ieee_write_type::strdef, ieee_type_stack::type, ieee_handle::type_stack, and ieee_handle::types.
Referenced by ieee_end_class_type().
06176 { 06177 struct ieee_handle *info = (struct ieee_handle *) p; 06178 struct ieee_buflist *pb; 06179 06180 assert (info->type_stack != NULL 06181 && ! ieee_buffer_emptyp (&info->type_stack->type.strdef)); 06182 06183 /* If we were ignoring this struct definition because it was a 06184 duplicate defintion, just through away whatever bytes we have 06185 accumulated. Leave the type on the stack. */ 06186 if (info->type_stack->type.ignorep) 06187 return true; 06188 06189 /* If this is not a duplicate definition of this tag, then localp 06190 will be false, and we can put it in the global type block. 06191 FIXME: We should avoid outputting duplicate definitions which are 06192 the same. */ 06193 if (! info->type_stack->type.localp) 06194 { 06195 /* Make sure we have started the global type block. */ 06196 if (ieee_buffer_emptyp (&info->global_types)) 06197 { 06198 if (! ieee_change_buffer (info, &info->global_types) 06199 || ! ieee_write_byte (info, (int) ieee_bb_record_enum) 06200 || ! ieee_write_byte (info, 2) 06201 || ! ieee_write_number (info, 0) 06202 || ! ieee_write_id (info, "")) 06203 return false; 06204 } 06205 pb = &info->global_types; 06206 } 06207 else 06208 { 06209 /* Make sure we have started the types block. */ 06210 if (ieee_buffer_emptyp (&info->types)) 06211 { 06212 if (! ieee_change_buffer (info, &info->types) 06213 || ! ieee_write_byte (info, (int) ieee_bb_record_enum) 06214 || ! ieee_write_byte (info, 1) 06215 || ! ieee_write_number (info, 0) 06216 || ! ieee_write_id (info, info->modname)) 06217 return false; 06218 } 06219 pb = &info->types; 06220 } 06221 06222 /* Append the struct definition to the types. */ 06223 if (! ieee_append_buffer (info, pb, &info->type_stack->type.strdef) 06224 || ! ieee_init_buffer (info, &info->type_stack->type.strdef)) 06225 return false; 06226 06227 /* Leave the struct on the type stack. */ 06228 06229 return true; 06230 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_enum_type | ( | PTR | p, | |
| const char * | tag, | |||
| const char ** | names, | |||
| bfd_signed_vma * | vals | |||
| ) | [static] |
Definition at line 5412 of file ieee.c.
References e, ieee_handle::enums, ieee_push_type(), ieee_defined_enum::indx, info, int(), NULL, and strcmp().
05417 { 05418 struct ieee_handle *info = (struct ieee_handle *) p; 05419 struct ieee_defined_enum *e; 05420 boolean localp, simple; 05421 unsigned int indx; 05422 int i = 0; 05423 05424 localp = false; 05425 indx = (unsigned int) -1; 05426 for (e = info->enums; e != NULL; e = e->next) 05427 { 05428 if (tag == NULL) 05429 { 05430 if (e->tag != NULL) 05431 continue; 05432 } 05433 else 05434 { 05435 if (e->tag == NULL 05436 || tag[0] != e->tag[0] 05437 || strcmp (tag, e->tag) != 0) 05438 continue; 05439 } 05440 05441 if (! e->defined) 05442 { 05443 /* This enum tag has been seen but not defined. */ 05444 indx = e->indx; 05445 break; 05446 } 05447 05448 if (names != NULL && e->names != NULL) 05449 { 05450 for (i = 0; names[i] != NULL && e->names[i] != NULL; i++) 05451 { 05452 if (names[i][0] != e->names[i][0] 05453 || vals[i] != e->vals[i] 05454 || strcmp (names[i], e->names[i]) != 0) 05455 break; 05456 } 05457 } 05458 05459 if ((names == NULL && e->names == NULL) 05460 || (names != NULL 05461 && e->names != NULL 05462 && names[i] == NULL 05463 && e->names[i] == NULL)) 05464 { 05465 /* We've seen this enum before. */ 05466 return ieee_push_type (info, e->indx, 0, true, false); 05467 } 05468 05469 if (tag != NULL) 05470 { 05471 /* We've already seen an enum of the same name, so we must make 05472 sure to output this one locally. */ 05473 localp = true; 05474 break; 05475 } 05476 } 05477 05478 /* If this is a simple enumeration, in which the values start at 0 05479 and always increment by 1, we can use type E. Otherwise we must 05480 use type N. */ 05481 05482 simple = true; 05483 if (names != NULL) 05484 { 05485 for (i = 0; names[i] != NULL; i++) 05486 { 05487 if (vals[i] != i) 05488 { 05489 simple = false; 05490 break; 05491 } 05492 } 05493 } 05494 05495 if (! ieee_define_named_type (info, tag, indx, 0, true, localp, 05496 (struct ieee_buflist *) NULL) 05497 || ! ieee_write_number (info, simple ? 'E' : 'N')) 05498 return false; 05499 if (simple) 05500 { 05501 /* FIXME: This is supposed to be the enumeration size, but we 05502 don't store that. */ 05503 if (! ieee_write_number (info, 4)) 05504 return false; 05505 } 05506 if (names != NULL) 05507 { 05508 for (i = 0; names[i] != NULL; i++) 05509 { 05510 if (! ieee_write_id (info, names[i])) 05511 return false; 05512 if (! simple) 05513 { 05514 if (! ieee_write_number (info, vals[i])) 05515 return false; 05516 } 05517 } 05518 } 05519 05520 if (! localp) 05521 { 05522 if (indx == (unsigned int) -1) 05523 { 05524 e = (struct ieee_defined_enum *) xmalloc (sizeof *e); 05525 memset (e, 0, sizeof *e); 05526 e->indx = info->type_stack->type.indx; 05527 e->tag = tag; 05528 05529 e->next = info->enums; 05530 info->enums = e; 05531 } 05532 05533 e->names = names; 05534 e->vals = vals; 05535 e->defined = true; 05536 } 05537 05538 return true; 05539 }
Here is the call graph for this function:

| static void ieee_eof | ( | struct ieee_info * | info | ) | [static] |
Definition at line 312 of file ieee.c.
References ieee_error(), and NULL.
Referenced by ieee_read_optional_id(), and ieee_read_optional_number().
00314 { 00315 ieee_error (info, (const bfd_byte *) NULL, 00316 "unexpected end of debugging information"); 00317 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static void ieee_error | ( | struct ieee_info * | info, | |
| const bfd_byte * | p, | |||
| const char * | s | |||
| ) | [static] |
Definition at line 297 of file ieee.c.
References NULL.
Referenced by ieee_builtin_type(), ieee_eof(), ieee_read_cxx_class(), ieee_read_cxx_defaults(), ieee_read_cxx_misc(), ieee_read_expression(), ieee_read_optional_id(), ieee_read_optional_number(), ieee_read_reference(), ieee_require_asn(), ieee_require_atn65(), parse_ieee(), parse_ieee_atn(), parse_ieee_bb(), parse_ieee_be(), parse_ieee_nn(), and parse_ieee_ty().
00301 { 00302 if (p != NULL) 00303 fprintf (stderr, "%s: 0x%lx: %s (0x%x)\n", bfd_get_filename (info->abfd), 00304 (unsigned long) (p - info->bytes), s, *p); 00305 else 00306 fprintf (stderr, "%s: %s\n", bfd_get_filename (info->abfd), s); 00307 }
Here is the caller graph for this function:

| static boolean ieee_finish_compilation_unit | ( | struct ieee_handle * | info | ) | [static] |
Definition at line 4980 of file ieee.c.
References assert, ieee_range::high, ieee_add_range(), ieee_append_buffer(), ieee_bb_record_enum, ieee_be_record_enum, ieee_buffer_emptyp, ieee_change_buffer(), ieee_lineno(), IEEE_SECTION_NUMBER_BASE, ieee_write_byte, ieee_write_id(), ieee_write_number(), ieee_range::low, ieee_range::next, NULL, and strcmp().
Referenced by ieee_start_compilation_unit(), and write_ieee_debugging_info().
04982 { 04983 struct ieee_range *r; 04984 04985 if (! ieee_buffer_emptyp (&info->types)) 04986 { 04987 if (! ieee_change_buffer (info, &info->types) 04988 || ! ieee_write_byte (info, (int) ieee_be_record_enum)) 04989 return false; 04990 } 04991 04992 if (! ieee_buffer_emptyp (&info->cxx)) 04993 { 04994 /* Append any C++ information to the global function and 04995 variable information. */ 04996 assert (! ieee_buffer_emptyp (&info->vars)); 04997 if (! ieee_change_buffer (info, &info->vars)) 04998 return false; 04999 05000 /* We put the pmisc records in a dummy procedure, just as the 05001 MRI compiler does. */ 05002 if (! ieee_write_byte (info, (int) ieee_bb_record_enum) 05003 || ! ieee_write_byte (info, 6) 05004 || ! ieee_write_number (info, 0) 05005 || ! ieee_write_id (info, "__XRYCPP") 05006 || ! ieee_write_number (info, 0) 05007 || ! ieee_write_number (info, 0) 05008 || ! ieee_write_number (info, info->highaddr - 1) 05009 || ! ieee_append_buffer (info, &info->vars, &info->cxx) 05010 || ! ieee_change_buffer (info, &info->vars) 05011 || ! ieee_write_byte (info, (int) ieee_be_record_enum) 05012 || ! ieee_write_number (info, info->highaddr - 1)) 05013 return false; 05014 } 05015 05016 if (! ieee_buffer_emptyp (&info->vars)) 05017 { 05018 if (! ieee_change_buffer (info, &info->vars) 05019 || ! ieee_write_byte (info, (int) ieee_be_record_enum)) 05020 return false; 05021 } 05022 05023 if (info->pending_lineno_filename != NULL) 05024 { 05025 /* Force out the pending line number. */ 05026 if (! ieee_lineno ((PTR) info, (const char *) NULL, 0, (bfd_vma) -1)) 05027 return false; 05028 } 05029 if (! ieee_buffer_emptyp (&info->linenos)) 05030 { 05031 if (! ieee_change_buffer (info, &info->linenos) 05032 || ! ieee_write_byte (info, (int) ieee_be_record_enum)) 05033 return false; 05034 if (strcmp (info->filename, info->lineno_filename) != 0) 05035 { 05036 /* We were not in the main file. We just closed the 05037 included line number block, and now we must close the 05038 main line number block. */ 05039 if (! ieee_write_byte (info, (int) ieee_be_record_enum)) 05040 return false; 05041 } 05042 } 05043 05044 if (! ieee_append_buffer (info, &info->data, &info->types) 05045 || ! ieee_append_buffer (info, &info->data, &info->vars) 05046 || ! ieee_append_buffer (info, &info->data, &info->linenos)) 05047 return false; 05048 05049 /* Build BB10/BB11 blocks based on the ranges we recorded. */ 05050 if (! ieee_change_buffer (info, &info->data)) 05051 return false; 05052 05053 if (! ieee_write_byte (info, (int) ieee_bb_record_enum) 05054 || ! ieee_write_byte (info, 10) 05055 || ! ieee_write_number (info, 0) 05056 || ! ieee_write_id (info, info->modname) 05057 || ! ieee_write_id (info, "") 05058 || ! ieee_write_number (info, 0) 05059 || ! ieee_write_id (info, "GNU objcopy")) 05060 return false; 05061 05062 for (r = info->ranges; r != NULL; r = r->next) 05063 { 05064 bfd_vma low, high; 05065 asection *s; 05066 int kind; 05067 05068 low = r->low; 05069 high = r->high; 05070 05071 /* Find the section corresponding to this range. */ 05072 for (s = info->abfd->sections; s != NULL; s = s->next) 05073 { 05074 if (bfd_get_section_vma (info->abfd, s) <= low 05075 && high <= (bfd_get_section_vma (info->abfd, s) 05076 + bfd_section_size (info->abfd, s))) 05077 break; 05078 } 05079 05080 if (s == NULL) 05081 { 05082 /* Just ignore this range. */ 05083 continue; 05084 } 05085 05086 /* Coalesce ranges if it seems reasonable. */ 05087 while (r->next != NULL 05088 && high + 0x1000 >= r->next->low 05089 && (r->next->high 05090 <= (bfd_get_section_vma (info->abfd, s) 05091 + bfd_section_size (info->abfd, s)))) 05092 { 05093 r = r->next; 05094 high = r->high; 05095 } 05096 05097 if ((s->flags & SEC_CODE) != 0) 05098 kind = 1; 05099 else if ((s->flags & SEC_READONLY) != 0) 05100 kind = 3; 05101 else 05102 kind = 2; 05103 05104 if (! ieee_write_byte (info, (int) ieee_bb_record_enum) 05105 || ! ieee_write_byte (info, 11) 05106 || ! ieee_write_number (info, 0) 05107 || ! ieee_write_id (info, "") 05108 || ! ieee_write_number (info, kind) 05109 || ! ieee_write_number (info, s->index + IEEE_SECTION_NUMBER_BASE) 05110 || ! ieee_write_number (info, low) 05111 || ! ieee_write_byte (info, (int) ieee_be_record_enum) 05112 || ! ieee_write_number (info, high - low)) 05113 return false; 05114 05115 /* Add this range to the list of global ranges. */ 05116 if (! ieee_add_range (info, true, low, high)) 05117 return false; 05118 } 05119 05120 if (! ieee_write_byte (info, (int) ieee_be_record_enum)) 05121 return false; 05122 05123 return true; 05124 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_float_constant | ( | PTR | p, | |
| const char * | name, | |||
| double | val | |||
| ) | [static] |
| static boolean ieee_float_type | ( | PTR | p, | |
| unsigned int | size | |||
| ) | [static] |
Definition at line 5321 of file ieee.c.
References builtin_double, builtin_float, builtin_long_double, builtin_long_long_double, ieee_push_type(), info, and int().
05324 { 05325 struct ieee_handle *info = (struct ieee_handle *) p; 05326 unsigned int indx; 05327 05328 switch (size) 05329 { 05330 case 4: 05331 indx = (int) builtin_float; 05332 break; 05333 case 8: 05334 indx = (int) builtin_double; 05335 break; 05336 case 12: 05337 /* FIXME: This size really depends upon the processor. */ 05338 indx = (int) builtin_long_double; 05339 break; 05340 case 16: 05341 indx = (int) builtin_long_long_double; 05342 break; 05343 default: 05344 fprintf (stderr, "IEEE unsupported float type size %u\n", size); 05345 return false; 05346 } 05347 05348 return ieee_push_type (info, indx, size, false, false); 05349 }
Here is the call graph for this function:

| static boolean ieee_function_parameter | ( | PTR | p, | |
| const char * | name, | |||
| enum debug_parm_kind | kind, | |||
| bfd_vma | val | |||
| ) | [static] |
Definition at line 7268 of file ieee.c.
References assert, ieee_handle::block_depth, ieee_handle::fnargs, ieee_change_buffer(), ieee_pop_type(), ieee_write_number(), memset, ieee_pending_parm::next, NULL, ieee_handle::pending_parms, ieee_write_type::referencep, ieee_type_stack::type, ieee_handle::type_stack, and xmalloc().
07273 { 07274 struct ieee_handle *info = (struct ieee_handle *) p; 07275 struct ieee_pending_parm *m, **pm; 07276 07277 assert (info->block_depth == 1); 07278 07279 m = (struct ieee_pending_parm *) xmalloc (sizeof *m); 07280 memset (m, 0, sizeof *m); 07281 07282 m->next = NULL; 07283 m->name = name; 07284 m->referencep = info->type_stack->type.referencep; 07285 m->type = ieee_pop_type (info); 07286 m->kind = kind; 07287 m->val = val; 07288 07289 for (pm = &info->pending_parms; *pm != NULL; pm = &(*pm)->next) 07290 ; 07291 *pm = m; 07292 07293 /* Add the type to the fnargs list. */ 07294 if (! ieee_change_buffer (info, &info->fnargs) 07295 || ! ieee_write_number (info, m->type)) 07296 return false; 07297 ++info->fnargcount; 07298 07299 return true; 07300 }
Here is the call graph for this function:

| static boolean ieee_function_type | ( | PTR | p, | |
| int | argcount, | |||
| boolean | varargs | |||
| ) | [static] |
Definition at line 5588 of file ieee.c.
References args, builtin_void, free, ieee_modified_type::function, ieee_define_named_type(), ieee_get_modified_info(), ieee_init_buffer(), ieee_pop_type(), ieee_push_type(), ieee_write_number(), ieee_write_type::localp, NULL, ieee_type_stack::type, ieee_handle::type_stack, and xmalloc().
Referenced by ieee_method_type().
05592 { 05593 struct ieee_handle *info = (struct ieee_handle *) p; 05594 boolean localp; 05595 unsigned int *args = NULL; 05596 int i; 05597 unsigned int retindx; 05598 struct ieee_buflist fndef; 05599 struct ieee_modified_type *m; 05600 05601 localp = false; 05602 05603 if (argcount > 0) 05604 { 05605 args = (unsigned int *) xmalloc (argcount * sizeof *args); 05606 for (i = argcount - 1; i >= 0; i--) 05607 { 05608 if (info->type_stack->type.localp) 05609 localp = true; 05610 args[i] = ieee_pop_type (info); 05611 } 05612 } 05613 else if (argcount < 0) 05614 varargs = false; 05615 05616 if (info->type_stack->type.localp) 05617 localp = true; 05618 retindx = ieee_pop_type (info); 05619 05620 m = NULL; 05621 if (argcount < 0 && ! localp) 05622 { 05623 m = ieee_get_modified_info (p, retindx); 05624 if (m == NULL) 05625 return false; 05626 05627 if (m->function > 0) 05628 return ieee_push_type (info, m->function, 0, true, false); 05629 } 05630 05631 /* An attribute of 0x41 means that the frame and push mask are 05632 unknown. */ 05633 if (! ieee_init_buffer (info, &fndef) 05634 || ! ieee_define_named_type (info, (const char *) NULL, 05635 (unsigned int) -1, 0, true, localp, 05636 &fndef) 05637 || ! ieee_write_number (info, 'x') 05638 || ! ieee_write_number (info, 0x41) 05639 || ! ieee_write_number (info, 0) 05640 || ! ieee_write_number (info, 0) 05641 || ! ieee_write_number (info, retindx) 05642 || ! ieee_write_number (info, (bfd_vma) argcount + (varargs ? 1 : 0))) 05643 return false; 05644 if (argcount > 0) 05645 { 05646 for (i = 0; i < argcount; i++) 05647 if (! ieee_write_number (info, args[i])) 05648 return false; 05649 free (args); 05650 } 05651 if (varargs) 05652 { 05653 /* A varargs function is represented by writing out the last 05654 argument as type void *, although this makes little sense. */ 05655 if (! ieee_write_number (info, (bfd_vma) builtin_void + 32)) 05656 return false; 05657 } 05658 05659 if (! ieee_write_number (info, 0)) 05660 return false; 05661 05662 /* We wrote the information into fndef, in case we don't need it. 05663 It will be appended to info->types by ieee_pop_type. */ 05664 info->type_stack->type.fndef = fndef; 05665 05666 if (m != NULL) 05667 m->function = info->type_stack->type.indx; 05668 05669 return true; 05670 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static int ieee_genreg_to_regno | ( | bfd * | abfd, | |
| int | r | |||
| ) | [static] |
Definition at line 3621 of file ieee.c.
Referenced by ieee_variable().
03624 { 03625 switch (bfd_get_arch (abfd)) 03626 { 03627 case bfd_arch_m68k: 03628 /* For some reason stabs add 2 to the floating point register 03629 numbers. */ 03630 if (r >= 18) 03631 r -= 2; 03632 break; 03633 03634 case bfd_arch_i960: 03635 /* Stabs uses 0 to 15 for r0 to r15, 16 to 31 for g0 to g15, and 03636 32 to 35 for fp0 to fp3. */ 03637 ++r; 03638 break; 03639 03640 default: 03641 break; 03642 } 03643 03644 return r; 03645 }
Here is the caller graph for this function:

| static struct ieee_modified_type* ieee_get_modified_info | ( | struct ieee_handle * | info, | |
| unsigned int | indx | |||
| ) | [static] |
Definition at line 4613 of file ieee.c.
References memset, and xrealloc().
Referenced by ieee_array_type(), ieee_const_type(), ieee_function_type(), ieee_pointer_type(), and ieee_volatile_type().
04616 { 04617 if (indx >= info->modified_alloc) 04618 { 04619 unsigned int nalloc; 04620 04621 nalloc = info->modified_alloc; 04622 if (nalloc == 0) 04623 nalloc = 16; 04624 while (indx >= nalloc) 04625 nalloc *= 2; 04626 info->modified = ((struct ieee_modified_type *) 04627 xrealloc (info->modified, 04628 nalloc * sizeof *info->modified)); 04629 memset (info->modified + info->modified_alloc, 0, 04630 (nalloc - info->modified_alloc) * sizeof *info->modified); 04631 info->modified_alloc = nalloc; 04632 } 04633 04634 return info->modified + indx; 04635 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_init_buffer | ( | struct ieee_handle * | info, | |
| struct ieee_buflist * | buflist | |||
| ) | [static] |
Definition at line 4099 of file ieee.c.
References ieee_buflist::head, NULL, and ieee_buflist::tail.
Referenced by ieee_end_function(), ieee_end_struct_type(), ieee_function_type(), ieee_start_class_type(), ieee_start_compilation_unit(), ieee_start_function(), ieee_start_struct_type(), and write_ieee_debugging_info().
Here is the caller graph for this function:

| static boolean ieee_int_constant | ( | PTR | p, | |
| const char * | name, | |||
| bfd_vma | val | |||
| ) | [static] |
| static boolean ieee_int_type | ( | PTR | p, | |
| unsigned int | size, | |||
| boolean | unsignedp | |||
| ) | [static] |
Definition at line 5285 of file ieee.c.
References builtin_signed_char, builtin_signed_long, builtin_signed_long_long, builtin_signed_short_int, ieee_push_type(), info, and int().
Referenced by ieee_bool_type(), and ieee_offset_type().
05289 { 05290 struct ieee_handle *info = (struct ieee_handle *) p; 05291 unsigned int indx; 05292 05293 switch (size) 05294 { 05295 case 1: 05296 indx = (int) builtin_signed_char; 05297 break; 05298 case 2: 05299 indx = (int) builtin_signed_short_int; 05300 break; 05301 case 4: 05302 indx = (int) builtin_signed_long; 05303 break; 05304 case 8: 05305 indx = (int) builtin_signed_long_long; 05306 break; 05307 default: 05308 fprintf (stderr, "IEEE unsupported integer type size %u\n", size); 05309 return false; 05310 } 05311 05312 if (unsignedp) 05313 ++indx; 05314 05315 return ieee_push_type (info, indx, size, unsignedp, false); 05316 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_lineno | ( | PTR | p, | |
| const char * | filename, | |||
| unsigned long | lineno, | |||
| bfd_vma | addr | |||
| ) | [static] |
Definition at line 7509 of file ieee.c.
References assert, ieee_handle::filename, ieee_atn_record_enum, ieee_bb_record_enum, ieee_be_record_enum, ieee_buffer_emptyp, ieee_change_buffer(), ieee_nn_record, ieee_write_2bytes(), ieee_write_asn(), ieee_write_byte, ieee_write_id(), ieee_write_number(), ieee_handle::lineno_filename, ieee_handle::lineno_name_indx, ieee_handle::linenos, ieee_handle::name_indx, NULL, ieee_handle::pending_lineno, ieee_handle::pending_lineno_addr, ieee_handle::pending_lineno_filename, and strcmp().
Referenced by ieee_finish_compilation_unit().
07514 { 07515 struct ieee_handle *info = (struct ieee_handle *) p; 07516 07517 assert (info->filename != NULL); 07518 07519 /* The HP simulator seems to get confused when more than one line is 07520 listed for the same address, at least if they are in different 07521 files. We handle this by always listing the last line for a 07522 given address, since that seems to be the one that gdb uses. */ 07523 if (info->pending_lineno_filename != NULL 07524 && addr != info->pending_lineno_addr) 07525 { 07526 /* Make sure we have a line number block. */ 07527 if (! ieee_buffer_emptyp (&info->linenos)) 07528 { 07529 if (! ieee_change_buffer (info, &info->linenos)) 07530 return false; 07531 } 07532 else 07533 { 07534 info->lineno_name_indx = info->name_indx; 07535 ++info->name_indx; 07536 if (! ieee_change_buffer (info, &info->linenos) 07537 || ! ieee_write_byte (info, (int) ieee_bb_record_enum) 07538 || ! ieee_write_byte (info, 5) 07539 || ! ieee_write_number (info, 0) 07540 || ! ieee_write_id (info, info->filename) 07541 || ! ieee_write_byte (info, (int) ieee_nn_record) 07542 || ! ieee_write_number (info, info->lineno_name_indx) 07543 || ! ieee_write_id (info, "")) 07544 return false; 07545 info->lineno_filename = info->filename; 07546 } 07547 07548 if (strcmp (info->pending_lineno_filename, info->lineno_filename) != 0) 07549 { 07550 if (strcmp (info->filename, info->lineno_filename) != 0) 07551 { 07552 /* We were not in the main file. Close the block for the 07553 included file. */ 07554 if (! ieee_write_byte (info, (int) ieee_be_record_enum)) 07555 return false; 07556 if (strcmp (info->filename, info->pending_lineno_filename) == 0) 07557 { 07558 /* We need a new NN record, and we aren't about to 07559 output one. */ 07560 info->lineno_name_indx = info->name_indx; 07561 ++info->name_indx; 07562 if (! ieee_write_byte (info, (int) ieee_nn_record) 07563 || ! ieee_write_number (info, info->lineno_name_indx) 07564 || ! ieee_write_id (info, "")) 07565 return false; 07566 } 07567 } 07568 if (strcmp (info->filename, info->pending_lineno_filename) != 0) 07569 { 07570 /* We are not changing to the main file. Open a block for 07571 the new included file. */ 07572 info->lineno_name_indx = info->name_indx; 07573 ++info->name_indx; 07574 if (! ieee_write_byte (info, (int) ieee_bb_record_enum) 07575 || ! ieee_write_byte (info, 5) 07576 || ! ieee_write_number (info, 0) 07577 || ! ieee_write_id (info, info->pending_lineno_filename) 07578 || ! ieee_write_byte (info, (int) ieee_nn_record) 07579 || ! ieee_write_number (info, info->lineno_name_indx) 07580 || ! ieee_write_id (info, "")) 07581 return false; 07582 } 07583 info->lineno_filename = info->pending_lineno_filename; 07584 } 07585 07586 if (! ieee_write_2bytes (info, (int) ieee_atn_record_enum) 07587 || ! ieee_write_number (info, info->lineno_name_indx) 07588 || ! ieee_write_number (info, 0) 07589 || ! ieee_write_number (info, 7) 07590 || ! ieee_write_number (info, info->pending_lineno) 07591 || ! ieee_write_number (info, 0) 07592 || ! ieee_write_asn (info, info->lineno_name_indx, 07593 info->pending_lineno_addr)) 07594 return false; 07595 } 07596 07597 info->pending_lineno_filename = filename; 07598 info->pending_lineno = lineno; 07599 info->pending_lineno_addr = addr; 07600 07601 return true; 07602 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_method_type | ( | PTR | p, | |
| boolean | domain, | |||
| int | argcount, | |||
| boolean | varargs | |||
| ) | [static] |
Definition at line 5830 of file ieee.c.
References ieee_function_type(), and ieee_pop_unused_type().
05835 { 05836 struct ieee_handle *info = (struct ieee_handle *) p; 05837 05838 /* FIXME: The MRI/HP IEEE spec defines a pmisc record to use for a 05839 method, but the definition is incomplete. We just output an 'x' 05840 type. */ 05841 05842 if (domain) 05843 ieee_pop_unused_type (info); 05844 05845 return ieee_function_type (p, argcount, varargs); 05846 }
Here is the call graph for this function:

| static struct bfd_hash_entry* ieee_name_type_newfunc | ( | struct bfd_hash_entry * | entry, | |
| struct bfd_hash_table * | table, | |||
| const char * | string | |||
| ) | [static] |
Definition at line 4642 of file ieee.c.
References NULL.
Referenced by write_ieee_debugging_info().
04646 { 04647 struct ieee_name_type_hash_entry *ret = 04648 (struct ieee_name_type_hash_entry *) entry; 04649 04650 /* Allocate the structure if it has not already been allocated by a 04651 subclass. */ 04652 if (ret == NULL) 04653 ret = ((struct ieee_name_type_hash_entry *) 04654 bfd_hash_allocate (table, sizeof *ret)); 04655 if (ret == NULL) 04656 return NULL; 04657 04658 /* Call the allocation method of the superclass. */ 04659 ret = ((struct ieee_name_type_hash_entry *) 04660 bfd_hash_newfunc ((struct bfd_hash_entry *) ret, table, string)); 04661 if (ret) 04662 { 04663 /* Set local fields. */ 04664 ret->types = NULL; 04665 } 04666 04667 return (struct bfd_hash_entry *) ret; 04668 }
Here is the caller graph for this function:

| static boolean ieee_offset_type | ( | PTR | p | ) | [static] |
Definition at line 5808 of file ieee.c.
References ieee_int_type(), and ieee_pop_type().
05810 { 05811 struct ieee_handle *info = (struct ieee_handle *) p; 05812 unsigned int targetindx, baseindx; 05813 05814 targetindx = ieee_pop_type (info); 05815 baseindx = ieee_pop_type (info); 05816 05817 /* FIXME: The MRI C++ compiler does not appear to generate any 05818 useful type information about an offset type. It just records a 05819 pointer to member as an integer. The MRI/HP IEEE spec does 05820 describe a pmisc record which can be used for a pointer to 05821 member. Unfortunately, it does not describe the target type, 05822 which seems pretty important. I'm going to punt this for now. */ 05823 05824 return ieee_int_type (p, 4, true); 05825 }
Here is the call graph for this function:

| static boolean ieee_output_pending_parms | ( | struct ieee_handle * | info | ) | [static] |
Definition at line 7305 of file ieee.c.
References abort(), DEBUG_LOCAL, DEBUG_PARM_REF_REG, DEBUG_PARM_REFERENCE, DEBUG_PARM_REG, DEBUG_PARM_STACK, DEBUG_REGISTER, free, ieee_atn_record_enum, ieee_change_buffer(), ieee_nn_record, ieee_push_type(), ieee_variable(), ieee_write_2bytes(), ieee_write_asn(), ieee_write_atn65(), ieee_write_byte, ieee_write_id(), ieee_write_number(), ieee_pending_parm::kind, ieee_pending_parm::name, ieee_pending_parm::next, NULL, ieee_pending_parm::referencep, ieee_pending_parm::type, and ieee_pending_parm::val.
Referenced by ieee_start_block().
07307 { 07308 struct ieee_pending_parm *m; 07309 unsigned int refcount; 07310 07311 refcount = 0; 07312 for (m = info->pending_parms; m != NULL; m = m->next) 07313 { 07314 enum debug_var_kind vkind; 07315 07316 switch (m->kind) 07317 { 07318 default: 07319 abort (); 07320 return false; 07321 case DEBUG_PARM_STACK: 07322 case DEBUG_PARM_REFERENCE: 07323 vkind = DEBUG_LOCAL; 07324 break; 07325 case DEBUG_PARM_REG: 07326 case DEBUG_PARM_REF_REG: 07327 vkind = DEBUG_REGISTER; 07328 break; 07329 } 07330 07331 if (! ieee_push_type (info, m->type, 0, false, false)) 07332 return false; 07333 info->type_stack->type.referencep = m->referencep; 07334 if (m->referencep) 07335 ++refcount; 07336 if (! ieee_variable ((PTR) info, m->name, vkind, m->val)) 07337 return false; 07338 } 07339 07340 /* If there are any reference parameters, we need to output a 07341 miscellaneous record indicating them. */ 07342 if (refcount > 0) 07343 { 07344 unsigned int nindx, varindx; 07345 07346 /* FIXME: The MRI compiler outputs the demangled function name 07347 here, but we are outputting the mangled name. */ 07348 nindx = info->name_indx; 07349 ++info->name_indx; 07350 if (! ieee_change_buffer (info, &info->vars) 07351 || ! ieee_write_byte (info, (int) ieee_nn_record) 07352 || ! ieee_write_number (info, nindx) 07353 || ! ieee_write_id (info, "") 07354 || ! ieee_write_2bytes (info, (int) ieee_atn_record_enum) 07355 || ! ieee_write_number (info, nindx) 07356 || ! ieee_write_number (info, 0) 07357 || ! ieee_write_number (info, 62) 07358 || ! ieee_write_number (info, 80) 07359 || ! ieee_write_number (info, refcount + 3) 07360 || ! ieee_write_asn (info, nindx, 'B') 07361 || ! ieee_write_atn65 (info, nindx, info->fnname) 07362 || ! ieee_write_asn (info, nindx, 0)) 07363 return false; 07364 for (m = info->pending_parms, varindx = 1; 07365 m != NULL; 07366 m = m->next, varindx++) 07367 { 07368 if (m->referencep) 07369 { 07370 if (! ieee_write_asn (info, nindx, varindx)) 07371 return false; 07372 } 07373 } 07374 } 07375 07376 m = info->pending_parms; 07377 while (m != NULL) 07378 { 07379 struct ieee_pending_parm *next; 07380 07381 next = m->next; 07382 free (m); 07383 m = next; 07384 } 07385 07386 info->pending_parms = NULL; 07387 07388 return true; 07389 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_pointer_type | ( | PTR | p | ) | [static] |
Definition at line 5544 of file ieee.c.
References ieee_define_type(), ieee_get_modified_info(), ieee_pop_type(), ieee_push_type(), ieee_write_number(), ieee_write_type::localp, NULL, ieee_modified_type::pointer, ieee_type_stack::type, and ieee_handle::type_stack.
Referenced by ieee_reference_type().
05546 { 05547 struct ieee_handle *info = (struct ieee_handle *) p; 05548 boolean localp; 05549 unsigned int indx; 05550 struct ieee_modified_type *m = NULL; 05551 05552 localp = info->type_stack->type.localp; 05553 indx = ieee_pop_type (info); 05554 05555 /* A pointer to a simple builtin type can be obtained by adding 32. 05556 FIXME: Will this be a short pointer, and will that matter? */ 05557 if (indx < 32) 05558 return ieee_push_type (info, indx + 32, 0, true, false); 05559 05560 if (! localp) 05561 { 05562 m = ieee_get_modified_info (p, indx); 05563 if (m == NULL) 05564 return false; 05565 05566 /* FIXME: The size should depend upon the architecture. */ 05567 if (m->pointer > 0) 05568 return ieee_push_type (info, m->pointer, 4, true, false); 05569 } 05570 05571 if (! ieee_define_type (info, 4, true, localp) 05572 || ! ieee_write_number (info, 'P') 05573 || ! ieee_write_number (info, indx)) 05574 return false; 05575 05576 if (! localp) 05577 m->pointer = info->type_stack->type.indx; 05578 05579 return true; 05580 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static unsigned int ieee_pop_type | ( | struct ieee_handle * | info | ) | [static] |
Definition at line 4342 of file ieee.c.
References ieee_pop_type_used().
Referenced by ieee_array_type(), ieee_class_baseclass(), ieee_const_type(), ieee_function_parameter(), ieee_function_type(), ieee_offset_type(), ieee_pointer_type(), ieee_set_type(), ieee_start_class_type(), ieee_start_function(), ieee_struct_field(), ieee_tag(), ieee_typdef(), ieee_variable(), and ieee_volatile_type().
04344 { 04345 return ieee_pop_type_used (info, true); 04346 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static unsigned int ieee_pop_type_used | ( | struct ieee_handle * | info, | |
| boolean | used | |||
| ) | [static] |
Definition at line 4360 of file ieee.c.
References assert, ieee_write_type::fndef, free, ieee_append_buffer(), ieee_bb_record_enum, ieee_buffer_emptyp, ieee_change_buffer(), ieee_write_byte, ieee_write_id(), ieee_write_number(), ieee_write_type::indx, ieee_write_type::localp, ieee_type_stack::next, NULL, and ieee_type_stack::type.
Referenced by ieee_pop_type(), and ieee_pop_unused_type().
04363 { 04364 struct ieee_type_stack *ts; 04365 unsigned int ret; 04366 04367 ts = info->type_stack; 04368 assert (ts != NULL); 04369 04370 /* If this is a function type, and we need it, we need to append the 04371 actual definition to the typedef block now. */ 04372 if (used && ! ieee_buffer_emptyp (&ts->type.fndef)) 04373 { 04374 struct ieee_buflist *buflist; 04375 04376 if (ts->type.localp) 04377 { 04378 /* Make sure we have started the types block. */ 04379 if (ieee_buffer_emptyp (&info->types)) 04380 { 04381 if (! ieee_change_buffer (info, &info->types) 04382 || ! ieee_write_byte (info, (int) ieee_bb_record_enum) 04383 || ! ieee_write_byte (info, 1) 04384 || ! ieee_write_number (info, 0) 04385 || ! ieee_write_id (info, info->modname)) 04386 return false; 04387 } 04388 buflist = &info->types; 04389 } 04390 else 04391 { 04392 /* Make sure we started the global type block. */ 04393 if (ieee_buffer_emptyp (&info->global_types)) 04394 { 04395 if (! ieee_change_buffer (info, &info->global_types) 04396 || ! ieee_write_byte (info, (int) ieee_bb_record_enum) 04397 || ! ieee_write_byte (info, 2) 04398 || ! ieee_write_number (info, 0) 04399 || ! ieee_write_id (info, "")) 04400 return false; 04401 } 04402 buflist = &info->global_types; 04403 } 04404 04405 if (! ieee_append_buffer (info, buflist, &ts->type.fndef)) 04406 return false; 04407 } 04408 04409 ret = ts->type.indx; 04410 info->type_stack = ts->next; 04411 free (ts); 04412 return ret; 04413 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static void ieee_pop_unused_type | ( | struct ieee_handle * | info | ) | [static] |
Definition at line 4351 of file ieee.c.
References ieee_pop_type_used().
Referenced by ieee_array_type(), ieee_class_method_var(), ieee_class_static_member(), ieee_method_type(), ieee_range_type(), ieee_struct_field(), ieee_typdef(), and ieee_typed_constant().
04353 { 04354 (void) ieee_pop_type_used (info, false); 04355 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_push_type | ( | struct ieee_handle * | info, | |
| unsigned int | indx, | |||
| unsigned int | size, | |||
| boolean | unsignedp, | |||
| boolean | localp | |||
| ) | [static] |
Definition at line 4316 of file ieee.c.
References memset, and xmalloc().
Referenced by ieee_array_type(), ieee_complex_type(), ieee_const_type(), ieee_define_named_type(), ieee_empty_type(), ieee_enum_type(), ieee_float_type(), ieee_function_type(), ieee_int_type(), ieee_output_pending_parms(), ieee_pointer_type(), ieee_tag_type(), ieee_typedef_type(), ieee_void_type(), and ieee_volatile_type().
04322 { 04323 struct ieee_type_stack *ts; 04324 04325 ts = (struct ieee_type_stack *) xmalloc (sizeof *ts); 04326 memset (ts, 0, sizeof *ts); 04327 04328 ts->type.indx = indx; 04329 ts->type.size = size; 04330 ts->type.unsignedp = unsignedp; 04331 ts->type.localp = localp; 04332 04333 ts->next = info->type_stack; 04334 info->type_stack = ts; 04335 04336 return true; 04337 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_range_type | ( | PTR | p, | |
| bfd_signed_vma | low, | |||
| bfd_signed_vma | high | |||
| ) | [static] |
Definition at line 5692 of file ieee.c.
References ieee_define_type(), ieee_pop_unused_type(), ieee_write_number(), ieee_write_type::localp, ieee_write_type::size, ieee_type_stack::type, ieee_handle::type_stack, and ieee_write_type::unsignedp.
05696 { 05697 struct ieee_handle *info = (struct ieee_handle *) p; 05698 unsigned int size; 05699 boolean unsignedp, localp; 05700 05701 size = info->type_stack->type.size; 05702 unsignedp = info->type_stack->type.unsignedp; 05703 localp = info->type_stack->type.localp; 05704 ieee_pop_unused_type (info); 05705 return (ieee_define_type (info, size, unsignedp, localp) 05706 && ieee_write_number (info, 'R') 05707 && ieee_write_number (info, (bfd_vma) low) 05708 && ieee_write_number (info, (bfd_vma) high) 05709 && ieee_write_number (info, unsignedp ? 0 : 1) 05710 && ieee_write_number (info, size)); 05711 }
Here is the call graph for this function:

| static boolean ieee_read_cxx_class | ( | struct ieee_info * | info, | |
| const bfd_byte ** | pp, | |||
| unsigned long | count | |||
| ) | [static] |
Definition at line 2560 of file ieee.c.
References BASEFLAGS_FRIEND, BASEFLAGS_PRIVATE, BASEFLAGS_VIRTUAL, basename(), builtin_void, CXXFLAGS_CONST, CXXFLAGS_FRIEND, CXXFLAGS_STATIC, CXXFLAGS_VISIBILITY, CXXFLAGS_VISIBILITY_PRIVATE, CXXFLAGS_VISIBILITY_PROTECTED, CXXFLAGS_VISIBILITY_PUBLIC, CXXFLAGS_VOLATILE, DEBUG_BASECLASS_NULL, DEBUG_FIELD_NULL, debug_find_tagged_type(), debug_get_field_bitpos(), debug_get_field_bitsize(), debug_get_field_name(), debug_get_field_type(), debug_get_fields(), debug_get_parameter_types(), debug_get_return_type(), debug_get_type_kind(), DEBUG_KIND_FUNCTION, DEBUG_KIND_ILLEGAL, DEBUG_KIND_POINTER, debug_make_baseclass(), debug_make_field(), debug_make_function_type(), debug_make_indirect_type(), debug_make_method_type(), debug_make_method_variant(), debug_make_static_member(), debug_make_static_method_variant(), DEBUG_METHOD_VARIANT_NULL, DEBUG_TYPE_NULL, DEBUG_VISIBILITY_PRIVATE, DEBUG_VISIBILITY_PROTECTED, DEBUG_VISIBILITY_PUBLIC, dhandle, filename, flags, free, ieee_tag::fslots, id, ieee_builtin_type(), ieee_error(), ieee_require_asn(), ieee_require_atn65(), memset, ieee_var::name, ieee_tag::name, name, ieee_var::namlen, ieee_tag::next, NULL, savestring, start(), strlen(), ieee_var::type, ieee_tag::type, xmalloc(), and xrealloc().
Referenced by ieee_read_cxx_misc().
02564 { 02565 const bfd_byte *start; 02566 bfd_vma class; 02567 const char *tag; 02568 unsigned long taglen; 02569 struct ieee_tag *it; 02570 PTR dhandle; 02571 debug_field *fields; 02572 unsigned int field_count, field_alloc; 02573 debug_baseclass *baseclasses; 02574 unsigned int baseclasses_count, baseclasses_alloc; 02575 const debug_field *structfields; 02576 struct ieee_method 02577 { 02578 const char *name; 02579 unsigned long namlen; 02580 debug_method_variant *variants; 02581 unsigned count; 02582 unsigned int alloc; 02583 } *methods; 02584 unsigned int methods_count, methods_alloc; 02585 debug_type vptrbase; 02586 boolean ownvptr; 02587 debug_method *dmethods; 02588 02589 start = *pp; 02590 02591 if (! ieee_require_asn (info, pp, &class)) 02592 return false; 02593 --count; 02594 02595 if (! ieee_require_atn65 (info, pp, &tag, &taglen)) 02596 return false; 02597 --count; 02598 02599 /* Find the C struct with this name. */ 02600 for (it = info->tags; it != NULL; it = it->next) 02601 if (it->name[0] == tag[0] 02602 && strncmp (it->name, tag, taglen) == 0 02603 && strlen (it->name) == taglen) 02604 break; 02605 if (it == NULL) 02606 { 02607 ieee_error (info, start, "undefined C++ object"); 02608 return false; 02609 } 02610 02611 dhandle = info->dhandle; 02612 02613 fields = NULL; 02614 field_count = 0; 02615 field_alloc = 0; 02616 baseclasses = NULL; 02617 baseclasses_count = 0; 02618 baseclasses_alloc = 0; 02619 methods = NULL; 02620 methods_count = 0; 02621 methods_alloc = 0; 02622 vptrbase = DEBUG_TYPE_NULL; 02623 ownvptr = false; 02624 02625 structfields = debug_get_fields (dhandle, it->type); 02626 02627 while (count > 0) 02628 { 02629 bfd_vma id; 02630 const bfd_byte *spec_start; 02631 02632 spec_start = *pp; 02633 02634 if (! ieee_require_asn (info, pp, &id)) 02635 return false; 02636 --count; 02637 02638 switch (id) 02639 { 02640 default: 02641 ieee_error (info, spec_start, "unrecognized C++ object spec"); 02642 return false; 02643 02644 case 'b': 02645 { 02646 bfd_vma flags, cinline; 02647 const char *basename, *fieldname; 02648 unsigned long baselen, fieldlen; 02649 char *basecopy; 02650 debug_type basetype; 02651 bfd_vma bitpos; 02652 boolean virtualp; 02653 enum debug_visibility visibility; 02654 debug_baseclass baseclass; 02655 02656 /* This represents a base or friend class. */ 02657 02658 if (! ieee_require_asn (info, pp, &flags) 02659 || ! ieee_require_atn65 (info, pp, &basename, &baselen) 02660 || ! ieee_require_asn (info, pp, &cinline) 02661 || ! ieee_require_atn65 (info, pp, &fieldname, &fieldlen)) 02662 return false; 02663 count -= 4; 02664 02665 /* We have no way of recording friend information, so we 02666 just ignore it. */ 02667 if ((flags & BASEFLAGS_FRIEND) != 0) 02668 break; 02669 02670 /* I assume that either all of the members of the 02671 baseclass are included in the object, starting at the 02672 beginning of the object, or that none of them are 02673 included. */ 02674 02675 if ((fieldlen == 0) == (cinline == 0)) 02676 { 02677 ieee_error (info, start, "unsupported C++ object type"); 02678 return false; 02679 } 02680 02681 basecopy = savestring (basename, baselen); 02682 basetype = debug_find_tagged_type (dhandle, basecopy, 02683 DEBUG_KIND_ILLEGAL); 02684 free (basecopy); 02685 if (basetype == DEBUG_TYPE_NULL) 02686 { 02687 ieee_error (info, start, "C++ base class not defined"); 02688 return false; 02689 } 02690 02691 if (fieldlen == 0) 02692 bitpos = 0; 02693 else 02694 { 02695 const debug_field *pf; 02696 02697 if (structfields == NULL) 02698 { 02699 ieee_error (info, start, "C++ object has no fields"); 02700 return false; 02701 } 02702 02703 for (pf = structfields; *pf != DEBUG_FIELD_NULL; pf++) 02704 { 02705 const char *fname; 02706 02707 fname = debug_get_field_name (dhandle, *pf); 02708 if (fname == NULL) 02709 return false; 02710 if (fname[0] == fieldname[0] 02711 && strncmp (fname, fieldname, fieldlen) == 0 02712 && strlen (fname) == fieldlen) 02713 break; 02714 } 02715 if (*pf == DEBUG_FIELD_NULL) 02716 { 02717 ieee_error (info, start, 02718 "C++ base class not found in container"); 02719 return false; 02720 } 02721 02722 bitpos = debug_get_field_bitpos (dhandle, *pf); 02723 } 02724 02725 if ((flags & BASEFLAGS_VIRTUAL) != 0) 02726 virtualp = true; 02727 else 02728 virtualp = false; 02729 if ((flags & BASEFLAGS_PRIVATE) != 0) 02730 visibility = DEBUG_VISIBILITY_PRIVATE; 02731 else 02732 visibility = DEBUG_VISIBILITY_PUBLIC; 02733 02734 baseclass = debug_make_baseclass (dhandle, basetype, bitpos, 02735 virtualp, visibility); 02736 if (baseclass == DEBUG_BASECLASS_NULL) 02737 return false; 02738 02739 if (baseclasses_count + 1 >= baseclasses_alloc) 02740 { 02741 baseclasses_alloc += 10; 02742 baseclasses = ((debug_baseclass *) 02743 xrealloc (baseclasses, 02744 (baseclasses_alloc 02745 * sizeof *baseclasses))); 02746 } 02747 02748 baseclasses[baseclasses_count] = baseclass; 02749 ++baseclasses_count; 02750 baseclasses[baseclasses_count] = DEBUG_BASECLASS_NULL; 02751 } 02752 break; 02753 02754 case 'd': 02755 { 02756 bfd_vma flags; 02757 const char *fieldname, *mangledname; 02758 unsigned long fieldlen, mangledlen; 02759 char *fieldcopy; 02760 boolean staticp; 02761 debug_type ftype; 02762 const debug_field *pf = NULL; 02763 enum debug_visibility visibility; 02764 debug_field field; 02765 02766 /* This represents a data member. */ 02767 02768 if (! ieee_require_asn (info, pp, &flags) 02769 || ! ieee_require_atn65 (info, pp, &fieldname, &fieldlen) 02770 || ! ieee_require_atn65 (info, pp, &mangledname, &mangledlen)) 02771 return false; 02772 count -= 3; 02773 02774 fieldcopy = savestring (fieldname, fieldlen); 02775 02776 staticp = (flags & CXXFLAGS_STATIC) != 0 ? true : false; 02777 02778 if (staticp) 02779 { 02780 struct ieee_var *pv, *pvend; 02781 02782 /* See if we can find a definition for this variable. */ 02783 pv = info->vars.vars; 02784 pvend = pv + info->vars.alloc; 02785 for (; pv < pvend; pv++) 02786 if (pv->namlen == mangledlen 02787 && strncmp (pv->name, mangledname, mangledlen) == 0) 02788 break; 02789 if (pv < pvend) 02790 ftype = pv->type; 02791 else 02792 { 02793 /* This can happen if the variable is never used. */ 02794 ftype = ieee_builtin_type (info, start, 02795 (unsigned int) builtin_void); 02796 } 02797 } 02798 else 02799 { 02800 unsigned int findx; 02801 02802 if (structfields == NULL) 02803 { 02804 ieee_error (info, start, "C++ object has no fields"); 02805 return false; 02806 } 02807 02808 for (pf = structfields, findx = 0; 02809 *pf != DEBUG_FIELD_NULL; 02810 pf++, findx++) 02811 { 02812 const char *fname; 02813 02814 fname = debug_get_field_name (dhandle, *pf); 02815 if (fname == NULL) 02816 return false; 02817 if (fname[0] == mangledname[0] 02818 && strncmp (fname, mangledname, mangledlen) == 0 02819 && strlen (fname) == mangledlen) 02820 break; 02821 } 02822 if (*pf == DEBUG_FIELD_NULL) 02823 { 02824 ieee_error (info, start, 02825 "C++ data member not found in container"); 02826 return false; 02827 } 02828 02829 ftype = debug_get_field_type (dhandle, *pf); 02830 02831 if (debug_get_type_kind (dhandle, ftype) == DEBUG_KIND_POINTER) 02832 { 02833 /* We might need to convert this field into a 02834 reference type later on, so make it an indirect 02835 type. */ 02836 if (it->fslots == NULL) 02837 { 02838 unsigned int fcnt; 02839 const debug_field *pfcnt; 02840 02841 fcnt = 0; 02842 for (pfcnt = structfields; 02843 *pfcnt != DEBUG_FIELD_NULL; 02844 pfcnt++) 02845 ++fcnt; 02846 it->fslots = ((debug_type *) 02847 xmalloc (fcnt * sizeof *it->fslots)); 02848 memset (it->fslots, 0, 02849 fcnt * sizeof *it->fslots); 02850 } 02851 02852 if (ftype == DEBUG_TYPE_NULL) 02853 return false; 02854 it->fslots[findx] = ftype; 02855 ftype = debug_make_indirect_type (dhandle, 02856 it->fslots + findx, 02857 (const char *) NULL); 02858 } 02859 } 02860 if (ftype == DEBUG_TYPE_NULL) 02861 return false; 02862 02863 switch (flags & CXXFLAGS_VISIBILITY) 02864 { 02865 default: 02866 ieee_error (info, start, "unknown C++ visibility"); 02867 return false; 02868 02869 case CXXFLAGS_VISIBILITY_PUBLIC: 02870 visibility = DEBUG_VISIBILITY_PUBLIC; 02871 break; 02872 02873 case CXXFLAGS_VISIBILITY_PRIVATE: 02874 visibility = DEBUG_VISIBILITY_PRIVATE; 02875 break; 02876 02877 case CXXFLAGS_VISIBILITY_PROTECTED: 02878 visibility = DEBUG_VISIBILITY_PROTECTED; 02879 break; 02880 } 02881 02882 if (staticp) 02883 { 02884 char *mangledcopy; 02885 02886 mangledcopy = savestring (mangledname, mangledlen); 02887 02888 field = debug_make_static_member (dhandle, fieldcopy, 02889 ftype, mangledcopy, 02890 visibility); 02891 } 02892 else 02893 { 02894 bfd_vma bitpos, bitsize; 02895 02896 bitpos = debug_get_field_bitpos (dhandle, *pf); 02897 bitsize = debug_get_field_bitsize (dhandle, *pf); 02898 if (bitpos == (bfd_vma) -1 || bitsize == (bfd_vma) -1) 02899 { 02900 ieee_error (info, start, "bad C++ field bit pos or size"); 02901 return false; 02902 } 02903 field = debug_make_field (dhandle, fieldcopy, ftype, bitpos, 02904 bitsize, visibility); 02905 } 02906 02907 if (field == DEBUG_FIELD_NULL) 02908 return false; 02909 02910 if (field_count + 1 >= field_alloc) 02911 { 02912 field_alloc += 10; 02913 fields = ((debug_field *) 02914 xrealloc (fields, field_alloc * sizeof *fields)); 02915 } 02916 02917 fields[field_count] = field; 02918 ++field_count; 02919 fields[field_count] = DEBUG_FIELD_NULL; 02920 } 02921 break; 02922 02923 case 'm': 02924 case 'v': 02925 { 02926 bfd_vma flags, voffset, control; 02927 const char *name, *mangled; 02928 unsigned long namlen, mangledlen; 02929 struct ieee_var *pv, *pvend; 02930 debug_type type; 02931 enum debug_visibility visibility; 02932 boolean constp, volatilep; 02933 char *mangledcopy; 02934 debug_method_variant mv; 02935 struct ieee_method *meth; 02936 unsigned int im; 02937 02938 if (! ieee_require_asn (info, pp, &flags) 02939 || ! ieee_require_atn65 (info, pp, &name, &namlen) 02940 || ! ieee_require_atn65 (info, pp, &mangled, &mangledlen)) 02941 return false; 02942 count -= 3; 02943 if (id != 'v') 02944 voffset = 0; 02945 else 02946 { 02947 if (! ieee_require_asn (info, pp, &voffset)) 02948 return false; 02949 --count; 02950 } 02951 if (! ieee_require_asn (info, pp, &control)) 02952 return false; 02953 --count; 02954 02955 /* We just ignore the control information. */ 02956 02957 /* We have no way to represent friend information, so we 02958 just ignore it. */ 02959 if ((flags & CXXFLAGS_FRIEND) != 0) 02960 break; 02961 02962 /* We should already have seen a type for the function. */ 02963 pv = info->vars.vars; 02964 pvend = pv + info->vars.alloc; 02965 for (; pv < pvend; pv++) 02966 if (pv->namlen == mangledlen 02967 && strncmp (pv->name, mangled, mangledlen) == 0) 02968 break; 02969 02970 if (pv >= pvend) 02971 { 02972 /* We won't have type information for this function if 02973 it is not included in this file. We don't try to 02974 handle this case. FIXME. */ 02975 type = (debug_make_function_type 02976 (dhandle, 02977 ieee_builtin_type (info, start, 02978 (unsigned int) builtin_void), 02979 (debug_type *) NULL, 02980 false)); 02981 } 02982 else 02983 { 02984 debug_type return_type; 02985 const debug_type *arg_types; 02986 boolean varargs; 02987 02988 if (debug_get_type_kind (dhandle, pv->type) 02989 != DEBUG_KIND_FUNCTION) 02990 { 02991 ieee_error (info, start, 02992 "bad type for C++ method function"); 02993 return false; 02994 } 02995 02996 return_type = debug_get_return_type (dhandle, pv->type); 02997 arg_types = debug_get_parameter_types (dhandle, pv->type, 02998 &varargs); 02999 if (return_type == DEBUG_TYPE_NULL || arg_types == NULL) 03000 { 03001 ieee_error (info, start, 03002 "no type information for C++ method function"); 03003 return false; 03004 } 03005 03006 type = debug_make_method_type (dhandle, return_type, it->type, 03007 (debug_type *) arg_types, 03008 varargs); 03009 } 03010 if (type == DEBUG_TYPE_NULL) 03011 return false; 03012 03013 switch (flags & CXXFLAGS_VISIBILITY) 03014 { 03015 default: 03016 ieee_error (info, start, "unknown C++ visibility"); 03017 return false; 03018 03019 case CXXFLAGS_VISIBILITY_PUBLIC: 03020 visibility = DEBUG_VISIBILITY_PUBLIC; 03021 break; 03022 03023 case CXXFLAGS_VISIBILITY_PRIVATE: 03024 visibility = DEBUG_VISIBILITY_PRIVATE; 03025 break; 03026 03027 case CXXFLAGS_VISIBILITY_PROTECTED: 03028 visibility = DEBUG_VISIBILITY_PROTECTED; 03029 break; 03030 } 03031 03032 constp = (flags & CXXFLAGS_CONST) != 0 ? true : false; 03033 volatilep = (flags & CXXFLAGS_VOLATILE) != 0 ? true : false; 03034 03035 mangledcopy = savestring (mangled, mangledlen); 03036 03037 if ((flags & CXXFLAGS_STATIC) != 0) 03038 { 03039 if (id == 'v') 03040 { 03041 ieee_error (info, start, "C++ static virtual method"); 03042 return false; 03043 } 03044 mv = debug_make_static_method_variant (dhandle, mangledcopy, 03045 type, visibility, 03046 constp, volatilep); 03047 } 03048 else 03049 { 03050 debug_type vcontext; 03051 03052 if (id != 'v') 03053 vcontext = DEBUG_TYPE_NULL; 03054 else 03055 { 03056 /* FIXME: How can we calculate this correctly? */ 03057 vcontext = it->type; 03058 } 03059 mv = debug_make_method_variant (dhandle, mangledcopy, type, 03060 visibility, constp, 03061 volatilep, voffset, 03062 vcontext); 03063 } 03064 if (mv == DEBUG_METHOD_VARIANT_NULL) 03065 return false; 03066 03067 for (meth = methods, im = 0; im < methods_count; meth++, im++) 03068 if (meth->namlen == namlen 03069 && strncmp (meth->name, name, namlen) == 0) 03070 break; 03071 if (im >= methods_count) 03072 { 03073 if (methods_count >= methods_alloc) 03074 { 03075 methods_alloc += 10; 03076 methods = ((struct ieee_method *) 03077 xrealloc (methods, 03078 methods_alloc * sizeof *methods)); 03079 } 03080 methods[methods_count].name = name; 03081 methods[methods_count].namlen = namlen; 03082 methods[methods_count].variants = NULL; 03083 methods[methods_count].count = 0; 03084 methods[methods_count].alloc = 0; 03085 meth = methods + methods_count; 03086 ++methods_count; 03087 } 03088 03089 if (meth->count + 1 >= meth->alloc) 03090 { 03091 meth->alloc += 10; 03092 meth->variants = ((debug_method_variant *) 03093 xrealloc (meth->variants, 03094 (meth->alloc 03095 * sizeof *meth->variants))); 03096 } 03097 03098 meth->variants[meth->count] = mv; 03099 ++meth->count; 03100 meth->variants[meth->count] = DEBUG_METHOD_VARIANT_NULL; 03101 } 03102 break; 03103 03104 case 'o': 03105 { 03106 bfd_vma spec; 03107 03108 /* We have no way to store this information, so we just 03109 ignore it. */ 03110 if (! ieee_require_asn (info, pp, &spec)) 03111 return false; 03112 --count; 03113 if ((spec & 4) != 0) 03114 { 03115 const char *filename; 03116 unsigned long filenamlen; 03117 bfd_vma lineno; 03118 03119 if (! ieee_require_atn65 (info, pp, &filename, &filenamlen) 03120 || ! ieee_require_asn (info, pp, &lineno)) 03121 return false; 03122 count -= 2; 03123 } 03124 else if ((spec & 8) != 0) 03125 { 03126 const char *mangled; 03127 unsigned long mangledlen; 03128 03129 if (! ieee_require_atn65 (info, pp, &mangled, &mangledlen)) 03130 return false; 03131 --count; 03132 } 03133 else 03134 { 03135 ieee_error (info, start, 03136 "unrecognized C++ object overhead spec"); 03137 return false; 03138 } 03139 } 03140 break; 03141 03142 case 'z': 03143 { 03144 const char *vname, *basename; 03145 unsigned long vnamelen, baselen; 03146 bfd_vma vsize, control; 03147 03148 /* A virtual table pointer. */ 03149 03150 if (! ieee_require_atn65 (info, pp, &vname, &vnamelen) 03151 || ! ieee_require_asn (info, pp, &vsize) 03152 || ! ieee_require_atn65 (info, pp, &basename, &baselen) 03153 || ! ieee_require_asn (info, pp, &control)) 03154 return false; 03155 count -= 4; 03156 03157 /* We just ignore the control number. We don't care what 03158 the virtual table name is. We have no way to store the 03159 virtual table size, and I don't think we care anyhow. */ 03160 03161 /* FIXME: We can't handle multiple virtual table pointers. */ 03162 03163 if (baselen == 0) 03164 ownvptr = true; 03165 else 03166 { 03167 char *basecopy; 03168 03169 basecopy = savestring (basename, baselen); 03170 vptrbase = debug_find_tagged_type (dhandle, basecopy, 03171 DEBUG_KIND_ILLEGAL); 03172 free (basecopy); 03173 if (vptrbase == DEBUG_TYPE_NULL) 03174 { 03175 ieee_error (info, start, "undefined C++ vtable"); 03176 return false; 03177 } 03178 } 03179 } 03180 break; 03181 } 03182 } 03183 03184 /* Now that we have seen all the method variants, we can call 03185 debug_make_method for each one. */ 03186 03187 if (methods_count == 0) 03188 dmethods = NULL; 03189 else 03190 { 03191 unsigned int i; 03192 03193 dmethods = ((debug_method *) 03194 xmalloc ((methods_count + 1) * sizeof *dmethods)); 03195 for (i = 0; i < methods_count; i++) 03196 { 03197 char *namcopy; 03198 03199 namcopy = savestring (methods[i].name, methods[i].namlen); 03200 dmethods[i] = debug_make_method (dhandle, namcopy, 03201 methods[i].variants); 03202 if (dmethods[i] == DEBUG_METHOD_NULL) 03203 return false; 03204 } 03205 dmethods[i] = DEBUG_METHOD_NULL; 03206 free (methods); 03207 } 03208 03209 /* The struct type was created as an indirect type pointing at 03210 it->slot. We update it->slot to automatically update all 03211 references to this struct. */ 03212 it->slot = debug_make_object_type (dhandle, 03213 class != 'u', 03214 debug_get_type_size (dhandle, 03215 it->slot), 03216 fields, baseclasses, dmethods, 03217 vptrbase, ownvptr); 03218 if (it->slot == DEBUG_TYPE_NULL) 03219 return false; 03220 03221 return true; 03222 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_read_cxx_defaults | ( | struct ieee_info * | info, | |
| const bfd_byte ** | pp, | |||
| unsigned long | count | |||
| ) | [static] |
Definition at line 3227 of file ieee.c.
References debug_get_target_type(), debug_get_type_kind(), DEBUG_KIND_POINTER, debug_make_reference_type(), DEBUG_TYPE_NULL, dhandle, ieee_error(), ieee_require_asn(), ieee_require_atn65(), NULL, and start().
Referenced by ieee_read_cxx_misc().
03231 { 03232 const bfd_byte *start; 03233 const char *fnname; 03234 unsigned long fnlen; 03235 bfd_vma defcount; 03236 03237 start = *pp; 03238 03239 /* Giving the function name before the argument count is an addendum 03240 to the spec. The function name is demangled, though, so this 03241 record must always refer to the current function. */ 03242 03243 if (info->blockstack.bsp <= info->blockstack.stack 03244 || info->blockstack.bsp[-1].fnindx == (unsigned int) -1) 03245 { 03246 ieee_error (info, start, "C++ default values not in a function"); 03247 return false; 03248 } 03249 03250 if (! ieee_require_atn65 (info, pp, &fnname, &fnlen) 03251 || ! ieee_require_asn (info, pp, &defcount)) 03252 return false; 03253 count -= 2; 03254 03255 while (defcount-- > 0) 03256 { 03257 bfd_vma type, val; 03258 const char *strval; 03259 unsigned long strvallen; 03260 03261 if (! ieee_require_asn (info, pp, &type)) 03262 return false; 03263 --count; 03264 03265 switch (type) 03266 { 03267 case 0: 03268 case 4: 03269 break; 03270 03271 case 1: 03272 case 2: 03273 if (! ieee_require_asn (info, pp, &val)) 03274 return false; 03275 --count; 03276 break; 03277 03278 case 3: 03279 case 7: 03280 if (! ieee_require_atn65 (info, pp, &strval, &strvallen)) 03281 return false; 03282 --count; 03283 break; 03284 03285 default: 03286 ieee_error (info, start, "unrecognized C++ default type"); 03287 return false; 03288 } 03289 03290 /* We have no way to record the default argument values, so we 03291 just ignore them. FIXME. */ 03292 } 03293 03294 /* Any remaining arguments are indices of parameters that are really 03295 reference type. */ 03296 if (count > 0) 03297 { 03298 PTR dhandle; 03299 debug_type *arg_slots; 03300 03301 dhandle = info->dhandle; 03302 arg_slots = info->types.types[info->blockstack.bsp[-1].fnindx].arg_slots; 03303 while (count-- > 0) 03304 { 03305 bfd_vma indx; 03306 debug_type target; 03307 03308 if (! ieee_require_asn (info, pp, &indx)) 03309 return false; 03310 /* The index is 1 based. */ 03311 --indx; 03312 if (arg_slots == NULL 03313 || arg_slots[indx] == DEBUG_TYPE_NULL 03314 || (debug_get_type_kind (dhandle, arg_slots[indx]) 03315 != DEBUG_KIND_POINTER)) 03316 { 03317 ieee_error (info, start, "reference parameter is not a pointer"); 03318 return false; 03319 } 03320 03321 target = debug_get_target_type (dhandle, arg_slots[indx]); 03322 arg_slots[indx] = debug_make_reference_type (dhandle, target); 03323 if (arg_slots[indx] == DEBUG_TYPE_NULL) 03324 return false; 03325 } 03326 } 03327 03328 return true; 03329 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_read_cxx_misc | ( | struct ieee_info * | info, | |
| const bfd_byte ** | pp, | |||
| unsigned long | count | |||
| ) | [static] |
Definition at line 2472 of file ieee.c.
References flags, ieee_at_record_enum, ieee_error(), ieee_read_cxx_class(), ieee_read_cxx_defaults(), ieee_read_reference(), ieee_require_asn(), ieee_require_atn65(), name, ieee_var::namlen, and start().
Referenced by parse_ieee_atn().
02476 { 02477 const bfd_byte *start; 02478 bfd_vma category; 02479 02480 start = *pp; 02481 02482 /* Get the category of C++ misc record. */ 02483 if (! ieee_require_asn (info, pp, &category)) 02484 return false; 02485 --count; 02486 02487 switch (category) 02488 { 02489 default: 02490 ieee_error (info, start, "unrecognized C++ misc record"); 02491 return false; 02492 02493 case 'T': 02494 if (! ieee_read_cxx_class (info, pp, count)) 02495 return false; 02496 break; 02497 02498 case 'M': 02499 { 02500 bfd_vma flags; 02501 const char *name; 02502 unsigned long namlen; 02503 02504 /* The IEEE spec indicates that the 'M' record only has a 02505 flags field. The MRI compiler also emits the name of the 02506 function. */ 02507 02508 if (! ieee_require_asn (info, pp, &flags)) 02509 return false; 02510 if (*pp < info->pend 02511 && (ieee_record_enum_type) **pp == ieee_at_record_enum) 02512 { 02513 if (! ieee_require_atn65 (info, pp, &name, &namlen)) 02514 return false; 02515 } 02516 02517 /* This is emitted for method functions, but I don't think we 02518 care very much. It might help if it told us useful 02519 information like the class with which this function is 02520 associated, but it doesn't, so it isn't helpful. */ 02521 } 02522 break; 02523 02524 case 'B': 02525 if (! ieee_read_cxx_defaults (info, pp, count)) 02526 return false; 02527 break; 02528 02529 case 'z': 02530 { 02531 const char *name, *mangled, *class; 02532 unsigned long namlen, mangledlen, classlen; 02533 bfd_vma control; 02534 02535 /* Pointer to member. */ 02536 02537 if (! ieee_require_atn65 (info, pp, &name, &namlen) 02538 || ! ieee_require_atn65 (info, pp, &mangled, &mangledlen) 02539 || ! ieee_require_atn65 (info, pp, &class, &classlen) 02540 || ! ieee_require_asn (info, pp, &control)) 02541 return false; 02542 02543 /* FIXME: We should now track down name and change its type. */ 02544 } 02545 break; 02546 02547 case 'R': 02548 if (! ieee_read_reference (info, pp)) 02549 return false; 02550 break; 02551 } 02552 02553 return true; 02554 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_read_expression | ( | struct ieee_info * | info, | |
| const bfd_byte ** | pp, | |||
| bfd_vma * | pv | |||
| ) | [static] |
Definition at line 497 of file ieee.c.
References EXPR_STACK_SIZE, ieee_comma, ieee_error(), ieee_function_minus_enum, ieee_function_plus_enum, ieee_module_beginning_enum, ieee_read_number(), ieee_read_optional_number(), ieee_variable_R_enum, NULL, and start().
Referenced by ieee_require_asn(), parse_ieee_bb(), and parse_ieee_be().
00501 { 00502 const bfd_byte *expr_start; 00503 #define EXPR_STACK_SIZE (10) 00504 bfd_vma expr_stack[EXPR_STACK_SIZE]; 00505 bfd_vma *esp; 00506 00507 expr_start = *pp; 00508 00509 esp = expr_stack; 00510 00511 while (1) 00512 { 00513 const bfd_byte *start; 00514 bfd_vma val; 00515 boolean present; 00516 ieee_record_enum_type c; 00517 00518 start = *pp; 00519 00520 if (! ieee_read_optional_number (info, pp, &val, &present)) 00521 return false; 00522 00523 if (present) 00524 { 00525 if (esp - expr_stack >= EXPR_STACK_SIZE) 00526 { 00527 ieee_error (info, start, "expression stack overflow"); 00528 return false; 00529 } 00530 *esp++ = val; 00531 continue; 00532 } 00533 00534 c = (ieee_record_enum_type) **pp; 00535 00536 if (c >= ieee_module_beginning_enum) 00537 break; 00538 00539 ++*pp; 00540 00541 if (c == ieee_comma) 00542 break; 00543 00544 switch (c) 00545 { 00546 default: 00547 ieee_error (info, start, "unsupported IEEE expression operator"); 00548 break; 00549 00550 case ieee_variable_R_enum: 00551 { 00552 bfd_vma indx; 00553 asection *s; 00554 00555 if (! ieee_read_number (info, pp, &indx)) 00556 return false; 00557 for (s = info->abfd->sections; s != NULL; s = s->next) 00558 if ((bfd_vma) s->target_index == indx) 00559 break; 00560 if (s == NULL) 00561 { 00562 ieee_error (info, start, "unknown section"); 00563 return false; 00564 } 00565 00566 if (esp - expr_stack >= EXPR_STACK_SIZE) 00567 { 00568 ieee_error (info, start, "expression stack overflow"); 00569 return false; 00570 } 00571 00572 *esp++ = bfd_get_section_vma (info->abfd, s); 00573 } 00574 break; 00575 00576 case ieee_function_plus_enum: 00577 case ieee_function_minus_enum: 00578 { 00579 bfd_vma v1, v2; 00580 00581 if (esp - expr_stack < 2) 00582 { 00583 ieee_error (info, start, "expression stack underflow"); 00584 return false; 00585 } 00586 00587 v1 = *--esp; 00588 v2 = *--esp; 00589 *esp++ = v1 + v2; 00590 } 00591 break; 00592 } 00593 } 00594 00595 if (esp - 1 != expr_stack) 00596 { 00597 ieee_error (info, expr_start, "expression stack mismatch"); 00598 return false; 00599 } 00600 00601 *pv = *--esp; 00602 00603 return true; 00604 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_read_id | ( | struct ieee_info * | info, | |
| const bfd_byte ** | pp, | |||
| const char ** | pname, | |||
| unsigned long * | pnamlen | |||
| ) | [static] |
Definition at line 418 of file ieee.c.
References ieee_read_optional_id(), and NULL.
Referenced by ieee_require_atn65(), parse_ieee_bb(), parse_ieee_nn(), and parse_ieee_ty().
00423 { 00424 return ieee_read_optional_id (info, pp, pname, pnamlen, (boolean *) NULL); 00425 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_read_number | ( | struct ieee_info * | info, | |
| const bfd_byte ** | pp, | |||
| bfd_vma * | pv | |||
| ) | [static] |
Definition at line 337 of file ieee.c.
References ieee_read_optional_number(), and NULL.
Referenced by ieee_read_expression(), ieee_read_type_index(), ieee_require_asn(), ieee_require_atn65(), parse_ieee_atn(), parse_ieee_bb(), parse_ieee_nn(), and parse_ieee_ty().
00341 { 00342 return ieee_read_optional_number (info, pp, pv, (boolean *) NULL); 00343 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_read_optional_id | ( | struct ieee_info * | info, | |
| const bfd_byte ** | pp, | |||
| const char ** | pname, | |||
| unsigned long * | pnamlen, | |||
| boolean * | ppresent | |||
| ) | [static] |
Definition at line 431 of file ieee.c.
References ieee_eof(), ieee_error(), ieee_extension_length_1_enum, ieee_extension_length_2_enum, and NULL.
Referenced by ieee_read_id(), parse_ieee_atn(), parse_ieee_bb(), and parse_ieee_ty().
00437 { 00438 bfd_byte b; 00439 unsigned long len; 00440 00441 if (*pp >= info->pend) 00442 { 00443 ieee_eof (info); 00444 return false; 00445 } 00446 00447 b = **pp; 00448 ++*pp; 00449 00450 if (b <= 0x7f) 00451 len = b; 00452 else if ((ieee_record_enum_type) b == ieee_extension_length_1_enum) 00453 { 00454 len = **pp; 00455 ++*pp; 00456 } 00457 else if ((ieee_record_enum_type) b == ieee_extension_length_2_enum) 00458 { 00459 len = (**pp << 8) + (*pp)[1]; 00460 *pp += 2; 00461 } 00462 else 00463 { 00464 if (ppresent != NULL) 00465 { 00466 --*pp; 00467 *ppresent = false; 00468 return true; 00469 } 00470 ieee_error (info, *pp - 1, "invalid string length"); 00471 return false; 00472 } 00473 00474 if ((unsigned long) (info->pend - *pp) < len) 00475 { 00476 ieee_eof (info); 00477 return false; 00478 } 00479 00480 *pname = (const char *) *pp; 00481 *pnamlen = len; 00482 *pp += len; 00483 00484 if (ppresent != NULL) 00485 *ppresent = true; 00486 00487 return true; 00488 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_read_optional_number | ( | struct ieee_info * | info, | |
| const bfd_byte ** | pp, | |||
| bfd_vma * | pv, | |||
| boolean * | ppresent | |||
| ) | [static] |
Definition at line 349 of file ieee.c.
References ieee_eof(), ieee_error(), ieee_number_end_enum, ieee_number_repeat_end_enum, ieee_number_repeat_start_enum, int(), and NULL.
Referenced by ieee_read_expression(), ieee_read_number(), parse_ieee_atn(), parse_ieee_bb(), and parse_ieee_ty().
00354 { 00355 ieee_record_enum_type b; 00356 00357 if (*pp >= info->pend) 00358 { 00359 if (ppresent != NULL) 00360 { 00361 *ppresent = false; 00362 return true; 00363 } 00364 ieee_eof (info); 00365 return false; 00366 } 00367 00368 b = (ieee_record_enum_type) **pp; 00369 ++*pp; 00370 00371 if (b <= ieee_number_end_enum) 00372 { 00373 *pv = (bfd_vma) b; 00374 if (ppresent != NULL) 00375 *ppresent = true; 00376 return true; 00377 } 00378 00379 if (b >= ieee_number_repeat_start_enum && b <= ieee_number_repeat_end_enum) 00380 { 00381 unsigned int i; 00382 00383 i = (int) b - (int) ieee_number_repeat_start_enum; 00384 if (*pp + i - 1 >= info->pend) 00385 { 00386 ieee_eof (info); 00387 return false; 00388 } 00389 00390 *pv = 0; 00391 for (; i > 0; i--) 00392 { 00393 *pv <<= 8; 00394 *pv += **pp; 00395 ++*pp; 00396 } 00397 00398 if (ppresent != NULL) 00399 *ppresent = true; 00400 00401 return true; 00402 } 00403 00404 if (ppresent != NULL) 00405 { 00406 --*pp; 00407 *ppresent = false; 00408 return true; 00409 } 00410 00411 ieee_error (info, *pp - 1, "invalid number"); 00412 return false; 00413 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_read_reference | ( | struct ieee_info * | info, | |
| const bfd_byte ** | pp | |||
| ) | [static] |
Definition at line 3334 of file ieee.c.
References flags, ieee_error(), ieee_var::IEEE_EXTERNAL, ieee_var::IEEE_FUNCTION, ieee_var::IEEE_GLOBAL, ieee_var::IEEE_LOCAL, ieee_require_asn(), ieee_require_atn65(), ieee_var::IEEE_STATIC, name, NULL, pass, ieee_var::pslot, and start().
Referenced by ieee_read_cxx_misc().
03337 { 03338 const bfd_byte *start; 03339 bfd_vma flags; 03340 const char *class, *name; 03341 unsigned long classlen, namlen; 03342 debug_type *pslot; 03343 debug_type target; 03344 03345 start = *pp; 03346 03347 if (! ieee_require_asn (info, pp, &flags)) 03348 return false; 03349 03350 /* Giving the class name before the member name is in an addendum to 03351 the spec. */ 03352 if (flags == 3) 03353 { 03354 if (! ieee_require_atn65 (info, pp, &class, &classlen)) 03355 return false; 03356 } 03357 03358 if (! ieee_require_atn65 (info, pp, &name, &namlen)) 03359 return false; 03360 03361 pslot = NULL; 03362 if (flags != 3) 03363 { 03364 int pass; 03365 03366 /* We search from the last variable indices to the first in 03367 hopes of finding local variables correctly. We search the 03368 local variables on the first pass, and the global variables 03369 on the second. FIXME: This probably won't work in all cases. 03370 On the other hand, I don't know what will. */ 03371 for (pass = 0; pass < 2; pass++) 03372 { 03373 struct ieee_vars *vars; 03374 int i; 03375 struct ieee_var *pv = NULL; 03376 03377 if (pass == 0) 03378 vars = &info->vars; 03379 else 03380 { 03381 vars = info->global_vars; 03382 if (vars == NULL) 03383 break; 03384 } 03385 03386 for (i = (int) vars->alloc - 1; i >= 0; i--) 03387 { 03388 boolean found; 03389 03390 pv = vars->vars + i; 03391 03392 if (pv->pslot == NULL 03393 || pv->namlen != namlen 03394 || strncmp (pv->name, name, namlen) != 0) 03395 continue; 03396 03397 found = false; 03398 switch (flags) 03399 { 03400 default: 03401 ieee_error (info, start, 03402 "unrecognized C++ reference type"); 03403 return false; 03404 03405 case 0: 03406 /* Global variable or function. */ 03407 if (pv->kind == IEEE_GLOBAL 03408 || pv->kind == IEEE_EXTERNAL 03409 || pv->kind == IEEE_FUNCTION) 03410 found = true; 03411 break; 03412 03413 case 1: 03414 /* Global static variable or function. */ 03415 if (pv->kind == IEEE_STATIC 03416 || pv->kind == IEEE_FUNCTION) 03417 found = true; 03418 break; 03419 03420 case 2: 03421 /* Local variable. */ 03422 if (pv->kind == IEEE_LOCAL) 03423 found = true; 03424 break; 03425 } 03426 03427 if (found) 03428 break; 03429 } 03430 03431 if (i >= 0) 03432 { 03433 pslot = pv->pslot; 03434 break; 03435 } 03436 } 03437 } 03438 else 03439 { 03440 struct ieee_tag *it; 03441 03442 for (it = info->tags; it != NULL; it = it->next) 03443 { 03444 if (it->name[0] == class[0] 03445 && strncmp (it->name, class, classlen) == 0 03446 && strlen (it->name) == classlen) 03447 { 03448 if (it->fslots != NULL) 03449 { 03450 const debug_field *pf; 03451 unsigned int findx; 03452 03453 pf = debug_get_fields (info->dhandle, it->type); 03454 if (pf == NULL) 03455 { 03456 ieee_error (info, start, 03457 "C++ reference in class with no fields"); 03458 return false; 03459 } 03460 03461 for (findx = 0; *pf != DEBUG_FIELD_NULL; pf++, findx++) 03462 { 03463 const char *fname; 03464 03465 fname = debug_get_field_name (info->dhandle, *pf); 03466 if (fname == NULL) 03467 return false; 03468 if (strncmp (fname, name, namlen) == 0 03469 && strlen (fname) == namlen) 03470 { 03471 pslot = it->fslots + findx; 03472 break; 03473 } 03474 } 03475 } 03476 03477 break; 03478 } 03479 } 03480 } 03481 03482 if (pslot == NULL) 03483 { 03484 ieee_error (info, start, "C++ reference not found"); 03485 return false; 03486 } 03487 03488 /* We allocated the type of the object as an indirect type pointing 03489 to *pslot, which we can now update to be a reference type. */ 03490 if (debug_get_type_kind (info->dhandle, *pslot) != DEBUG_KIND_POINTER) 03491 { 03492 ieee_error (info, start, "C++ reference is not pointer"); 03493 return false; 03494 } 03495 03496 target = debug_get_target_type (info->dhandle, *pslot); 03497 *pslot = debug_make_reference_type (info->dhandle, target); 03498 if (*pslot == DEBUG_TYPE_NULL) 03499 return false; 03500 03501 return true; 03502 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_read_type_index | ( | struct ieee_info * | info, | |
| const bfd_byte ** | pp, | |||
| debug_type * | ptype | |||
| ) | [static] |
Definition at line 851 of file ieee.c.
References ieee_alloc_type(), ieee_builtin_type(), ieee_read_number(), NULL, and start().
Referenced by parse_ieee_atn(), and parse_ieee_ty().
00855 { 00856 const bfd_byte *start; 00857 bfd_vma indx; 00858 00859 start = *pp; 00860 00861 if (! ieee_read_number (info, pp, &indx)) 00862 return false; 00863 00864 if (indx < 256) 00865 { 00866 *ptype = ieee_builtin_type (info, start, indx); 00867 if (*ptype == NULL) 00868 return false; 00869 return true; 00870 } 00871 00872 indx -= 256; 00873 if (! ieee_alloc_type (info, indx, true)) 00874 return false; 00875 00876 *ptype = info->types.types[indx].type; 00877 00878 return true; 00879 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_real_write_byte | ( | struct ieee_handle * | info, | |
| int | b | |||
| ) | [static] |
Definition at line 4165 of file ieee.c.
References IEEE_BUFSIZE, n, NULL, and xmalloc().
04168 { 04169 if (info->curbuf->c >= IEEE_BUFSIZE) 04170 { 04171 struct ieee_buf *n; 04172 04173 n = (struct ieee_buf *) xmalloc (sizeof *n); 04174 n->next = NULL; 04175 n->c = 0; 04176 if (info->current->head == NULL) 04177 info->current->head = n; 04178 else 04179 info->current->tail->next = n; 04180 info->current->tail = n; 04181 info->curbuf = n; 04182 } 04183 04184 info->curbuf->buf[info->curbuf->c] = b; 04185 ++info->curbuf->c; 04186 04187 return true; 04188 }
Here is the call graph for this function:

| static boolean ieee_reference_type | ( | PTR | p | ) | [static] |
Definition at line 5675 of file ieee.c.
References ieee_pointer_type(), ieee_write_type::referencep, ieee_type_stack::type, and ieee_handle::type_stack.
05677 { 05678 struct ieee_handle *info = (struct ieee_handle *) p; 05679 05680 /* IEEE appears to record a normal pointer type, and then use a 05681 pmisc record to indicate that it is really a reference. */ 05682 05683 if (! ieee_pointer_type (p)) 05684 return false; 05685 info->type_stack->type.referencep = true; 05686 return true; 05687 }
Here is the call graph for this function:

| static int ieee_regno_to_genreg | ( | bfd * | abfd, | |
| int | r | |||
| ) | [static] |
Definition at line 3592 of file ieee.c.
Referenced by parse_ieee_atn().
03595 { 03596 switch (bfd_get_arch (abfd)) 03597 { 03598 case bfd_arch_m68k: 03599 /* For some reasons stabs adds 2 to the floating point register 03600 numbers. */ 03601 if (r >= 16) 03602 r += 2; 03603 break; 03604 03605 case bfd_arch_i960: 03606 /* Stabs uses 0 to 15 for r0 to r15, 16 to 31 for g0 to g15, and 03607 32 to 35 for fp0 to fp3. */ 03608 --r; 03609 break; 03610 03611 default: 03612 break; 03613 } 03614 03615 return r; 03616 }
Here is the caller graph for this function:

| static boolean ieee_require_asn | ( | struct ieee_info * | info, | |
| const bfd_byte ** | pp, | |||
| bfd_vma * | pv | |||
| ) | [static] |
Definition at line 3507 of file ieee.c.
References ieee_asn_record_enum, ieee_e2_first_byte_enum, ieee_error(), ieee_read_expression(), ieee_read_number(), and start().
Referenced by ieee_read_cxx_class(), ieee_read_cxx_defaults(), ieee_read_cxx_misc(), ieee_read_reference(), and parse_ieee_atn().
03511 { 03512 const bfd_byte *start; 03513 ieee_record_enum_type c; 03514 bfd_vma varindx; 03515 03516 start = *pp; 03517 03518 c = (ieee_record_enum_type) **pp; 03519 if (c != ieee_e2_first_byte_enum) 03520 { 03521 ieee_error (info, start, "missing required ASN"); 03522 return false; 03523 } 03524 ++*pp; 03525 03526 c = (ieee_record_enum_type) (((unsigned int) c << 8) | **pp); 03527 if (c != ieee_asn_record_enum) 03528 { 03529 ieee_error (info, start, "missing required ASN"); 03530 return false; 03531 } 03532 ++*pp; 03533 03534 /* Just ignore the variable index. */ 03535 if (! ieee_read_number (info, pp, &varindx)) 03536 return false; 03537 03538 return ieee_read_expression (info, pp, pv); 03539 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_require_atn65 | ( | struct ieee_info * | info, | |
| const bfd_byte ** | pp, | |||
| const char ** | pname, | |||
| unsigned long * | pnamlen | |||
| ) | [static] |
Definition at line 3544 of file ieee.c.
References ieee_at_record_enum, ieee_atn_record_enum, ieee_error(), ieee_read_id(), ieee_read_number(), and start().
Referenced by ieee_read_cxx_class(), ieee_read_cxx_defaults(), ieee_read_cxx_misc(), ieee_read_reference(), and parse_ieee_atn().
03549 { 03550 const bfd_byte *start; 03551 ieee_record_enum_type c; 03552 bfd_vma name_indx, type_indx, atn_code; 03553 03554 start = *pp; 03555 03556 c = (ieee_record_enum_type) **pp; 03557 if (c != ieee_at_record_enum) 03558 { 03559 ieee_error (info, start, "missing required ATN65"); 03560 return false; 03561 } 03562 ++*pp; 03563 03564 c = (ieee_record_enum_type) (((unsigned int) c << 8) | **pp); 03565 if (c != ieee_atn_record_enum) 03566 { 03567 ieee_error (info, start, "missing required ATN65"); 03568 return false; 03569 } 03570 ++*pp; 03571 03572 if (! ieee_read_number (info, pp, &name_indx) 03573 || ! ieee_read_number (info, pp, &type_indx) 03574 || ! ieee_read_number (info, pp, &atn_code)) 03575 return false; 03576 03577 /* Just ignore name_indx. */ 03578 03579 if (type_indx != 0 || atn_code != 65) 03580 { 03581 ieee_error (info, start, "bad ATN65 record"); 03582 return false; 03583 } 03584 03585 return ieee_read_id (info, pp, pname, pnamlen); 03586 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_set_type | ( | PTR | p, | |
| boolean | bitstringp | |||
| ) | [static] |
Definition at line 5786 of file ieee.c.
References ieee_define_type(), ieee_pop_type(), ieee_write_number(), ieee_write_type::localp, ieee_type_stack::type, and ieee_handle::type_stack.
05789 { 05790 struct ieee_handle *info = (struct ieee_handle *) p; 05791 boolean localp; 05792 unsigned int eleindx; 05793 05794 localp = info->type_stack->type.localp; 05795 eleindx = ieee_pop_type (info); 05796 05797 /* FIXME: We don't know the size, so we just use 4. */ 05798 05799 return (ieee_define_type (info, 0, true, localp) 05800 && ieee_write_number (info, 's') 05801 && ieee_write_number (info, 4) 05802 && ieee_write_number (info, eleindx)); 05803 }
Here is the call graph for this function:

| static boolean ieee_start_block | ( | PTR | p, | |
| bfd_vma | addr | |||
| ) | [static] |
Definition at line 7395 of file ieee.c.
References ieee_bb_record_enum, ieee_change_buffer(), ieee_output_pending_parms(), ieee_start_range(), ieee_write_byte, ieee_write_id(), ieee_write_number(), and ieee_handle::vars.
07398 { 07399 struct ieee_handle *info = (struct ieee_handle *) p; 07400 07401 if (! ieee_change_buffer (info, &info->vars)) 07402 return false; 07403 07404 if (info->block_depth == 1) 07405 { 07406 if (! ieee_write_number (info, addr) 07407 || ! ieee_output_pending_parms (info)) 07408 return false; 07409 } 07410 else 07411 { 07412 if (! ieee_write_byte (info, (int) ieee_bb_record_enum) 07413 || ! ieee_write_byte (info, 6) 07414 || ! ieee_write_number (info, 0) 07415 || ! ieee_write_id (info, "") 07416 || ! ieee_write_number (info, 0) 07417 || ! ieee_write_number (info, 0) 07418 || ! ieee_write_number (info, addr)) 07419 return false; 07420 } 07421 07422 if (! ieee_start_range (info, addr)) 07423 return false; 07424 07425 ++info->block_depth; 07426 07427 return true; 07428 }
Here is the call graph for this function:

| static boolean ieee_start_class_type | ( | PTR | p, | |
| const char * | tag, | |||
| unsigned int | id, | |||
| boolean | structp, | |||
| unsigned int | size, | |||
| boolean | vptr, | |||
| boolean | ownvptr | |||
| ) | [static] |
Definition at line 6235 of file ieee.c.
References assert, ieee_change_buffer(), ieee_init_buffer(), ieee_pop_type(), ieee_start_struct_type(), ieee_write_asn(), ieee_write_atn65(), memset, ieee_write_type::name, ieee_handle::name_indx, NULL, ieee_type_class::pmiscbuf, ieee_type_stack::type, ieee_handle::type_stack, and xmalloc().
06243 { 06244 struct ieee_handle *info = (struct ieee_handle *) p; 06245 const char *vclass; 06246 struct ieee_buflist pmiscbuf; 06247 unsigned int indx; 06248 struct ieee_type_class *classdef; 06249 06250 /* A C++ class is output as a C++ struct along with a set of pmisc 06251 records describing the class. */ 06252 06253 /* We need to have a name so that we can associate the struct and 06254 the class. */ 06255 if (tag == NULL) 06256 { 06257 char *t; 06258 06259 t = (char *) xmalloc (20); 06260 sprintf (t, "__anon%u", id); 06261 tag = t; 06262 } 06263 06264 /* We can't write out the virtual table information until we have 06265 finished the class, because we don't know the virtual table size. 06266 We get the size from the largest voffset we see. */ 06267 vclass = NULL; 06268 if (vptr && ! ownvptr) 06269 { 06270 vclass = info->type_stack->type.name; 06271 assert (vclass != NULL); 06272 /* We don't call ieee_pop_unused_type, since the class should 06273 get defined. */ 06274 (void) ieee_pop_type (info); 06275 } 06276 06277 if (! ieee_start_struct_type (p, tag, id, structp, size)) 06278 return false; 06279 06280 indx = info->name_indx; 06281 ++info->name_indx; 06282 06283 /* We write out pmisc records into the classdef field. We will 06284 write out the pmisc start after we know the number of records we 06285 need. */ 06286 if (! ieee_init_buffer (info, &pmiscbuf) 06287 || ! ieee_change_buffer (info, &pmiscbuf) 06288 || ! ieee_write_asn (info, indx, 'T') 06289 || ! ieee_write_asn (info, indx, structp ? 'o' : 'u') 06290 || ! ieee_write_atn65 (info, indx, tag)) 06291 return false; 06292 06293 classdef = (struct ieee_type_class *) xmalloc (sizeof *classdef); 06294 memset (classdef, 0, sizeof *classdef); 06295 06296 classdef->indx = indx; 06297 classdef->pmiscbuf = pmiscbuf; 06298 classdef->pmisccount = 3; 06299 classdef->vclass = vclass; 06300 classdef->ownvptr = ownvptr; 06301 06302 info->type_stack->type.classdef = classdef; 06303 06304 return true; 06305 }
Here is the call graph for this function:

| static boolean ieee_start_compilation_unit | ( | PTR | p, | |
| const char * | filename | |||
| ) | [static] |
Definition at line 4916 of file ieee.c.
References ieee_handle::filename, ieee_bb_record_enum, ieee_change_buffer(), ieee_finish_compilation_unit(), ieee_init_buffer(), ieee_write_byte, ieee_write_id(), ieee_write_number(), info, ieee_handle::modname, NULL, strrchr(), and ieee_handle::types.
04919 { 04920 struct ieee_handle *info = (struct ieee_handle *) p; 04921 const char *modname; 04922 char *c, *s; 04923 unsigned int nindx; 04924 04925 if (info->filename != NULL) 04926 { 04927 if (! ieee_finish_compilation_unit (info)) 04928 return false; 04929 } 04930 04931 info->filename = filename; 04932 modname = strrchr (filename, '/'); 04933 if (modname != NULL) 04934 ++modname; 04935 else 04936 { 04937 modname = strrchr (filename, '\\'); 04938 if (modname != NULL) 04939 ++modname; 04940 else 04941 modname = filename; 04942 } 04943 c = xstrdup (modname); 04944 s = strrchr (c, '.'); 04945 if (s != NULL) 04946 *s = '\0'; 04947 info->modname = c; 04948 04949 if (! ieee_init_buffer (info, &info->types) 04950 || ! ieee_init_buffer (info, &info->vars) 04951 || ! ieee_init_buffer (info, &info->cxx) 04952 || ! ieee_init_buffer (info, &info->linenos)) 04953 return false; 04954 info->ranges = NULL; 04955 04956 /* Always include a BB1 and a BB3 block. That is what the output of 04957 the MRI linker seems to look like. */ 04958 if (! ieee_change_buffer (info, &info->types) 04959 || ! ieee_write_byte (info, (int) ieee_bb_record_enum) 04960 || ! ieee_write_byte (info, 1) 04961 || ! ieee_write_number (info, 0) 04962 || ! ieee_write_id (info, info->modname)) 04963 return false; 04964 04965 nindx = info->name_indx; 04966 ++info->name_indx; 04967 if (! ieee_change_buffer (info, &info->vars) 04968 || ! ieee_write_byte (info, (int) ieee_bb_record_enum) 04969 || ! ieee_write_byte (info, 3) 04970 || ! ieee_write_number (info, 0) 04971 || ! ieee_write_id (info, info->modname)) 04972 return false; 04973 04974 return true; 04975 }
Here is the call graph for this function:

| static boolean ieee_start_function | ( | PTR | p, | |
| const char * | name, | |||
| boolean | global | |||
| ) | [static] |
Definition at line 7183 of file ieee.c.
References abort(), assert, ieee_handle::fnname, ieee_handle::fntype, ieee_atn_record_enum, ieee_bb_record_enum, ieee_buffer_emptyp, ieee_change_buffer(), ieee_define_named_type(), ieee_init_buffer(), ieee_nn_record, ieee_pop_type(), ieee_write_2bytes(), ieee_write_asn(), ieee_write_atn65(), ieee_write_byte, ieee_write_id(), ieee_write_number(), ieee_write_type::referencep, ieee_type_stack::type, and ieee_handle::type_stack.
07187 { 07188 struct ieee_handle *info = (struct ieee_handle *) p; 07189 boolean referencep; 07190 unsigned int retindx, typeindx; 07191 07192 referencep = info->type_stack->type.referencep; 07193 retindx = ieee_pop_type (info); 07194 07195 /* Besides recording a BB4 or BB6 block, we record the type of the 07196 function in the BB1 typedef block. We can't write out the full 07197 type until we have seen all the parameters, so we accumulate it 07198 in info->fntype and info->fnargs. */ 07199 if (! ieee_buffer_emptyp (&info->fntype)) 07200 { 07201 /* FIXME: This might happen someday if we support nested 07202 functions. */ 07203 abort (); 07204 } 07205 07206 info->fnname = name; 07207 07208 /* An attribute of 0x40 means that the push mask is unknown. */ 07209 if (! ieee_define_named_type (info, name, (unsigned int) -1, 0, false, true, 07210 &info->fntype) 07211 || ! ieee_write_number (info, 'x') 07212 || ! ieee_write_number (info, 0x40) 07213 || ! ieee_write_number (info, 0) 07214 || ! ieee_write_number (info, 0) 07215 || ! ieee_write_number (info, retindx)) 07216 return false; 07217 07218 typeindx = ieee_pop_type (info); 07219 07220 if (! ieee_init_buffer (info, &info->fnargs)) 07221 return false; 07222 info->fnargcount = 0; 07223 07224 /* If the function return value is actually a reference type, we 07225 must add a record indicating that. */ 07226 if (referencep) 07227 { 07228 unsigned int nindx; 07229 07230 nindx = info->name_indx; 07231 ++info->name_indx; 07232 if (! ieee_change_buffer (info, &info->cxx) 07233 || ! ieee_write_byte (info, (int) ieee_nn_record) 07234 || ! ieee_write_number (info, nindx) 07235 || ! ieee_write_id (info, "") 07236 || ! ieee_write_2bytes (info, (int) ieee_atn_record_enum) 07237 || ! ieee_write_number (info, nindx) 07238 || ! ieee_write_number (info, 0) 07239 || ! ieee_write_number (info, 62) 07240 || ! ieee_write_number (info, 80) 07241 || ! ieee_write_number (info, 3) 07242 || ! ieee_write_asn (info, nindx, 'R') 07243 || ! ieee_write_asn (info, nindx, global ? 0 : 1) 07244 || ! ieee_write_atn65 (info, nindx, name)) 07245 return false; 07246 } 07247 07248 assert (! ieee_buffer_emptyp (&info->vars)); 07249 if (! ieee_change_buffer (info, &info->vars)) 07250 return false; 07251 07252 /* The address is written out as the first block. */ 07253 07254 ++info->block_depth; 07255 07256 return (ieee_write_byte (info, (int) ieee_bb_record_enum) 07257 && ieee_write_byte (info, global ? 4 : 6) 07258 && ieee_write_number (info, 0) 07259 && ieee_write_id (info, name) 07260 && ieee_write_number (info, 0) 07261 && ieee_write_number (info, typeindx)); 07262 }
Here is the call graph for this function:

| static boolean ieee_start_range | ( | struct ieee_handle * | info, | |
| bfd_vma | low | |||
| ) | [static] |
Definition at line 4477 of file ieee.c.
References memset, and xmalloc().
Referenced by ieee_start_block().
04480 { 04481 struct ieee_range *r; 04482 04483 r = (struct ieee_range *) xmalloc (sizeof *r); 04484 memset (r, 0, sizeof *r); 04485 r->low = low; 04486 r->next = info->pending_ranges; 04487 info->pending_ranges = r; 04488 return true; 04489 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_start_source | ( | PTR | p, | |
| const char * | filename | |||
| ) | [static] |
| static boolean ieee_start_struct_type | ( | PTR | p, | |
| const char * | tag, | |||
| unsigned int | id, | |||
| boolean | structp, | |||
| unsigned int | size | |||
| ) | [static] |
Definition at line 5953 of file ieee.c.
References assert, mySTL::copy(), DEBUG_KIND_ILLEGAL, h, ieee_name_type::id, ieee_define_named_type(), ieee_init_buffer(), ieee_name_type_hash_lookup, ieee_write_number(), ieee_write_type::indx, ieee_name_type::kind, ieee_write_type::localp, memset, ieee_write_type::name, ieee_name_type::next, NULL, ieee_handle::tags, ieee_name_type::type, ieee_handle::type_indx, and xmalloc().
Referenced by ieee_start_class_type().
05959 { 05960 struct ieee_handle *info = (struct ieee_handle *) p; 05961 boolean localp, ignorep; 05962 boolean copy; 05963 char ab[20]; 05964 const char *look; 05965 struct ieee_name_type_hash_entry *h; 05966 struct ieee_name_type *nt, *ntlook; 05967 struct ieee_buflist strdef; 05968 05969 localp = false; 05970 ignorep = false; 05971 05972 /* We need to create a tag for internal use even if we don't want 05973 one for external use. This will let us refer to an anonymous 05974 struct. */ 05975 if (tag != NULL) 05976 { 05977 look = tag; 05978 copy = false; 05979 } 05980 else 05981 { 05982 sprintf (ab, "__anon%u", id); 05983 look = ab; 05984 copy = true; 05985 } 05986 05987 /* If we already have references to the tag, we must use the 05988 existing type index. */ 05989 h = ieee_name_type_hash_lookup (&info->tags, look, true, copy); 05990 if (h == NULL) 05991 return false; 05992 05993 nt = NULL; 05994 for (ntlook = h->types; ntlook != NULL; ntlook = ntlook->next) 05995 { 05996 if (ntlook->id == id) 05997 nt = ntlook; 05998 else if (! ntlook->type.localp) 05999 { 06000 /* We are creating a duplicate definition of a globally 06001 defined tag. Force it to be local to avoid 06002 confusion. */ 06003 localp = true; 06004 } 06005 } 06006 06007 if (nt != NULL) 06008 { 06009 assert (localp == nt->type.localp); 06010 if (nt->kind == DEBUG_KIND_ILLEGAL && ! localp) 06011 { 06012 /* We've already seen a global definition of the type. 06013 Ignore this new definition. */ 06014 ignorep = true; 06015 } 06016 } 06017 else 06018 { 06019 nt = (struct ieee_name_type *) xmalloc (sizeof *nt); 06020 memset (nt, 0, sizeof *nt); 06021 nt->id = id; 06022 nt->type.name = h->root.string; 06023 nt->next = h->types; 06024 h->types = nt; 06025 nt->type.indx = info->type_indx; 06026 ++info->type_indx; 06027 } 06028 06029 nt->kind = DEBUG_KIND_ILLEGAL; 06030 06031 if (! ieee_init_buffer (info, &strdef) 06032 || ! ieee_define_named_type (info, tag, nt->type.indx, size, true, 06033 localp, &strdef) 06034 || ! ieee_write_number (info, structp ? 'S' : 'U') 06035 || ! ieee_write_number (info, size)) 06036 return false; 06037 06038 if (! ignorep) 06039 { 06040 const char *hold; 06041 06042 /* We never want nt->type.name to be NULL. We want the rest of 06043 the type to be the object set up on the type stack; it will 06044 have a NULL name if tag is NULL. */ 06045 hold = nt->type.name; 06046 nt->type = info->type_stack->type; 06047 nt->type.name = hold; 06048 } 06049 06050 info->type_stack->type.name = tag; 06051 info->type_stack->type.strdef = strdef; 06052 info->type_stack->type.ignorep = ignorep; 06053 06054 return true; 06055 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_struct_field | ( | PTR | p, | |
| const char * | name, | |||
| bfd_vma | bitpos, | |||
| bfd_vma | bitsize, | |||
| enum debug_visibility | visibility | |||
| ) | [static] |
Definition at line 6060 of file ieee.c.
References assert, ieee_write_type::classdef, flags, ieee_atn_record_enum, ieee_buffer_emptyp, ieee_change_buffer(), ieee_define_type(), ieee_nn_record, ieee_pop_type(), ieee_pop_unused_type(), ieee_vis_to_flags(), ieee_write_2bytes(), ieee_write_asn(), ieee_write_atn65(), ieee_write_byte, ieee_write_id(), ieee_write_number(), ieee_write_type::ignorep, ieee_type_class::indx, ieee_write_type::localp, ieee_type_stack::next, NULL, offset, ieee_type_class::pmiscbuf, ieee_write_type::referencep, ieee_write_type::size, ieee_write_type::strdef, ieee_type_stack::type, ieee_handle::type_stack, and ieee_write_type::unsignedp.
06066 { 06067 struct ieee_handle *info = (struct ieee_handle *) p; 06068 unsigned int size; 06069 boolean unsignedp; 06070 boolean referencep; 06071 boolean localp; 06072 unsigned int indx; 06073 bfd_vma offset; 06074 06075 assert (info->type_stack != NULL 06076 && info->type_stack->next != NULL 06077 && ! ieee_buffer_emptyp (&info->type_stack->next->type.strdef)); 06078 06079 /* If we are ignoring this struct definition, just pop and ignore 06080 the type. */ 06081 if (info->type_stack->next->type.ignorep) 06082 { 06083 ieee_pop_unused_type (info); 06084 return true; 06085 } 06086 06087 size = info->type_stack->type.size; 06088 unsignedp = info->type_stack->type.unsignedp; 06089 referencep = info->type_stack->type.referencep; 06090 localp = info->type_stack->type.localp; 06091 indx = ieee_pop_type (info); 06092 06093 if (localp) 06094 info->type_stack->type.localp = true; 06095 06096 if (info->type_stack->type.classdef != NULL) 06097 { 06098 unsigned int flags; 06099 unsigned int nindx; 06100 06101 /* This is a class. We must add a description of this field to 06102 the class records we are building. */ 06103 06104 flags = ieee_vis_to_flags (visibility); 06105 nindx = info->type_stack->type.classdef->indx; 06106 if (! ieee_change_buffer (info, 06107 &info->type_stack->type.classdef->pmiscbuf) 06108 || ! ieee_write_asn (info, nindx, 'd') 06109 || ! ieee_write_asn (info, nindx, flags) 06110 || ! ieee_write_atn65 (info, nindx, name) 06111 || ! ieee_write_atn65 (info, nindx, name)) 06112 return false; 06113 info->type_stack->type.classdef->pmisccount += 4; 06114 06115 if (referencep) 06116 { 06117 unsigned int nindx; 06118 06119 /* We need to output a record recording that this field is 06120 really of reference type. We put this on the refs field 06121 of classdef, so that it can be appended to the C++ 06122 records after the class is defined. */ 06123 06124 nindx = info->name_indx; 06125 ++info->name_indx; 06126 06127 if (! ieee_change_buffer (info, 06128 &info->type_stack->type.classdef->refs) 06129 || ! ieee_write_byte (info, (int) ieee_nn_record) 06130 || ! ieee_write_number (info, nindx) 06131 || ! ieee_write_id (info, "") 06132 || ! ieee_write_2bytes (info, (int) ieee_atn_record_enum) 06133 || ! ieee_write_number (info, nindx) 06134 || ! ieee_write_number (info, 0) 06135 || ! ieee_write_number (info, 62) 06136 || ! ieee_write_number (info, 80) 06137 || ! ieee_write_number (info, 4) 06138 || ! ieee_write_asn (info, nindx, 'R') 06139 || ! ieee_write_asn (info, nindx, 3) 06140 || ! ieee_write_atn65 (info, nindx, info->type_stack->type.name) 06141 || ! ieee_write_atn65 (info, nindx, name)) 06142 return false; 06143 } 06144 } 06145 06146 /* If the bitsize doesn't match the expected size, we need to output 06147 a bitfield type. */ 06148 if (size == 0 || bitsize == 0 || bitsize == size * 8) 06149 offset = bitpos / 8; 06150 else 06151 { 06152 if (! ieee_define_type (info, 0, unsignedp, 06153 info->type_stack->type.localp) 06154 || ! ieee_write_number (info, 'g') 06155 || ! ieee_write_number (info, unsignedp ? 0 : 1) 06156 || ! ieee_write_number (info, bitsize) 06157 || ! ieee_write_number (info, indx)) 06158 return false; 06159 indx = ieee_pop_type (info); 06160 offset = bitpos; 06161 } 06162 06163 /* Switch to the struct we are building in order to output this 06164 field definition. */ 06165 return (ieee_change_buffer (info, &info->type_stack->type.strdef) 06166 && ieee_write_id (info, name) 06167 && ieee_write_number (info, indx) 06168 && ieee_write_number (info, offset)); 06169 }
Here is the call graph for this function:

| static boolean ieee_tag | ( | PTR | p, | |
| const char * | name | |||
| ) | [static] |
Definition at line 7006 of file ieee.c.
References ieee_pop_type().
07009 { 07010 struct ieee_handle *info = (struct ieee_handle *) p; 07011 07012 /* This should not be ieee_pop_unused_type, since we want the type 07013 to be defined. */ 07014 (void) ieee_pop_type (info); 07015 return true; 07016 }
Here is the call graph for this function:

| static boolean ieee_tag_type | ( | PTR | p, | |
| const char * | name, | |||
| unsigned int | id, | |||
| enum debug_type_kind | kind | |||
| ) | [static] |
Definition at line 6673 of file ieee.c.
References abort(), mySTL::copy(), DEBUG_KIND_ENUM, e, ieee_handle::enums, h, ieee_name_type::id, ieee_name_type_hash_lookup, ieee_push_type(), ieee_write_type::indx, ieee_write_type::localp, memset, ieee_name_type::next, NULL, ieee_write_type::size, strcmp(), ieee_handle::tags, ieee_name_type::type, ieee_handle::type_indx, ieee_write_type::unsignedp, and xmalloc().
06678 { 06679 struct ieee_handle *info = (struct ieee_handle *) p; 06680 boolean localp; 06681 boolean copy; 06682 char ab[20]; 06683 struct ieee_name_type_hash_entry *h; 06684 struct ieee_name_type *nt; 06685 06686 if (kind == DEBUG_KIND_ENUM) 06687 { 06688 struct ieee_defined_enum *e; 06689 06690 if (name == NULL) 06691 abort (); 06692 for (e = info->enums; e != NULL; e = e->next) 06693 if (e->tag != NULL && strcmp (e->tag, name) == 0) 06694 return ieee_push_type (info, e->indx, 0, true, false); 06695 06696 e = (struct ieee_defined_enum *) xmalloc (sizeof *e); 06697 memset (e, 0, sizeof *e); 06698 06699 e->indx = info->type_indx; 06700 ++info->type_indx; 06701 e->tag = name; 06702 e->defined = false; 06703 06704 e->next = info->enums; 06705 info->enums = e; 06706 06707 return ieee_push_type (info, e->indx, 0, true, false); 06708 } 06709 06710 localp = false; 06711 06712 copy = false; 06713 if (name == NULL) 06714 { 06715 sprintf (ab, "__anon%u", id); 06716 name = ab; 06717 copy = true; 06718 } 06719 06720 h = ieee_name_type_hash_lookup (&info->tags, name, true, copy); 06721 if (h == NULL) 06722 return false; 06723 06724 for (nt = h->types; nt != NULL; nt = nt->next) 06725 { 06726 if (nt->id == id) 06727 { 06728 if (! ieee_push_type (info, nt->type.indx, nt->type.size, 06729 nt->type.unsignedp, nt->type.localp)) 06730 return false; 06731 /* Copy over any other type information we may have. */ 06732 info->type_stack->type = nt->type; 06733 return true; 06734 } 06735 06736 if (! nt->type.localp) 06737 { 06738 /* This is a duplicate of a global type, so it must be 06739 local. */ 06740 localp = true; 06741 } 06742 } 06743 06744 nt = (struct ieee_name_type *) xmalloc (sizeof *nt); 06745 memset (nt, 0, sizeof *nt); 06746 06747 nt->id = id; 06748 nt->type.name = h->root.string; 06749 nt->type.indx = info->type_indx; 06750 nt->type.localp = localp; 06751 ++info->type_indx; 06752 nt->kind = kind; 06753 06754 nt->next = h->types; 06755 h->types = nt; 06756 06757 if (! ieee_push_type (info, nt->type.indx, 0, false, localp)) 06758 return false; 06759 06760 info->type_stack->type.name = h->root.string; 06761 06762 return true; 06763 }
Here is the call graph for this function:

| static boolean ieee_typdef | ( | PTR | p, | |
| const char * | name | |||
| ) | [static] |
Definition at line 6768 of file ieee.c.
References builtin_bcd_float, builtin_char, builtin_double, builtin_float, builtin_int, builtin_long, builtin_long_double, builtin_long_long_double, builtin_short, builtin_short_int, builtin_signed_char, builtin_signed_long, builtin_signed_long_long, builtin_signed_short, builtin_signed_short_int, builtin_unsigned, builtin_unsigned_char, builtin_unsigned_int, builtin_unsigned_long, builtin_unsigned_long_long, builtin_unsigned_short, builtin_unsigned_short_int, builtin_void, DEBUG_KIND_ILLEGAL, h, ieee_name_type::id, ieee_define_named_type(), ieee_name_type_hash_lookup, ieee_pop_type(), ieee_pop_unused_type(), ieee_write_number(), ieee_write_type::indx, ieee_write_type::localp, memset, ieee_write_type::name, ieee_name_type::next, NULL, ieee_write_type::size, strcmp(), ieee_type_stack::type, ieee_name_type::type, ieee_handle::type_stack, ieee_handle::typedefs, ieee_write_type::unsignedp, and xmalloc().
06771 { 06772 struct ieee_handle *info = (struct ieee_handle *) p; 06773 struct ieee_write_type type; 06774 unsigned int indx; 06775 boolean found; 06776 boolean localp; 06777 struct ieee_name_type_hash_entry *h; 06778 struct ieee_name_type *nt; 06779 06780 type = info->type_stack->type; 06781 indx = type.indx; 06782 06783 /* If this is a simple builtin type using a builtin name, we don't 06784 want to output the typedef itself. We also want to change the 06785 type index to correspond to the name being used. We recognize 06786 names used in stabs debugging output even if they don't exactly 06787 correspond to the names used for the IEEE builtin types. */ 06788 found = false; 06789 if (indx <= (unsigned int) builtin_bcd_float) 06790 { 06791 switch ((enum builtin_types) indx) 06792 { 06793 default: 06794 break; 06795 06796 case builtin_void: 06797 if (strcmp (name, "void") == 0) 06798 found = true; 06799 break; 06800 06801 case builtin_signed_char: 06802 case builtin_char: 06803 if (strcmp (name, "signed char") == 0) 06804 { 06805 indx = (unsigned int) builtin_signed_char; 06806 found = true; 06807 } 06808 else if (strcmp (name, "char") == 0) 06809 { 06810 indx = (unsigned int) builtin_char; 06811 found = true; 06812 } 06813 break; 06814 06815 case builtin_unsigned_char: 06816 if (strcmp (name, "unsigned char") == 0) 06817 found = true; 06818 break; 06819 06820 case builtin_signed_short_int: 06821 case builtin_short: 06822 case builtin_short_int: 06823 case builtin_signed_short: 06824 if (strcmp (name, "signed short int") == 0) 06825 { 06826 indx = (unsigned int) builtin_signed_short_int; 06827 found = true; 06828 } 06829 else if (strcmp (name, "short") == 0) 06830 { 06831 indx = (unsigned int) builtin_short; 06832 found = true; 06833 } 06834 else if (strcmp (name, "short int") == 0) 06835 { 06836 indx = (unsigned int) builtin_short_int; 06837 found = true; 06838 } 06839 else if (strcmp (name, "signed short") == 0) 06840 { 06841 indx = (unsigned int) builtin_signed_short; 06842 found = true; 06843 } 06844 break; 06845 06846 case builtin_unsigned_short_int: 06847 case builtin_unsigned_short: 06848 if (strcmp (name, "unsigned short int") == 0 06849 || strcmp (name, "short unsigned int") == 0) 06850 { 06851 indx = builtin_unsigned_short_int; 06852 found = true; 06853 } 06854 else if (strcmp (name, "unsigned short") == 0) 06855 { 06856 indx = builtin_unsigned_short; 06857 found = true; 06858 } 06859 break; 06860 06861 case builtin_signed_long: 06862 case builtin_int: /* FIXME: Size depends upon architecture. */ 06863 case builtin_long: 06864 if (strcmp (name, "signed long") == 0) 06865 { 06866 indx = builtin_signed_long; 06867 found = true; 06868 } 06869 else if (strcmp (name, "int") == 0) 06870 { 06871 indx = builtin_int; 06872 found = true; 06873 } 06874 else if (strcmp (name, "long") == 0 06875 || strcmp (name, "long int") == 0) 06876 { 06877 indx = builtin_long; 06878 found = true; 06879 } 06880 break; 06881 06882 case builtin_unsigned_long: 06883 case builtin_unsigned: /* FIXME: Size depends upon architecture. */ 06884 case builtin_unsigned_int: /* FIXME: Like builtin_unsigned. */ 06885 if (strcmp (name, "unsigned long") == 0 06886 || strcmp (name, "long unsigned int") == 0) 06887 { 06888 indx = builtin_unsigned_long; 06889 found = true; 06890 } 06891 else if (strcmp (name, "unsigned") == 0) 06892 { 06893 indx = builtin_unsigned; 06894 found = true; 06895 } 06896 else if (strcmp (name, "unsigned int") == 0) 06897 { 06898 indx = builtin_unsigned_int; 06899 found = true; 06900 } 06901 break; 06902 06903 case builtin_signed_long_long: 06904 if (strcmp (name, "signed long long") == 0 06905 || strcmp (name, "long long int") == 0) 06906 found = true; 06907 break; 06908 06909 case builtin_unsigned_long_long: 06910 if (strcmp (name, "unsigned long long") == 0 06911 || strcmp (name, "long long unsigned int") == 0) 06912 found = true; 06913 break; 06914 06915 case builtin_float: 06916 if (strcmp (name, "float") == 0) 06917 found = true; 06918 break; 06919 06920 case builtin_double: 06921 if (strcmp (name, "double") == 0) 06922 found = true; 06923 break; 06924 06925 case builtin_long_double: 06926 if (strcmp (name, "long double") == 0) 06927 found = true; 06928 break; 06929 06930 case builtin_long_long_double: 06931 if (strcmp (name, "long long double") == 0) 06932 found = true; 06933 break; 06934 } 06935 06936 if (found) 06937 type.indx = indx; 06938 } 06939 06940 h = ieee_name_type_hash_lookup (&info->typedefs, name, true, false); 06941 if (h == NULL) 06942 return false; 06943 06944 /* See if we have already defined this type with this name. */ 06945 localp = type.localp; 06946 for (nt = h->types; nt != NULL; nt = nt->next) 06947 { 06948 if (nt->id == indx) 06949 { 06950 /* If this is a global definition, then we don't need to 06951 do anything here. */ 06952 if (! nt->type.localp) 06953 { 06954 ieee_pop_unused_type (info); 06955 return true; 06956 } 06957 } 06958 else 06959 { 06960 /* This is a duplicate definition, so make this one local. */ 06961 localp = true; 06962 } 06963 } 06964 06965 /* We need to add a new typedef for this type. */ 06966 06967 nt = (struct ieee_name_type *) xmalloc (sizeof *nt); 06968 memset (nt, 0, sizeof *nt); 06969 nt->id = indx; 06970 nt->type = type; 06971 nt->type.name = name; 06972 nt->type.localp = localp; 06973 nt->kind = DEBUG_KIND_ILLEGAL; 06974 06975 nt->next = h->types; 06976 h->types = nt; 06977 06978 if (found) 06979 { 06980 /* This is one of the builtin typedefs, so we don't need to 06981 actually define it. */ 06982 ieee_pop_unused_type (info); 06983 return true; 06984 } 06985 06986 indx = ieee_pop_type (info); 06987 06988 if (! ieee_define_named_type (info, name, (unsigned int) -1, type.size, 06989 type.unsignedp, localp, 06990 (struct ieee_buflist *) NULL) 06991 || ! ieee_write_number (info, 'T') 06992 || ! ieee_write_number (info, indx)) 06993 return false; 06994 06995 /* Remove the type we just added to the type stack. This should not 06996 be ieee_pop_unused_type, since the type is used, we just don't 06997 need it now. */ 06998 (void) ieee_pop_type (info); 06999 07000 return true; 07001 }
Here is the call graph for this function:

| static boolean ieee_typed_constant | ( | PTR | p, | |
| const char * | name, | |||
| bfd_vma | val | |||
| ) | [static] |
Definition at line 7045 of file ieee.c.
References ieee_pop_unused_type().
07049 { 07050 struct ieee_handle *info = (struct ieee_handle *) p; 07051 07052 /* FIXME. */ 07053 ieee_pop_unused_type (info); 07054 return true; 07055 }
Here is the call graph for this function:

| static boolean ieee_typedef_type | ( | PTR | p, | |
| const char * | name | |||
| ) | [static] |
Definition at line 6641 of file ieee.c.
References assert, h, ieee_name_type_hash_lookup, ieee_push_type(), ieee_write_type::indx, ieee_write_type::localp, NULL, ieee_write_type::size, ieee_name_type::type, ieee_handle::typedefs, and ieee_write_type::unsignedp.
06644 { 06645 struct ieee_handle *info = (struct ieee_handle *) p; 06646 struct ieee_name_type_hash_entry *h; 06647 struct ieee_name_type *nt; 06648 06649 h = ieee_name_type_hash_lookup (&info->typedefs, name, false, false); 06650 06651 /* h should never be NULL, since that would imply that the generic 06652 debugging code has asked for a typedef which it has not yet 06653 defined. */ 06654 assert (h != NULL); 06655 06656 /* We always use the most recently defined type for this name, which 06657 will be the first one on the list. */ 06658 06659 nt = h->types; 06660 if (! ieee_push_type (info, nt->type.indx, nt->type.size, 06661 nt->type.unsignedp, nt->type.localp)) 06662 return false; 06663 06664 /* Copy over any other type information we may have. */ 06665 info->type_stack->type = nt->type; 06666 06667 return true; 06668 }
Here is the call graph for this function:

| static boolean ieee_variable | ( | PTR | p, | |
| const char * | name, | |||
| enum debug_var_kind | kind, | |||
| bfd_vma | val | |||
| ) | [static] |
Definition at line 7060 of file ieee.c.
References abort(), assert, DEBUG_GLOBAL, DEBUG_LOCAL, DEBUG_LOCAL_STATIC, DEBUG_REGISTER, DEBUG_STATIC, ieee_add_range(), ieee_atn_record_enum, ieee_buffer_emptyp, ieee_change_buffer(), ieee_genreg_to_regno(), ieee_nn_record, ieee_pop_type(), ieee_write_2bytes(), ieee_write_asn(), ieee_write_atn65(), ieee_write_byte, ieee_write_id(), ieee_write_number(), ieee_handle::name_indx, ieee_write_type::referencep, ieee_write_type::size, ieee_type_stack::type, ieee_handle::type_indx, ieee_handle::type_stack, and ieee_handle::vars.
Referenced by ieee_output_pending_parms().
07065 { 07066 struct ieee_handle *info = (struct ieee_handle *) p; 07067 unsigned int name_indx; 07068 unsigned int size; 07069 boolean referencep; 07070 unsigned int type_indx; 07071 boolean asn; 07072 int refflag; 07073 07074 size = info->type_stack->type.size; 07075 referencep = info->type_stack->type.referencep; 07076 type_indx = ieee_pop_type (info); 07077 07078 assert (! ieee_buffer_emptyp (&info->vars)); 07079 if (! ieee_change_buffer (info, &info->vars)) 07080 return false; 07081 07082 name_indx = info->name_indx; 07083 ++info->name_indx; 07084 07085 /* Write out an NN and an ATN record for this variable. */ 07086 if (! ieee_write_byte (info, (int) ieee_nn_record) 07087 || ! ieee_write_number (info, name_indx) 07088 || ! ieee_write_id (info, name) 07089 || ! ieee_write_2bytes (info, (int) ieee_atn_record_enum) 07090 || ! ieee_write_number (info, name_indx) 07091 || ! ieee_write_number (info, type_indx)) 07092 return false; 07093 switch (kind) 07094 { 07095 default: 07096 abort (); 07097 return false; 07098 case DEBUG_GLOBAL: 07099 if (! ieee_write_number (info, 8) 07100 || ! ieee_add_range (info, false, val, val + size)) 07101 return false; 07102 refflag = 0; 07103 asn = true; 07104 break; 07105 case DEBUG_STATIC: 07106 if (! ieee_write_number (info, 3) 07107 || ! ieee_add_range (info, false, val, val + size)) 07108 return false; 07109 refflag = 1; 07110 asn = true; 07111 break; 07112 case DEBUG_LOCAL_STATIC: 07113 if (! ieee_write_number (info, 3) 07114 || ! ieee_add_range (info, false, val, val + size)) 07115 return false; 07116 refflag = 2; 07117 asn = true; 07118 break; 07119 case DEBUG_LOCAL: 07120 if (! ieee_write_number (info, 1) 07121 || ! ieee_write_number (info, val)) 07122 return false; 07123 refflag = 2; 07124 asn = false; 07125 break; 07126 case DEBUG_REGISTER: 07127 if (! ieee_write_number (info, 2) 07128 || ! ieee_write_number (info, 07129 ieee_genreg_to_regno (info->abfd, val))) 07130 return false; 07131 refflag = 2; 07132 asn = false; 07133 break; 07134 } 07135 07136 if (asn) 07137 { 07138 if (! ieee_write_asn (info, name_indx, val)) 07139 return false; 07140 } 07141 07142 /* If this is really a reference type, then we just output it with 07143 pointer type, and must now output a C++ record indicating that it 07144 is really reference type. */ 07145 if (referencep) 07146 { 07147 unsigned int nindx; 07148 07149 nindx = info->name_indx; 07150 ++info->name_indx; 07151 07152 /* If this is a global variable, we want to output the misc 07153 record in the C++ misc record block. Otherwise, we want to 07154 output it just after the variable definition, which is where 07155 the current buffer is. */ 07156 if (refflag != 2) 07157 { 07158 if (! ieee_change_buffer (info, &info->cxx)) 07159 return false; 07160 } 07161 07162 if (! ieee_write_byte (info, (int) ieee_nn_record) 07163 || ! ieee_write_number (info, nindx) 07164 || ! ieee_write_id (info, "") 07165 || ! ieee_write_2bytes (info, (int) ieee_atn_record_enum) 07166 || ! ieee_write_number (info, nindx) 07167 || ! ieee_write_number (info, 0) 07168 || ! ieee_write_number (info, 62) 07169 || ! ieee_write_number (info, 80) 07170 || ! ieee_write_number (info, 3) 07171 || ! ieee_write_asn (info, nindx, 'R') 07172 || ! ieee_write_asn (info, nindx, refflag) 07173 || ! ieee_write_atn65 (info, nindx, name)) 07174 return false; 07175 } 07176 07177 return true; 07178 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static unsigned int ieee_vis_to_flags | ( | enum debug_visibility | visibility | ) | [static] |
Definition at line 5931 of file ieee.c.
References abort(), CXXFLAGS_VISIBILITY_PRIVATE, CXXFLAGS_VISIBILITY_PROTECTED, CXXFLAGS_VISIBILITY_PUBLIC, DEBUG_VISIBILITY_PRIVATE, DEBUG_VISIBILITY_PROTECTED, and DEBUG_VISIBILITY_PUBLIC.
Referenced by ieee_class_method_var(), ieee_class_static_member(), and ieee_struct_field().
05933 { 05934 switch (visibility) 05935 { 05936 default: 05937 abort (); 05938 case DEBUG_VISIBILITY_PUBLIC: 05939 return CXXFLAGS_VISIBILITY_PUBLIC; 05940 case DEBUG_VISIBILITY_PRIVATE: 05941 return CXXFLAGS_VISIBILITY_PRIVATE; 05942 case DEBUG_VISIBILITY_PROTECTED: 05943 return CXXFLAGS_VISIBILITY_PROTECTED; 05944 } 05945 /*NOTREACHED*/ 05946 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_void_type | ( | PTR | p | ) | [static] |
Definition at line 5274 of file ieee.c.
References builtin_void, ieee_push_type(), and info.
05276 { 05277 struct ieee_handle *info = (struct ieee_handle *) p; 05278 05279 return ieee_push_type (info, (int) builtin_void, 0, false, false); 05280 }
Here is the call graph for this function:

| static boolean ieee_volatile_type | ( | PTR | p | ) | [static] |
Definition at line 5891 of file ieee.c.
References ieee_define_type(), ieee_get_modified_info(), ieee_pop_type(), ieee_push_type(), ieee_write_number(), ieee_write_type::localp, NULL, ieee_write_type::size, ieee_type_stack::type, ieee_handle::type_stack, ieee_write_type::unsignedp, and ieee_modified_type::volatile_qualified.
05893 { 05894 struct ieee_handle *info = (struct ieee_handle *) p; 05895 unsigned int size; 05896 boolean unsignedp, localp; 05897 unsigned int indx; 05898 struct ieee_modified_type *m = NULL; 05899 05900 size = info->type_stack->type.size; 05901 unsignedp = info->type_stack->type.unsignedp; 05902 localp = info->type_stack->type.localp; 05903 indx = ieee_pop_type (info); 05904 05905 if (! localp) 05906 { 05907 m = ieee_get_modified_info (info, indx); 05908 if (m == NULL) 05909 return false; 05910 05911 if (m->volatile_qualified > 0) 05912 return ieee_push_type (info, m->volatile_qualified, size, unsignedp, 05913 false); 05914 } 05915 05916 if (! ieee_define_type (info, size, unsignedp, localp) 05917 || ! ieee_write_number (info, 'n') 05918 || ! ieee_write_number (info, 2) 05919 || ! ieee_write_number (info, indx)) 05920 return false; 05921 05922 if (! localp) 05923 m->volatile_qualified = info->type_stack->type.indx; 05924 05925 return true; 05926 }
Here is the call graph for this function:

| static boolean ieee_write_2bytes | ( | struct ieee_handle * | info, | |
| int | i | |||
| ) | [static] |
Definition at line 4193 of file ieee.c.
References ieee_write_byte.
Referenced by ieee_end_class_type(), ieee_lineno(), ieee_output_pending_parms(), ieee_start_function(), ieee_struct_field(), ieee_variable(), ieee_write_asn(), ieee_write_atn65(), and ieee_write_id().
04196 { 04197 return (ieee_write_byte (info, i >> 8) 04198 && ieee_write_byte (info, i & 0xff)); 04199 }
Here is the caller graph for this function:

| static boolean ieee_write_asn | ( | struct ieee_handle * | info, | |
| unsigned int | indx, | |||
| bfd_vma | val | |||
| ) | [static] |
Definition at line 4288 of file ieee.c.
References ieee_asn_record_enum, ieee_write_2bytes(), and ieee_write_number().
Referenced by ieee_class_baseclass(), ieee_class_method_var(), ieee_class_static_member(), ieee_end_class_type(), ieee_lineno(), ieee_output_pending_parms(), ieee_start_class_type(), ieee_start_function(), ieee_struct_field(), and ieee_variable().
04292 { 04293 return (ieee_write_2bytes (info, (int) ieee_asn_record_enum) 04294 && ieee_write_number (info, indx) 04295 && ieee_write_number (info, val)); 04296 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_write_atn65 | ( | struct ieee_handle * | info, | |
| unsigned int | indx, | |||
| const char * | s | |||
| ) | [static] |
Definition at line 4301 of file ieee.c.
References ieee_atn_record_enum, ieee_write_2bytes(), ieee_write_id(), and ieee_write_number().
Referenced by ieee_class_baseclass(), ieee_class_method_var(), ieee_class_static_member(), ieee_end_class_type(), ieee_output_pending_parms(), ieee_start_class_type(), ieee_start_function(), ieee_struct_field(), and ieee_variable().
04305 { 04306 return (ieee_write_2bytes (info, (int) ieee_atn_record_enum) 04307 && ieee_write_number (info, indx) 04308 && ieee_write_number (info, 0) 04309 && ieee_write_number (info, 65) 04310 && ieee_write_id (info, s)); 04311 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_write_id | ( | struct ieee_handle * | info, | |
| const char * | s | |||
| ) | [static] |
Definition at line 4248 of file ieee.c.
References ieee_extension_length_1_enum, ieee_extension_length_2_enum, ieee_write_2bytes(), ieee_write_byte, and strlen().
Referenced by ieee_add_bb11(), ieee_class_baseclass(), ieee_complex_type(), ieee_define_named_type(), ieee_end_class_type(), ieee_end_function(), ieee_end_struct_type(), ieee_finish_compilation_unit(), ieee_lineno(), ieee_output_pending_parms(), ieee_pop_type_used(), ieee_start_block(), ieee_start_compilation_unit(), ieee_start_function(), ieee_struct_field(), ieee_variable(), ieee_write_atn65(), ieee_write_undefined_tag(), and write_ieee_debugging_info().
04251 { 04252 unsigned int len; 04253 04254 len = strlen (s); 04255 if (len <= 0x7f) 04256 { 04257 if (! ieee_write_byte (info, len)) 04258 return false; 04259 } 04260 else if (len <= 0xff) 04261 { 04262 if (! ieee_write_byte (info, (int) ieee_extension_length_1_enum) 04263 || ! ieee_write_byte (info, len)) 04264 return false; 04265 } 04266 else if (len <= 0xffff) 04267 { 04268 if (! ieee_write_byte (info, (int) ieee_extension_length_2_enum) 04269 || ! ieee_write_2bytes (info, len)) 04270 return false; 04271 } 04272 else 04273 { 04274 fprintf (stderr, "IEEE string length overflow: %u\n", len); 04275 return false; 04276 } 04277 04278 for (; *s != '\0'; s++) 04279 if (! ieee_write_byte (info, *s)) 04280 return false; 04281 04282 return true; 04283 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_write_number | ( | struct ieee_handle * | info, | |
| bfd_vma | v | |||
| ) | [static] |
Definition at line 4204 of file ieee.c.
References ieee_buf::c, ieee_number_end_enum, ieee_number_repeat_end_enum, ieee_number_repeat_start_enum, ieee_write_byte, and p.
Referenced by ieee_add_bb11(), ieee_array_type(), ieee_class_baseclass(), ieee_complex_type(), ieee_const_type(), ieee_define_named_type(), ieee_end_block(), ieee_end_class_type(), ieee_end_function(), ieee_end_struct_type(), ieee_finish_compilation_unit(), ieee_function_parameter(), ieee_function_type(), ieee_lineno(), ieee_output_pending_parms(), ieee_pointer_type(), ieee_pop_type_used(), ieee_range_type(), ieee_set_type(), ieee_start_block(), ieee_start_compilation_unit(), ieee_start_function(), ieee_start_struct_type(), ieee_struct_field(), ieee_typdef(), ieee_variable(), ieee_volatile_type(), ieee_write_asn(), ieee_write_atn65(), ieee_write_undefined_tag(), and write_ieee_debugging_info().
04207 { 04208 bfd_vma t; 04209 bfd_byte ab[20]; 04210 bfd_byte *p; 04211 unsigned int c; 04212 04213 if (v <= (bfd_vma) ieee_number_end_enum) 04214 return ieee_write_byte (info, (int) v); 04215 04216 t = v; 04217 p = ab + sizeof ab; 04218 while (t != 0) 04219 { 04220 *--p = t & 0xff; 04221 t >>= 8; 04222 } 04223 c = (ab + 20) - p; 04224 04225 if (c > (unsigned int) (ieee_number_repeat_end_enum 04226 - ieee_number_repeat_start_enum)) 04227 { 04228 fprintf (stderr, "IEEE numeric overflow: 0x"); 04229 fprintf_vma (stderr, v); 04230 fprintf (stderr, "\n"); 04231 return false; 04232 } 04233 04234 if (! ieee_write_byte (info, (int) ieee_number_repeat_start_enum + c)) 04235 return false; 04236 for (; c > 0; --c, ++p) 04237 { 04238 if (! ieee_write_byte (info, *p)) 04239 return false; 04240 } 04241 04242 return true; 04243 }
Here is the caller graph for this function:

| static boolean ieee_write_undefined_tag | ( | struct ieee_name_type_hash_entry * | h, | |
| PTR | p | |||
| ) | [static] |
Definition at line 4834 of file ieee.c.
References abort(), DEBUG_KIND_CLASS, DEBUG_KIND_ENUM, DEBUG_KIND_ILLEGAL, DEBUG_KIND_STRUCT, DEBUG_KIND_UNION, DEBUG_KIND_UNION_CLASS, ieee_handle::global_types, ieee_bb_record_enum, ieee_buffer_emptyp, ieee_change_buffer(), ieee_nn_record, ieee_ty_record_enum, ieee_write_byte, ieee_write_id(), ieee_write_number(), ieee_write_type::indx, info, ieee_name_type::kind, ieee_write_type::name, ieee_handle::name_indx, ieee_name_type::next, NULL, and ieee_name_type::type.
Referenced by write_ieee_debugging_info().
04837 { 04838 struct ieee_handle *info = (struct ieee_handle *) p; 04839 struct ieee_name_type *nt; 04840 04841 for (nt = h->types; nt != NULL; nt = nt->next) 04842 { 04843 unsigned int name_indx; 04844 char code; 04845 04846 if (nt->kind == DEBUG_KIND_ILLEGAL) 04847 continue; 04848 04849 if (ieee_buffer_emptyp (&info->global_types)) 04850 { 04851 if (! ieee_change_buffer (info, &info->global_types) 04852 || ! ieee_write_byte (info, (int) ieee_bb_record_enum) 04853 || ! ieee_write_byte (info, 2) 04854 || ! ieee_write_number (info, 0) 04855 || ! ieee_write_id (info, "")) 04856 { 04857 info->error = true; 04858 return false; 04859 } 04860 } 04861 else 04862 { 04863 if (! ieee_change_buffer (info, &info->global_types)) 04864 { 04865 info->error = true; 04866 return false; 04867 } 04868 } 04869 04870 name_indx = info->name_indx; 04871 ++info->name_indx; 04872 if (! ieee_write_byte (info, (int) ieee_nn_record) 04873 || ! ieee_write_number (info, name_indx) 04874 || ! ieee_write_id (info, nt->type.name) 04875 || ! ieee_write_byte (info, (int) ieee_ty_record_enum) 04876 || ! ieee_write_number (info, nt->type.indx) 04877 || ! ieee_write_byte (info, 0xce) 04878 || ! ieee_write_number (info, name_indx)) 04879 { 04880 info->error = true; 04881 return false; 04882 } 04883 04884 switch (nt->kind) 04885 { 04886 default: 04887 abort (); 04888 info->error = true; 04889 return false; 04890 case DEBUG_KIND_STRUCT: 04891 case DEBUG_KIND_CLASS: 04892 code = 'S'; 04893 break; 04894 case DEBUG_KIND_UNION: 04895 case DEBUG_KIND_UNION_CLASS: 04896 code = 'U'; 04897 break; 04898 case DEBUG_KIND_ENUM: 04899 code = 'E'; 04900 break; 04901 } 04902 if (! ieee_write_number (info, code) 04903 || ! ieee_write_number (info, 0)) 04904 { 04905 info->error = true; 04906 return false; 04907 } 04908 } 04909 04910 return true; 04911 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static boolean ieee_lineno PARAMS | ( | (PTR, const char *, unsigned long, bfd_vma) | ) | [static] |
| static boolean ieee_start_block PARAMS | ( | (PTR, bfd_vma) | ) | [static] |
| static boolean ieee_function_parameter PARAMS | ( | (PTR, const char *, enum debug_parm_kind, bfd_vma) | ) | [static] |
| static boolean ieee_start_function PARAMS | ( | (PTR, const char *, boolean) | ) | [static] |
| static boolean ieee_variable PARAMS | ( | (PTR, const char *, enum debug_var_kind, bfd_vma) | ) | [static] |
| static boolean ieee_float_constant PARAMS | ( | (PTR, const char *, double) | ) | [static] |
| static boolean ieee_int_constant PARAMS | ( | (PTR, const char *, bfd_vma) | ) | [static] |
| static boolean ieee_tag_type PARAMS | ( | (PTR, const char *, unsigned int, enum debug_type_kind) | ) | [static] |
| static boolean ieee_class_static_method_variant PARAMS | ( | (PTR, const char *, enum debug_visibility, boolean, boolean) | ) | [static] |
| static boolean ieee_class_method_variant PARAMS | ( | (PTR, const char *, enum debug_visibility, boolean, boolean, bfd_vma, boolean) | ) | [static] |
| static boolean ieee_class_baseclass PARAMS | ( | (PTR, bfd_vma, boolean, enum debug_visibility) | ) | [static] |
| static boolean ieee_class_static_member PARAMS | ( | (PTR, const char *, const char *, enum debug_visibility) | ) | [static] |
| static boolean ieee_start_class_type PARAMS | ( | (PTR, const char *, unsigned int, boolean, unsigned int, boolean, boolean) | ) | [static] |
| static boolean ieee_struct_field PARAMS | ( | (PTR, const char *, bfd_vma, bfd_vma, enum debug_visibility) | ) | [static] |
| static boolean ieee_start_struct_type PARAMS | ( | (PTR, const char *, unsigned int, boolean, unsigned int) | ) | [static] |
| static boolean ieee_method_type PARAMS | ( | (PTR, boolean, int, boolean) | ) | [static] |
| static boolean ieee_set_type PARAMS | ( | (PTR, boolean) | ) | [static] |
| static boolean ieee_array_type PARAMS | ( | (PTR, bfd_signed_vma, bfd_signed_vma, boolean) | ) | [static] |
| static boolean ieee_range_type PARAMS | ( | (PTR, bfd_signed_vma, bfd_signed_vma) | ) | [static] |
| static boolean ieee_function_type PARAMS | ( | (PTR, int, boolean) | ) | [static] |
| static boolean ieee_enum_type PARAMS | ( | (PTR, const char *, const char **, bfd_signed_vma *) | ) | [static] |
| static boolean ieee_float_type PARAMS | ( | (PTR, unsigned int) | ) | [static] |
| static boolean ieee_int_type PARAMS | ( | (PTR, unsigned int, boolean) | ) | [static] |
| static boolean ieee_empty_type PARAMS | ( | (PTR) | ) | [static] |
| static boolean ieee_start_compilation_unit PARAMS | ( | (PTR, const char *) | ) | [static] |
| static boolean ieee_class_method_var PARAMS | ( | (struct ieee_handle *, const char *, enum debug_visibility, boolean, boolean, boolean, bfd_vma, boolean) | ) | [static] |
| static unsigned int ieee_vis_to_flags PARAMS | ( | (enum debug_visibility) | ) | [static] |
| static boolean ieee_add_bb11 PARAMS | ( | (struct ieee_handle *, asection *, bfd_vma, bfd_vma) | ) | [static] |
| static void ieee_add_bb11_blocks PARAMS | ( | (bfd *, asection *, PTR) | ) | [static] |
| static boolean ieee_write_undefined_tag PARAMS | ( | (struct ieee_name_type_hash_entry *, PTR) | ) | [static] |
| static struct bfd_hash_entry* ieee_name_type_newfunc PARAMS | ( | (struct bfd_hash_entry *, struct bfd_hash_table *, const char *) | ) | [static] |
| static struct ieee_modified_type* ieee_get_modified_info PARAMS | ( | (struct ieee_handle *, unsigned int) | ) | [static] |
| static boolean ieee_define_named_type PARAMS | ( | (struct ieee_handle *, const char *, unsigned int, unsigned int, boolean, boolean, struct ieee_buflist *) | ) | [static] |
| static boolean ieee_define_type PARAMS | ( | (struct ieee_handle *, unsigned int, boolean, boolean) | ) | [static] |
| static boolean ieee_add_range PARAMS | ( | (struct ieee_handle *, boolean, bfd_vma, bfd_vma) | ) | [static] |
| static unsigned int ieee_pop_type_used PARAMS | ( | (struct ieee_handle *, boolean) | ) | [static] |
| static unsigned int ieee_pop_type PARAMS | ( | (struct ieee_handle *) | ) | [static] |
| static boolean ieee_push_type PARAMS | ( | (struct ieee_handle *, unsigned int, unsigned int, boolean, boolean) | ) | [static] |
| static boolean ieee_write_atn65 PARAMS | ( | (struct ieee_handle *, unsigned int, const char *) | ) | [static] |
| static boolean ieee_write_asn PARAMS | ( | (struct ieee_handle *, unsigned int, bfd_vma) | ) | [static] |
| static boolean ieee_write_id PARAMS | ( | (struct ieee_handle *, const char *) | ) | [static] |
| static boolean ieee_write_number PARAMS | ( | (struct ieee_handle *, bfd_vma) | ) | [static] |
| static boolean ieee_real_write_byte PARAMS | ( | (struct ieee_handle *, int) | ) | [static] |
| static boolean ieee_append_buffer PARAMS | ( | (struct ieee_handle *, struct ieee_buflist *, struct ieee_buflist *) | ) | [static] |
| static boolean ieee_init_buffer PARAMS | ( | (struct ieee_handle *, struct ieee_buflist *) | ) | [static] |
| static boolean ieee_read_cxx_misc PARAMS | ( | (struct ieee_info *, const bfd_byte **, unsigned long) | ) | [static] |
| static boolean parse_ieee_bb PARAMS | ( | (struct ieee_info *, const bfd_byte **) | ) | [static] |
| static int ieee_regno_to_genreg PARAMS | ( | (bfd *, int) | ) | [static] |
| static boolean ieee_read_type_index PARAMS | ( | (struct ieee_info *, const bfd_byte **, debug_type *) | ) | [static] |
| static boolean ieee_alloc_type PARAMS | ( | (struct ieee_info *, unsigned int, boolean) | ) | [static] |
| static debug_type ieee_builtin_type PARAMS | ( | (struct ieee_info *, const bfd_byte *, unsigned int) | ) | [static] |
| static boolean ieee_read_optional_id PARAMS | ( | (struct ieee_info *, const bfd_byte **, const char **, unsigned long *, boolean *) | ) | [static] |
| static boolean ieee_read_id PARAMS | ( | (struct ieee_info *, const bfd_byte **, const char **, unsigned long *) | ) | [static] |
| static boolean ieee_read_optional_number PARAMS | ( | (struct ieee_info *, const bfd_byte **, bfd_vma *, boolean *) | ) | [static] |
| static boolean ieee_read_number PARAMS | ( | (struct ieee_info *, const bfd_byte **, bfd_vma *) | ) | [static] |
| static char* savestring PARAMS | ( | (const char *, unsigned long) | ) | [static] |
| static void ieee_eof PARAMS | ( | (struct ieee_info *) | ) | [static] |
| static void ieee_error PARAMS | ( | (struct ieee_info *, const bfd_byte *, const char *) | ) | [static] |
| boolean parse_ieee | ( | PTR | dhandle, | |
| bfd * | abfd, | |||
| const bfd_byte * | bytes, | |||
| bfd_size_type | len | |||
| ) |
Definition at line 885 of file ieee.c.
References ieee_info::abfd, ieee_types::alloc, ieee_vars::alloc, ieee_info::blockstack, ieee_blockstack::bsp, BUILTIN_TYPE_COUNT, ieee_types::builtins, ieee_info::bytes, DEBUG_TYPE_NULL, ieee_info::dhandle, ieee_at_record_enum, ieee_atn_record_enum, ieee_bb_record_enum, ieee_be_record_enum, ieee_error(), ieee_nn_record, ieee_number_repeat_end_enum, ieee_ty_record_enum, NULL, p, parse_ieee_atn(), parse_ieee_bb(), parse_ieee_be(), parse_ieee_nn(), parse_ieee_ty(), ieee_info::pend, ieee_info::saw_filename, ieee_blockstack::stack, ieee_info::tags, ieee_types::types, ieee_info::types, ieee_vars::vars, and ieee_info::vars.
Referenced by read_ieee_debugging_info().
00890 { 00891 struct ieee_info info; 00892 unsigned int i; 00893 const bfd_byte *p, *pend; 00894 00895 info.dhandle = dhandle; 00896 info.abfd = abfd; 00897 info.bytes = bytes; 00898 info.pend = bytes + len; 00899 info.blockstack.bsp = info.blockstack.stack; 00900 info.saw_filename = false; 00901 info.vars.alloc = 0; 00902 info.vars.vars = NULL; 00903 info.types.alloc = 0; 00904 info.types.types = NULL; 00905 info.tags = NULL; 00906 for (i = 0; i < BUILTIN_TYPE_COUNT; i++) 00907 info.types.builtins[i] = DEBUG_TYPE_NULL; 00908 00909 p = bytes; 00910 pend = info.

