GDB (xrefs)
Classes | Macros | Functions | Variables
/tmp/gdb-7.10/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 <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 "block.h"
#include "dictionary.h"
#include "coff-pe-read.h"
#include "psymtab.h"
#include "build-id.h"

Go to the source code of this file.

Classes

struct  coff_symfile_info
 
struct  coff_symbol
 
struct  find_targ_sec_arg
 

Macros

#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 (struct objfile *objfile, 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 const 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 const struct symbol_register_ops coff_register_funcs
 
static int coff_register_index
 
static const struct sym_fns coff_sym_fns
 

Macro Definition Documentation

#define EXTERNAL_NAME (   string,
  abfd 
)
Value:
(string[0] == bfd_get_symbol_leading_char (abfd) \
? string + 1 : string)
const char * string
Definition: signals.c:50

Definition at line 69 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 158 of file coffread.c.

Referenced by coff_symtab_read().

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

Definition at line 1474 of file coffread.c.

Referenced by enter_linenos().

#define N_BTMASK   local_n_btmask

Definition at line 110 of file coffread.c.

Referenced by decode_type().

#define N_BTSHFT   local_n_btshft

Definition at line 111 of file coffread.c.

#define N_TMASK   local_n_tmask

Definition at line 112 of file coffread.c.

#define N_TSHIFT   local_n_tshift

Definition at line 113 of file coffread.c.

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

Definition at line 78 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
static void coff_end_symtab ( struct objfile objfile)
static
static void coff_free_info ( struct objfile objfile,
void *  arg 
)
static

Definition at line 2291 of file coffread.c.

References xfree().

Referenced by _initialize_coffread().

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

Definition at line 1395 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

Definition at line 341 of file coffread.c.

References type_vector, type_vector_length, and xrealloc().

Referenced by coff_alloc_type().

static void coff_new_init ( struct objfile ignore)
static

Definition at line 761 of file coffread.c.

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

Definition at line 1619 of file coffread.c.

References gdbarch_sdb_reg_to_regnum(), and SYMBOL_VALUE.

static void coff_start_symtab ( struct objfile objfile,
const char *  name 
)
static

Definition at line 386 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 772 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 408 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
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
static struct type * decode_function_type ( struct coff_symbol cs,
unsigned int  c_type,
union internal_auxent *  aux,
struct objfile objfile 
)
static

Definition at line 1900 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
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 282 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 1460 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 1468 of file coffread.c.

References free_linetab().

Referenced by coff_symfile_read().

static void free_stringtab ( void  )
static

Definition at line 1356 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 1364 of file coffread.c.

References free_stringtab().

Referenced by coff_symfile_read().

static char * getsymname ( struct internal_syment *  symbol_entry)
static

Definition at line 1370 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 1431 of file coffread.c.

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

Referenced by coff_symfile_read().

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

Definition at line 1316 of file coffread.c.

References free_stringtab(), 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 436 of file coffread.c.

References coff_symbol::c_name, coff_symbol::c_type, mst_text, and startswith().

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

Definition at line 1529 of file coffread.c.

References TYPE_ALLOC, TYPE_FIELDS, TYPE_LENGTH, TYPE_NAME, TYPE_NFIELDS, TYPE_TARGET_TYPE, and xfree().

Referenced by patch_opaque_types().

static struct symbol * process_coff_symbol ( struct coff_symbol cs,
union internal_auxent *  aux,
struct objfile objfile 
)
static
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
void stabsread_clear_cache ( void  )

Definition at line 502 of file stabsread.c.

References ref_chunk, and ref_count.

Referenced by coff_symfile_finish().

Variable Documentation

const struct objfile_data* coff_objfile_data_key
static

Definition at line 50 of file coffread.c.

Referenced by _initialize_coffread(), coff_symfile_init(), and coff_symfile_read().

const struct symbol_register_ops coff_register_funcs
static
Initial value:
= {
}
static int coff_reg_to_regnum(struct symbol *sym, struct gdbarch *gdbarch)
Definition: coffread.c:1619

Definition at line 1624 of file coffread.c.

int coff_register_index
static

Definition at line 1630 of file coffread.c.

Referenced by _initialize_coffread(), and process_coff_symbol().

const struct sym_fns coff_sym_fns
static
Initial value:
=
{
NULL,
NULL,
NULL,
}
static void coff_symfile_finish(struct objfile *objfile)
Definition: coffread.c:772
struct symfile_segment_data * default_symfile_segments(bfd *abfd)
Definition: symfile.c:812
bfd_byte * default_symfile_relocate(struct objfile *objfile, asection *sectp, bfd_byte *buf)
Definition: symfile.c:3740
static void coff_symfile_read(struct objfile *objfile, int symfile_flags)
Definition: coffread.c:562
const struct quick_symbol_functions psym_functions
Definition: psymtab.c:1466
void default_symfile_offsets(struct objfile *objfile, const struct section_addr_info *addrs)
Definition: symfile.c:722
static void coff_symfile_init(struct objfile *objfile)
Definition: coffread.c:502
static void coff_new_init(struct objfile *ignore)
Definition: coffread.c:761

Definition at line 2265 of file coffread.c.

struct objfile* coffread_objfile
static

Definition at line 54 of file coffread.c.

CORE_ADDR current_source_end_addr
static

Definition at line 84 of file coffread.c.

Referenced by coff_end_symtab(), and complete_symtab().

CORE_ADDR current_source_start_addr
static

Definition at line 83 of file coffread.c.

Referenced by coff_end_symtab(), and complete_symtab().

char* linetab = NULL
static

Definition at line 1422 of file coffread.c.

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

long linetab_offset
static

Definition at line 1423 of file coffread.c.

Referenced by enter_linenos(), and init_lineno().

unsigned long linetab_size
static

Definition at line 1424 of file coffread.c.

Referenced by enter_linenos(), and init_lineno().

unsigned local_auxesz
static

Definition at line 122 of file coffread.c.

Referenced by coff_symfile_read(), and read_one_sym().

unsigned local_linesz
static

Definition at line 120 of file coffread.c.

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

unsigned local_n_btmask
static

Definition at line 105 of file coffread.c.

Referenced by coff_symfile_read().

unsigned local_n_btshft
static

Definition at line 106 of file coffread.c.

Referenced by coff_symfile_read().

unsigned local_n_tmask
static

Definition at line 107 of file coffread.c.

Referenced by coff_symfile_read().

unsigned local_n_tshift
static

Definition at line 108 of file coffread.c.

Referenced by coff_symfile_read().

unsigned local_symesz
static

Definition at line 121 of file coffread.c.

Referenced by coff_symfile_read(), and read_one_sym().

bfd* nlist_bfd_global
static

Definition at line 89 of file coffread.c.

Referenced by coff_symtab_read(), and read_one_sym().

int nlist_nsyms_global
static

Definition at line 90 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 131 of file coffread.c.

int pe_file
static

Definition at line 126 of file coffread.c.

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

char* stringtab = NULL
static

Definition at line 1313 of file coffread.c.

Referenced by coff_getfilename(), free_stringtab(), getsymname(), and init_stringtab().

bfd* symfile_bfd
static

Definition at line 557 of file coffread.c.

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

char* temp_aux
static

Definition at line 97 of file coffread.c.

Referenced by coff_symfile_read(), and read_one_sym().

char* temp_sym
static

Definition at line 96 of file coffread.c.

Referenced by coff_symfile_read(), and read_one_sym().

struct type** type_vector
static

Definition at line 149 of file coffread.c.

Referenced by coff_lookup_type().

int type_vector_length
static

Definition at line 153 of file coffread.c.

Referenced by coff_lookup_type(), and coff_symtab_read().