GDB (xrefs)
Classes | Defines | Functions | Variables
/home/stan/gdb/src/gdb/stabsread.c File Reference
#include "defs.h"
#include "gdb_string.h"
#include "bfd.h"
#include "gdb_obstack.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "expression.h"
#include "symfile.h"
#include "objfiles.h"
#include "aout/stab_gnu.h"
#include "libaout.h"
#include "aout/aout64.h"
#include "gdb-stabs.h"
#include "buildsym.h"
#include "complaints.h"
#include "demangle.h"
#include "gdb-demangle.h"
#include "language.h"
#include "doublest.h"
#include "cp-abi.h"
#include "cp-support.h"
#include "gdb_assert.h"
#include <ctype.h>
#include "stabsread.h"

Go to the source code of this file.

Classes

struct  field_info
struct  field_info::nextfield
struct  field_info::next_fnfieldlist
struct  nat
struct  ref_map

Defines

#define EXTERN
#define STABS_CONTINUE(pp, objfile)
#define INITIAL_TYPE_VECTOR_LENGTH   160
#define VISIBILITY_PRIVATE   '0' /* Stabs character for private field */
#define VISIBILITY_PROTECTED   '1' /* Stabs character for protected fld */
#define VISIBILITY_PUBLIC   '2' /* Stabs character for public field */
#define VISIBILITY_IGNORE   '9' /* Optimized out or zero length */
#define MAX_CHUNK_REFS   100
#define REF_CHUNK_SIZE   (MAX_CHUNK_REFS * sizeof (struct ref_map))
#define REF_MAP_SIZE(ref_chunk)   ((ref_chunk) * REF_CHUNK_SIZE)
#define NUMBER_RECOGNIZED   34

Functions

void _initialize_stabsread (void)
static void read_one_struct_field (struct field_info *, char **, char *, struct type *, struct objfile *)
static struct typedbx_alloc_type (int[2], struct objfile *)
static long read_huge_number (char **, int, int *, int)
static struct typeerror_type (char **, struct objfile *)
static void patch_block_stabs (struct pending *, struct pending_stabs *, struct objfile *)
static void fix_common_block (struct symbol *, CORE_ADDR)
static int read_type_number (char **, int *)
static struct typeread_type (char **, struct objfile *)
static struct typeread_range_type (char **, int[2], int, struct objfile *)
static struct typeread_sun_builtin_type (char **, int[2], struct objfile *)
static struct typeread_sun_floating_type (char **, int[2], struct objfile *)
static struct typeread_enum_type (char **, struct type *, struct objfile *)
static struct typers6000_builtin_type (int, struct objfile *)
static int read_member_functions (struct field_info *, char **, struct type *, struct objfile *)
static int read_struct_fields (struct field_info *, char **, struct type *, struct objfile *)
static int read_baseclasses (struct field_info *, char **, struct type *, struct objfile *)
static int read_tilde_fields (struct field_info *, char **, struct type *, struct objfile *)
static int attach_fn_fields_to_type (struct field_info *, struct type *)
static int attach_fields_to_type (struct field_info *, struct type *, struct objfile *)
static struct typeread_struct_type (char **, struct type *, enum type_code, struct objfile *)
static struct typeread_array_type (char **, struct type *, struct objfile *)
static struct field * read_args (char **, int, struct objfile *, int *, int *)
static void add_undefined_type (struct type *, int[2])
static int read_cpp_abbrev (struct field_info *, char **, struct type *, struct objfile *)
static char * find_name_end (char *name)
static int process_reference (char **string)
void stabsread_clear_cache (void)
static void invalid_cpp_abbrev_complaint (const char *arg1)
static void reg_value_complaint (int regnum, int num_regs, const char *sym)
static void stabs_general_complaint (const char *arg1)
static struct type ** dbx_lookup_type (int typenums[2], struct objfile *objfile)
void ref_add (int refnum, struct symbol *sym, char *stabs, CORE_ADDR value)
struct symbolref_search (int refnum)
int symbol_reference_defined (char **string)
static int stab_reg_to_regnum (struct symbol *sym, struct gdbarch *gdbarch)
struct symboldefine_symbol (CORE_ADDR valu, char *string, int desc, int type, struct objfile *objfile)
static char * stabs_method_name_from_physname (const char *physname)
static void complain_about_struct_wipeout (struct type *type)
static void set_length_in_type_chain (struct type *type)
void common_block_start (char *name, struct objfile *objfile)
void common_block_end (struct objfile *objfile)
static void add_undefined_type_noname (struct type *type, int typenums[2])
static void add_undefined_type_1 (struct type *type)
static void cleanup_undefined_types_noname (struct objfile *objfile)
static void cleanup_undefined_types_1 (void)
void cleanup_undefined_stabs_types (struct objfile *objfile)
void scan_file_globals (struct objfile *objfile)
void stabsread_init (void)
void stabsread_new_init (void)
void start_stabs (void)
void end_stabs (void)
void finish_global_stabs (struct objfile *objfile)

Variables

static const char vptr_name [] = "_vptr$"
static const char vb_name [] = "_vb$"
static struct type ** undef_types
static int undef_types_allocated
static int undef_types_length
static struct symbolcurrent_symbol = NULL
static struct natnoname_undefs
static int noname_undefs_allocated
static int noname_undefs_length
static struct type ** type_vector
static int type_vector_length
static struct ref_mapref_map
static int ref_count = 0
static int ref_chunk = 0
static struct symbol_register_ops stab_register_funcs
static int stab_register_index
static int stab_regparm_index
static struct objfile_data * rs6000_builtin_type_data
static struct pendingcommon_block
static int common_block_i
static char * common_block_name

Define Documentation

#define EXTERN

Definition at line 52 of file stabsread.c.

#define INITIAL_TYPE_VECTOR_LENGTH   160

Definition at line 226 of file stabsread.c.

Referenced by dbx_lookup_type().

#define MAX_CHUNK_REFS   100

Definition at line 487 of file stabsread.c.

Referenced by ref_add().

#define NUMBER_RECOGNIZED   34

Referenced by rs6000_builtin_type().

#define REF_CHUNK_SIZE   (MAX_CHUNK_REFS * sizeof (struct ref_map))

Definition at line 488 of file stabsread.c.

Referenced by ref_add().

#define REF_MAP_SIZE (   ref_chunk)    ((ref_chunk) * REF_CHUNK_SIZE)

Definition at line 489 of file stabsread.c.

Referenced by ref_add().

#define STABS_CONTINUE (   pp,
  objfile 
)
Value:
do {                                                    \
    if (**(pp) == '\\' || (**(pp) == '?' && (*(pp))[1] == '\0')) \
      *(pp) = next_symbol_text (objfile);       \
  } while (0)

Definition at line 205 of file stabsread.c.

Referenced by read_args(), read_baseclasses(), read_enum_type(), read_member_functions(), read_struct_fields(), and read_tilde_fields().

#define VISIBILITY_IGNORE   '9' /* Optimized out or zero length */

Definition at line 475 of file stabsread.c.

Referenced by attach_fields_to_type(), and read_one_struct_field().

#define VISIBILITY_PRIVATE   '0' /* Stabs character for private field */
#define VISIBILITY_PROTECTED   '1' /* Stabs character for protected fld */

Definition at line 473 of file stabsread.c.

Referenced by attach_fields_to_type(), read_baseclasses(), and read_member_functions().

#define VISIBILITY_PUBLIC   '2' /* Stabs character for public field */

Definition at line 474 of file stabsread.c.

Referenced by attach_fields_to_type(), read_baseclasses(), and read_one_struct_field().


Function Documentation

void _initialize_stabsread ( void  )
static void add_undefined_type ( struct type type,
int  typenums[2] 
) [static]

Definition at line 4464 of file stabsread.c.

References add_undefined_type_1(), add_undefined_type_noname(), and TYPE_TAG_NAME.

Referenced by read_type().

static void add_undefined_type_1 ( struct type type) [static]

Definition at line 4438 of file stabsread.c.

References type, undef_types, undef_types_allocated, undef_types_length, and xrealloc().

Referenced by add_undefined_type().

static void add_undefined_type_noname ( struct type type,
int  typenums[2] 
) [static]
static int attach_fields_to_type ( struct field_info fip,
struct type type,
struct objfile objfile 
) [static]
static int attach_fn_fields_to_type ( struct field_info fip,
struct type type 
) [static]
void cleanup_undefined_stabs_types ( struct objfile objfile)
static void cleanup_undefined_types_1 ( void  ) [static]
static void cleanup_undefined_types_noname ( struct objfile objfile) [static]
void common_block_end ( struct objfile objfile)
void common_block_start ( char *  name,
struct objfile objfile 
)
static void complain_about_struct_wipeout ( struct type type) [static]
static struct type * dbx_alloc_type ( int  typenums[2],
struct objfile objfile 
) [static, read]

Definition at line 336 of file stabsread.c.

References alloc_type(), and dbx_lookup_type().

Referenced by read_type().

static struct type** dbx_lookup_type ( int  typenums[2],
struct objfile objfile 
) [static, read]
struct symbol* define_symbol ( CORE_ADDR  valu,
char *  string,
int  desc,
int  type,
struct objfile objfile 
) [read]

Definition at line 626 of file stabsread.c.

References _, add_symbol_to_list(), allocate_symbol(), atof(), objfile_type::builtin_char, objfile_type::builtin_double, objfile_type::builtin_int, objfile_type::builtin_long, objfile_type::builtin_unsigned_int, complaint(), cp_canonicalize_string(), cp_scan_for_anonymous_namespaces(), create_array_type(), create_range_type(), current_subfile, error_type(), file_symbols, find_name_end(), gdbarch_believe_pcc_promotion(), gdbarch_byte_order(), gdbarch_int_bit(), gdbarch_stabs_argument_has_addr(), gdbarch_static_transform_name(), gdbarch_static_transform_name_p(), get_objfile_arch(), global_sym_chain, global_symbols, hashname(), is_cplus_marker(), subfile::language, language_ada, language_cplus, language_pascal, LOC_ARG, LOC_BLOCK, LOC_CONST, LOC_CONST_BYTES, LOC_LABEL, LOC_LOCAL, LOC_REF_ARG, LOC_REGISTER, LOC_REGPARM_ADDR, LOC_STATIC, LOC_TYPEDEF, local_symbols, lookup_function_type(), lookup_minimal_symbol(), lookup_pointer_type(), memcpy(), name, pending::nsyms, obconcat(), objfile::objfile_obstack, objfile_type(), p, processing_gcc_compilation, read_type(), stab_register_index, stab_regparm_index, store_typed_floating(), strchr(), string, STRUCT_DOMAIN, pending::symbol, SYMBOL_ACLASS_INDEX, SYMBOL_CLASS, SYMBOL_DOMAIN, SYMBOL_IS_ARGUMENT, SYMBOL_LANGUAGE, SYMBOL_LINE, SYMBOL_LINKAGE_NAME, SYMBOL_SET_LANGUAGE, SYMBOL_SET_LINKAGE_NAME, SYMBOL_SET_NAMES, SYMBOL_TYPE, SYMBOL_VALUE, SYMBOL_VALUE_ADDRESS, SYMBOL_VALUE_BYTES, SYMBOL_VALUE_CHAIN, symfile_complaints, TYPE_ALLOC, TYPE_BASECLASS, TYPE_BASECLASS_NAME, TYPE_CODE, TYPE_CODE_FUNC, TYPE_CODE_INT, TYPE_CODE_PTR, TYPE_CODE_STRUCT, TYPE_CODE_UNION, TYPE_CODE_VOID, TYPE_FIELD_ARTIFICIAL, TYPE_FIELD_TYPE, TYPE_FIELDS, TYPE_LENGTH, TYPE_N_BASECLASSES, TYPE_NAME, type_name_no_tag(), TYPE_NFIELDS, TYPE_PROTOTYPED, TYPE_TAG_NAME, TYPE_UNSIGNED, VAR_DOMAIN, vtbl_ptr_name, within_function, and xfree().

Referenced by process_one_symbol(), process_xcoff_symbol(), and read_xcoff_symtab().

void end_stabs ( void  )
static struct type * error_type ( char **  pp,
struct objfile objfile 
) [static, read]
static char * find_name_end ( char *  name) [static]

Definition at line 4805 of file stabsread.c.

References _, error(), name, and strchr().

Referenced by define_symbol().

void finish_global_stabs ( struct objfile objfile)

Definition at line 4792 of file stabsread.c.

References global_stabs, global_symbols, patch_block_stabs(), and xfree().

Referenced by end_symtab_get_static_block().

static void fix_common_block ( struct symbol sym,
CORE_ADDR  valu 
) [static]

Definition at line 4397 of file stabsread.c.

References pending::next, pending::nsyms, pending::symbol, SYMBOL_TYPE, and SYMBOL_VALUE_ADDRESS.

Referenced by scan_file_globals().

static void invalid_cpp_abbrev_complaint ( const char *  arg1) [static]

Definition at line 164 of file stabsread.c.

References _, complaint(), and symfile_complaints.

Referenced by read_cpp_abbrev().

static void patch_block_stabs ( struct pending symbols,
struct pending_stabs stabs,
struct objfile objfile 
) [static]
static int process_reference ( char **  string) [static]

Definition at line 549 of file stabsread.c.

References p.

Referenced by symbol_reference_defined().

static struct field * read_args ( char **  pp,
int  end,
struct objfile objfile,
int nargsp,
int varargsp 
) [static, read]
static struct type * read_array_type ( char **  pp,
struct type type,
struct objfile objfile 
) [static, read]

Definition at line 3567 of file stabsread.c.

References create_array_type(), create_range_type(), error_type(), read_huge_number(), read_type(), and type.

Referenced by read_type().

static int read_baseclasses ( struct field_info fip,
char **  pp,
struct type type,
struct objfile objfile 
) [static]
static int read_cpp_abbrev ( struct field_info fip,
char **  pp,
struct type type,
struct objfile objfile 
) [static]
static struct type * read_enum_type ( char **  pp,
struct type type,
struct objfile objfile 
) [static, read]
static long read_huge_number ( char **  pp,
int  end,
int bits,
int  twos_complement_bits 
) [static]
static int read_member_functions ( struct field_info fip,
char **  pp,
struct type type,
struct objfile objfile 
) [static]
static void read_one_struct_field ( struct field_info fip,
char **  pp,
char *  p,
struct type type,
struct objfile objfile 
) [static]
static struct type * read_range_type ( char **  pp,
int  typenums[2],
int  type_size,
struct objfile objfile 
) [static, read]
static int read_struct_fields ( struct field_info fip,
char **  pp,
struct type type,
struct objfile objfile 
) [static]
static struct type* read_struct_type ( char **  pp,
struct type type,
enum type_code type_code  ,
struct objfile objfile 
) [static, read]

Referenced by read_type().

static struct type * read_sun_builtin_type ( char **  pp,
int  typenums[2],
struct objfile objfile 
) [static, read]
static struct type * read_sun_floating_type ( char **  pp,
int  typenums[2],
struct objfile objfile 
) [static, read]
static int read_tilde_fields ( struct field_info fip,
char **  pp,
struct type type,
struct objfile objfile 
) [static]
static struct type * read_type ( char **  pp,
struct objfile objfile 
) [static, read]
static int read_type_number ( char **  pp,
int typenums 
) [static]

Definition at line 447 of file stabsread.c.

References read_huge_number().

Referenced by read_range_type(), and read_type().

void ref_add ( int  refnum,
struct symbol sym,
char *  stabs,
CORE_ADDR  value 
)
struct symbol* ref_search ( int  refnum) [read]

Definition at line 538 of file stabsread.c.

References ref_count, and ref_map::sym.

Referenced by process_one_symbol().

static void reg_value_complaint ( int  regnum,
int  num_regs,
const char *  sym 
) [static]

Definition at line 170 of file stabsread.c.

References _, complaint(), and symfile_complaints.

Referenced by stab_reg_to_regnum().

static struct type * rs6000_builtin_type ( int  typenum,
struct objfile objfile 
) [static, read]
void scan_file_globals ( struct objfile objfile)
static void set_length_in_type_chain ( struct type type) [static]

Definition at line 3464 of file stabsread.c.

References complain_about_struct_wipeout(), TYPE_CHAIN, and TYPE_LENGTH.

Referenced by read_enum_type().

static int stab_reg_to_regnum ( struct symbol sym,
struct gdbarch gdbarch 
) [static]
static void stabs_general_complaint ( const char *  arg1) [static]

Definition at line 178 of file stabsread.c.

References complaint(), and symfile_complaints.

Referenced by read_one_struct_field().

static char* stabs_method_name_from_physname ( const char *  physname) [static]

Definition at line 2235 of file stabsread.c.

References _, complaint(), method_name_from_physname(), and symfile_complaints.

Referenced by read_member_functions().

void stabsread_clear_cache ( void  )

Definition at line 503 of file stabsread.c.

References ref_chunk, and ref_count.

Referenced by coff_symfile_finish().

void stabsread_init ( void  )

Definition at line 4746 of file stabsread.c.

Referenced by dbx_psymtab_to_symtab_1(), and xcoff_psymtab_to_symtab_1().

void stabsread_new_init ( void  )
void start_stabs ( void  )

Definition at line 4765 of file stabsread.c.

References global_stabs, n_this_object_header_files, and type_vector_length.

Referenced by process_one_symbol(), and read_xcoff_symtab().

int symbol_reference_defined ( char **  string)

Definition at line 574 of file stabsread.c.

References p, process_reference(), and string.

Referenced by process_one_symbol().


Variable Documentation

struct pending* common_block [static]

Definition at line 4310 of file stabsread.c.

Referenced by common_block_end(), and read_common_block().

int common_block_i [static]

Definition at line 4311 of file stabsread.c.

char* common_block_name [static]

Definition at line 4316 of file stabsread.c.

struct symbol* current_symbol = NULL [static]

Definition at line 188 of file stabsread.c.

struct nat* noname_undefs [static]

Definition at line 200 of file stabsread.c.

Referenced by add_undefined_type_noname().

Definition at line 201 of file stabsread.c.

Referenced by add_undefined_type_noname().

Definition at line 202 of file stabsread.c.

Referenced by add_undefined_type_noname(), and cleanup_undefined_types_noname().

int ref_chunk = 0 [static]

Definition at line 497 of file stabsread.c.

Referenced by ref_add(), and stabsread_clear_cache().

int ref_count = 0 [static]

Definition at line 494 of file stabsread.c.

Referenced by ref_add(), ref_search(), and stabsread_clear_cache().

struct ref_map* ref_map [static]

Definition at line 491 of file stabsread.c.

struct objfile_data* rs6000_builtin_type_data [static]

Definition at line 2054 of file stabsread.c.

Referenced by rs6000_builtin_type().

Initial value:

Definition at line 616 of file stabsread.c.

Definition at line 622 of file stabsread.c.

Referenced by define_symbol().

Definition at line 623 of file stabsread.c.

Referenced by define_symbol().

struct type** type_vector [static]

Definition at line 217 of file stabsread.c.

Referenced by dbx_lookup_type().

Definition at line 221 of file stabsread.c.

Referenced by dbx_lookup_type(), end_stabs(), and start_stabs().

struct type** undef_types [static]

Definition at line 185 of file stabsread.c.

Referenced by add_undefined_type_1().

Definition at line 186 of file stabsread.c.

Referenced by add_undefined_type_1().

Definition at line 187 of file stabsread.c.

Referenced by add_undefined_type_1(), and cleanup_undefined_types_1().

const char vb_name[] = "_vb$" [static]

Definition at line 161 of file stabsread.c.

Referenced by read_cpp_abbrev().

const char vptr_name[] = "_vptr$" [static]

Definition at line 160 of file stabsread.c.

Referenced by read_cpp_abbrev(), and read_tilde_fields().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines