GDB (xrefs)
Classes | Defines | Functions | Variables
/home/stan/gdb/src/gdb/coffread.c File Reference
#include "defs.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "demangle.h"
#include "breakpoint.h"
#include "bfd.h"
#include "gdb_obstack.h"
#include "gdb_string.h"
#include <ctype.h>
#include "coff/internal.h"
#include "libcoff.h"
#include "objfiles.h"
#include "buildsym.h"
#include "gdb-stabs.h"
#include "stabsread.h"
#include "complaints.h"
#include "target.h"
#include "gdb_assert.h"
#include "block.h"
#include "dictionary.h"
#include "coff-pe-read.h"
#include "psymtab.h"

Go to the source code of this file.

Classes

struct  coff_symfile_info
struct  coff_symbol
struct  find_targ_sec_arg

Defines

#define EXTERNAL_NAME(string, abfd)
#define SDB_TYPE(type)   (BTYPE(type) | (type & N_TMASK))
#define N_BTMASK   local_n_btmask
#define N_BTSHFT   local_n_btshft
#define N_TMASK   local_n_tmask
#define N_TSHIFT   local_n_tshift
#define INITIAL_TYPE_VECTOR_LENGTH   160
#define L_LNNO32(lp)   ((lp)->l_lnno)

Functions

void _initialize_coffread (void)
void stabsread_clear_cache (void)
static struct typecoff_read_struct_type (int, int, int, struct objfile *)
static struct typedecode_base_type (struct coff_symbol *, unsigned int, union internal_auxent *, struct objfile *)
static struct typedecode_type (struct coff_symbol *, unsigned int, union internal_auxent *, struct objfile *)
static struct typedecode_function_type (struct coff_symbol *, unsigned int, union internal_auxent *, struct objfile *)
static struct typecoff_read_enum_type (int, int, int, struct objfile *)
static struct symbolprocess_coff_symbol (struct coff_symbol *, union internal_auxent *, struct objfile *)
static void patch_opaque_types (struct symtab *)
static void enter_linenos (long, int, int, struct objfile *)
static void free_linetab (void)
static void free_linetab_cleanup (void *ignore)
static int init_lineno (bfd *, long, int)
static char * getsymname (struct internal_syment *)
static const char * coff_getfilename (union internal_auxent *)
static void free_stringtab (void)
static void free_stringtab_cleanup (void *ignore)
static int init_stringtab (bfd *, long)
static void read_one_sym (struct coff_symbol *, struct internal_syment *, union internal_auxent *)
static void coff_symtab_read (long, unsigned int, struct objfile *)
static void coff_locate_sections (bfd *abfd, asection *sectp, void *csip)
static int cs_to_section (struct coff_symbol *, struct objfile *)
static void find_targ_sec (bfd *abfd, asection *sect, void *obj)
static struct bfd_section * cs_to_bfd_section (struct coff_symbol *cs, struct objfile *objfile)
static CORE_ADDR cs_section_address (struct coff_symbol *, bfd *)
static struct type ** coff_lookup_type (int index)
static struct typecoff_alloc_type (int index)
static void coff_start_symtab (const char *name)
static void complete_symtab (const char *name, CORE_ADDR start_addr, unsigned int size)
static void coff_end_symtab (struct objfile *objfile)
static int is_import_fixup_symbol (struct coff_symbol *cs, enum minimal_symbol_type type)
static struct minimal_symbolrecord_minimal_symbol (struct coff_symbol *cs, CORE_ADDR address, enum minimal_symbol_type type, int section, struct objfile *objfile)
static void coff_symfile_init (struct objfile *objfile)
static void find_linenos (bfd *abfd, struct bfd_section *asect, void *vpinfo)
static void coff_symfile_read (struct objfile *objfile, int symfile_flags)
static void coff_new_init (struct objfile *ignore)
static void coff_symfile_finish (struct objfile *objfile)
static void patch_type (struct type *type, struct type *real_type)
static int coff_reg_to_regnum (struct symbol *sym, struct gdbarch *gdbarch)
static void coff_free_info (struct objfile *objfile, void *arg)

Variables

static struct objfile_data * coff_objfile_data_key
static struct objfilecoffread_objfile
static CORE_ADDR current_source_start_addr
static CORE_ADDR current_source_end_addr
static bfd * nlist_bfd_global
static int nlist_nsyms_global
static char * temp_sym
static char * temp_aux
static unsigned local_n_btmask
static unsigned local_n_btshft
static unsigned local_n_tmask
static unsigned local_n_tshift
static unsigned local_linesz
static unsigned local_symesz
static unsigned local_auxesz
static int pe_file
static struct symbolopaque_type_chain [HASHSIZE]
static struct type ** type_vector
static int type_vector_length
static bfd * symfile_bfd
static char * stringtab = NULL
static char * linetab = NULL
static long linetab_offset
static unsigned long linetab_size
static struct symbol_register_ops coff_register_funcs
static int coff_register_index
static struct sym_fns coff_sym_fns

Define Documentation

#define EXTERNAL_NAME (   string,
  abfd 
)
Value:
(string[0] == bfd_get_symbol_leading_char (abfd) \
        ? string + 1 : string)

Definition at line 71 of file coffread.c.

Referenced by coff_read_enum_type(), coff_read_struct_type(), and process_coff_symbol().

#define INITIAL_TYPE_VECTOR_LENGTH   160

Definition at line 160 of file coffread.c.

Referenced by coff_symtab_read().

#define L_LNNO32 (   lp)    ((lp)->l_lnno)

Definition at line 1460 of file coffread.c.

Referenced by enter_linenos().

#define N_BTMASK   local_n_btmask

Definition at line 112 of file coffread.c.

Referenced by decode_type().

#define N_BTSHFT   local_n_btshft

Definition at line 113 of file coffread.c.

#define N_TMASK   local_n_tmask

Definition at line 114 of file coffread.c.

#define N_TSHIFT   local_n_tshift

Definition at line 115 of file coffread.c.

#define SDB_TYPE (   type)    (BTYPE(type) | (type & N_TMASK))

Definition at line 80 of file coffread.c.

Referenced by coff_symtab_read(), and read_one_sym().


Function Documentation

void _initialize_coffread ( void  )
static struct type* coff_alloc_type ( int  index) [static, read]
static void coff_end_symtab ( struct objfile objfile) [static]
static void coff_free_info ( struct objfile objfile,
void *  arg 
) [static]

Definition at line 2277 of file coffread.c.

References xfree().

static const char * coff_getfilename ( union internal_auxent *  aux_entry) [static]

Definition at line 1381 of file coffread.c.

References _, internal_error(), and stringtab.

Referenced by coff_symtab_read().

static void coff_locate_sections ( bfd *  abfd,
asection *  sectp,
void *  csip 
) [static]
static struct type** coff_lookup_type ( int  index) [static, read]

Definition at line 343 of file coffread.c.

References memset(), type_vector, type_vector_length, and xrealloc().

Referenced by coff_alloc_type().

static void coff_new_init ( struct objfile ignore) [static]

Definition at line 749 of file coffread.c.

static struct type * coff_read_enum_type ( int  index,
int  length,
int  lastsym,
struct objfile objfile 
) [static, read]
static struct type * coff_read_struct_type ( int  index,
int  length,
int  lastsym,
struct objfile objfile 
) [static, read]
static int coff_reg_to_regnum ( struct symbol sym,
struct gdbarch gdbarch 
) [static]

Definition at line 1605 of file coffread.c.

References gdbarch_sdb_reg_to_regnum(), and SYMBOL_VALUE.

static void coff_start_symtab ( const char *  name) [static]

Definition at line 388 of file coffread.c.

References record_debugformat(), and start_symtab().

Referenced by coff_symtab_read().

static void coff_symfile_finish ( struct objfile objfile) [static]

Definition at line 760 of file coffread.c.

References dwarf2_free_objfile(), and stabsread_clear_cache().

static void coff_symfile_init ( struct objfile objfile) [static]
static void coff_symfile_read ( struct objfile objfile,
int  symfile_flags 
) [static]
static void coff_symtab_read ( long  symtab_offset,
unsigned int  nsyms,
struct objfile objfile 
) [static]
static void complete_symtab ( const char *  name,
CORE_ADDR  start_addr,
unsigned int  size 
) [static]

Definition at line 410 of file coffread.c.

References current_source_end_addr, current_source_start_addr, set_last_source_file(), and size.

Referenced by coff_symtab_read().

static CORE_ADDR cs_section_address ( struct coff_symbol cs,
bfd *  abfd 
) [static]
static struct bfd_section* cs_to_bfd_section ( struct coff_symbol cs,
struct objfile objfile 
) [static, read]
static int cs_to_section ( struct coff_symbol cs,
struct objfile objfile 
) [static]
static struct type * decode_base_type ( struct coff_symbol cs,
unsigned int  c_type,
union internal_auxent *  aux,
struct objfile objfile 
) [static, read]
static struct type * decode_function_type ( struct coff_symbol cs,
unsigned int  c_type,
union internal_auxent *  aux,
struct objfile objfile 
) [static, read]

Definition at line 1886 of file coffread.c.

References coff_symbol::c_naux, and decode_type().

Referenced by process_coff_symbol().

static struct type * decode_type ( struct coff_symbol cs,
unsigned int  c_type,
union internal_auxent *  aux,
struct objfile objfile 
) [static, read]
static void enter_linenos ( long  file_offset,
int  first_line,
int  last_line,
struct objfile objfile 
) [static]
static void find_linenos ( bfd *  abfd,
struct bfd_section *  asect,
void *  vpinfo 
) [static]
static void find_targ_sec ( bfd *  abfd,
asection *  sect,
void *  obj 
) [static]

Definition at line 284 of file coffread.c.

References find_targ_sec_arg::resultp, and find_targ_sec_arg::targ_index.

Referenced by cs_section_address(), and cs_to_bfd_section().

static void free_linetab ( void  ) [static]

Definition at line 1446 of file coffread.c.

References linetab, and xfree().

Referenced by free_linetab_cleanup(), and init_lineno().

static void free_linetab_cleanup ( void *  ignore) [static]

Definition at line 1454 of file coffread.c.

References free_linetab().

Referenced by coff_symfile_read().

static void free_stringtab ( void  ) [static]

Definition at line 1342 of file coffread.c.

References stringtab, and xfree().

Referenced by free_stringtab_cleanup(), and init_stringtab().

static void free_stringtab_cleanup ( void *  ignore) [static]

Definition at line 1350 of file coffread.c.

References free_stringtab().

Referenced by coff_symfile_read().

static char * getsymname ( struct internal_syment *  symbol_entry) [static]

Definition at line 1356 of file coffread.c.

References stringtab.

Referenced by coff_symtab_read(), and read_one_sym().

static int init_lineno ( bfd *  abfd,
long  offset,
int  size 
) [static]

Definition at line 1417 of file coffread.c.

References free_linetab(), linetab, linetab_offset, linetab_size, local_linesz, memset(), offset, size, and xmalloc().

Referenced by coff_symfile_read().

static int init_stringtab ( bfd *  abfd,
long  offset 
) [static]

Definition at line 1302 of file coffread.c.

References free_stringtab(), memcpy(), stringtab, symfile_bfd, and xmalloc().

Referenced by coff_symfile_read().

static int is_import_fixup_symbol ( struct coff_symbol cs,
enum minimal_symbol_type  type 
) [static]

Definition at line 439 of file coffread.c.

References coff_symbol::c_name, coff_symbol::c_type, and mst_text.

Referenced by record_minimal_symbol().

static void patch_opaque_types ( struct symtab s) [static]
static void patch_type ( struct type type,
struct type real_type 
) [static]
static struct symbol * process_coff_symbol ( struct coff_symbol cs,
union internal_auxent *  aux,
struct objfile objfile 
) [static, read]
static void read_one_sym ( struct coff_symbol cs,
struct internal_syment *  sym,
union internal_auxent *  aux 
) [static]
static struct minimal_symbol* record_minimal_symbol ( struct coff_symbol cs,
CORE_ADDR  address,
enum minimal_symbol_type  type,
int  section,
struct objfile objfile 
) [static, read]
void stabsread_clear_cache ( void  )

Definition at line 503 of file stabsread.c.

References ref_chunk, and ref_count.

Referenced by coff_symfile_finish().


Variable Documentation

struct objfile_data* coff_objfile_data_key [static]

Definition at line 52 of file coffread.c.

Referenced by coff_symfile_init(), and coff_symfile_read().

Initial value:

Definition at line 1610 of file coffread.c.

Definition at line 1616 of file coffread.c.

Referenced by process_coff_symbol().

struct sym_fns coff_sym_fns [static]
struct objfile* coffread_objfile [static]

Definition at line 56 of file coffread.c.

Definition at line 86 of file coffread.c.

Referenced by coff_end_symtab(), and complete_symtab().

Definition at line 85 of file coffread.c.

Referenced by coff_end_symtab(), and complete_symtab().

char* linetab = NULL [static]

Definition at line 1408 of file coffread.c.

Referenced by enter_linenos(), free_linetab(), and init_lineno().

long linetab_offset [static]

Definition at line 1409 of file coffread.c.

Referenced by enter_linenos(), and init_lineno().

unsigned long linetab_size [static]

Definition at line 1410 of file coffread.c.

Referenced by enter_linenos(), and init_lineno().

unsigned local_auxesz [static]

Definition at line 124 of file coffread.c.

Referenced by coff_symfile_read(), and read_one_sym().

unsigned local_linesz [static]

Definition at line 122 of file coffread.c.

Referenced by coff_symfile_read(), enter_linenos(), find_linenos(), and init_lineno().

unsigned local_n_btmask [static]

Definition at line 107 of file coffread.c.

Referenced by coff_symfile_read().

unsigned local_n_btshft [static]

Definition at line 108 of file coffread.c.

Referenced by coff_symfile_read().

unsigned local_n_tmask [static]

Definition at line 109 of file coffread.c.

Referenced by coff_symfile_read().

unsigned local_n_tshift [static]

Definition at line 110 of file coffread.c.

Referenced by coff_symfile_read().

unsigned local_symesz [static]

Definition at line 123 of file coffread.c.

Referenced by coff_symfile_read(), and read_one_sym().

bfd* nlist_bfd_global [static]

Definition at line 91 of file coffread.c.

Referenced by coff_symtab_read(), and read_one_sym().

Definition at line 92 of file coffread.c.

Referenced by coff_read_enum_type(), coff_read_struct_type(), and coff_symtab_read().

struct symbol* opaque_type_chain[HASHSIZE] [static]

Definition at line 133 of file coffread.c.

int pe_file [static]

Definition at line 128 of file coffread.c.

Referenced by coff_symfile_read(), coff_symtab_read(), and read_one_sym().

char* stringtab = NULL [static]
bfd* symfile_bfd [static]

Definition at line 560 of file coffread.c.

Referenced by coff_symfile_read(), enter_linenos(), init_stringtab(), and read_one_sym().

char* temp_aux [static]

Definition at line 99 of file coffread.c.

Referenced by coff_symfile_read(), and read_one_sym().

char* temp_sym [static]

Definition at line 98 of file coffread.c.

Referenced by coff_symfile_read(), and read_one_sym().

struct type** type_vector [static]

Definition at line 151 of file coffread.c.

Referenced by coff_lookup_type().

Definition at line 155 of file coffread.c.

Referenced by coff_lookup_type(), and coff_symtab_read().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines