GDB (xrefs)
Classes | Macros | Typedefs | Functions | Variables
/tmp/gdb-7.10/gdb/xcoffread.c File Reference
#include "defs.h"
#include "bfd.h"
#include <sys/types.h>
#include <fcntl.h>
#include <ctype.h>
#include <sys/file.h>
#include <sys/stat.h>
#include "coff/internal.h"
#include "libcoff.h"
#include "coff/xcoff.h"
#include "libxcoff.h"
#include "coff/rs6000.h"
#include "xcoffread.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "symfile.h"
#include "objfiles.h"
#include "buildsym.h"
#include "stabsread.h"
#include "expression.h"
#include "complaints.h"
#include "psympriv.h"
#include "gdb-stabs.h"
#include "aout/stab_gnu.h"

Go to the source code of this file.

Classes

struct  symloc
 
struct  coff_symbol
 
struct  coff_symfile_info
 
struct  find_targ_sec_arg
 
struct  _inclTable
 

Macros

#define INITIAL_STABVECTOR_LENGTH   40
 
#define XCOFF_DATA(objfile)
 
#define NUM_OF_FUNCTIONS   20
 
#define INITIAL_INCLUDE_TABLE_LENGTH   20
 
#define complete_symtab(name, start_addr)
 
#define CSECT(PP)   ((PP)->x_csect)
 
#define CSECT_LEN(PP)   (CSECT(PP).x_scnlen.l)
 
#define CSECT_ALIGN(PP)   (SMTYP_ALIGN(CSECT(PP).x_smtyp))
 
#define CSECT_SMTYP(PP)   (SMTYP_SMTYP(CSECT(PP).x_smtyp))
 
#define CSECT_SCLAS(PP)   (CSECT(PP).x_smclas)
 
#define SYMBOL_DUP(SYMBOL1, SYMBOL2)
 
#define SYMNAME_ALLOC(NAME, ALLOCED)
 

Typedefs

typedef struct _inclTable InclTable
 

Functions

static void bf_notfound_complaint (void)
 
static void ef_complaint (int arg1)
 
static void eb_complaint (int arg1)
 
static void xcoff_initial_scan (struct objfile *, int)
 
static void scan_xcoff_symtab (struct objfile *)
 
static char * xcoff_next_symbol_text (struct objfile *)
 
static void record_include_begin (struct coff_symbol *)
 
static void enter_line_range (struct subfile *, unsigned, unsigned, CORE_ADDR, CORE_ADDR, unsigned *)
 
static void init_stringtab (bfd *, file_ptr, struct objfile *)
 
static void xcoff_symfile_init (struct objfile *)
 
static void xcoff_new_init (struct objfile *)
 
static void xcoff_symfile_finish (struct objfile *)
 
static char * coff_getfilename (union internal_auxent *, struct objfile *)
 
static void read_symbol (struct internal_syment *, int)
 
static int read_symbol_lineno (int)
 
static CORE_ADDR read_symbol_nvalue (int)
 
static struct symbolprocess_xcoff_symbol (struct coff_symbol *, struct objfile *)
 
static void read_xcoff_symtab (struct objfile *, struct partial_symtab *)
 
static int compare_lte (const void *, const void *)
 
static struct linetablearrange_linetable (struct linetable *)
 
static void record_include_end (struct coff_symbol *)
 
static void process_linenos (CORE_ADDR, CORE_ADDR)
 
static int secnum_to_section (int, struct objfile *)
 
static asection * secnum_to_bfd_section (int, struct objfile *)
 
static void find_targ_sec (bfd *, asection *, void *)
 
static void xcoff_secnum_to_sections (int n_scnum, struct objfile *objfile, asection **bfd_sect, int *secnum)
 
static void allocate_include_entry (void)
 
static void aix_process_linenos (struct objfile *objfile)
 
static void record_minimal_symbol (const char *name, CORE_ADDR address, enum minimal_symbol_type ms_type, int n_scnum, struct objfile *objfile)
 
static void find_linenos (struct bfd *abfd, struct bfd_section *asect, void *vpinfo)
 
static void xcoff_psymtab_to_symtab_1 (struct objfile *objfile, struct partial_symtab *pst)
 
static void xcoff_read_symtab (struct partial_symtab *self, struct objfile *objfile)
 
static struct partial_symtabxcoff_start_psymtab (struct objfile *objfile, const char *filename, int first_symnum, struct partial_symbol **global_syms, struct partial_symbol **static_syms)
 
static struct partial_symtabxcoff_end_psymtab (struct objfile *objfile, struct partial_symtab *pst, const char **include_list, int num_includes, int capping_symbol_number, struct partial_symtab **dependency_list, int number_dependencies, int textlow_not_set)
 
static void swap_sym (struct internal_syment *symbol, union internal_auxent *aux, const char **name, char **raw, unsigned int *symnump, struct objfile *objfile)
 
static void function_outside_compilation_unit_complaint (const char *arg1)
 
CORE_ADDR xcoff_get_toc_offset (struct objfile *objfile)
 
static void xcoff_symfile_offsets (struct objfile *objfile, const struct section_addr_info *addrs)
 
static int xcoff_get_core_n_import_files (bfd *abfd)
 
int xcoff_get_n_import_files (bfd *abfd)
 
static void xcoff_free_info (struct objfile *objfile, void *arg)
 
void _initialize_xcoffread (void)
 

Variables

static const struct objfile_data * xcoff_objfile_data_key
 
static enum language psymtab_language = language_unknown
 
static struct coff_symbol fcn_cs_saved
 
static bfd * symfile_bfd
 
static CORE_ADDR cur_src_end_addr
 
static CORE_ADDR first_object_file_end
 
static unsigned local_symesz
 
static const struct dwarf2_debug_sections dwarf2_xcoff_names
 
static InclTableinclTable
 
static int inclIndx
 
static int inclLength
 
static int inclDepth
 
static struct partial_symtabthis_symtab_psymtab
 
static struct objfilethis_symtab_objfile
 
static int static_block_base = 0
 
static int static_block_section = -1
 
static int symname_alloced = 0
 
static char * raw_symbol
 
static unsigned int first_fun_line_offset
 
static const struct sym_fns xcoff_sym_fns
 
initialize_file_ftype _initialize_xcoffread
 

Macro Definition Documentation

#define complete_symtab (   name,
  start_addr 
)
Value:
{ \
last_source_start_addr = start_addr; \
}
void set_last_source_file(const char *name)
Definition: buildsym.c:1720
const char *const name
Definition: aarch64-tdep.c:68

Definition at line 902 of file xcoffread.c.

Referenced by read_xcoff_symtab().

#define CSECT (   PP)    ((PP)->x_csect)
#define CSECT_ALIGN (   PP)    (SMTYP_ALIGN(CSECT(PP).x_smtyp))
#define CSECT_LEN (   PP)    (CSECT(PP).x_scnlen.l)

Referenced by read_xcoff_symtab().

#define CSECT_SCLAS (   PP)    (CSECT(PP).x_smclas)

Referenced by read_xcoff_symtab().

#define CSECT_SMTYP (   PP)    (SMTYP_SMTYP(CSECT(PP).x_smtyp))

Referenced by read_xcoff_symtab().

#define INITIAL_INCLUDE_TABLE_LENGTH   20

Definition at line 534 of file xcoffread.c.

Referenced by allocate_include_entry().

#define INITIAL_STABVECTOR_LENGTH   40

Definition at line 120 of file xcoffread.c.

#define NUM_OF_FUNCTIONS   20

Referenced by arrange_linetable().

#define SYMBOL_DUP (   SYMBOL1,
  SYMBOL2 
)
Value:
(SYMBOL2) = (struct symbol *) \
obstack_alloc (&objfile->objfile_obstack, sizeof (struct symbol)); \
*(SYMBOL2) = *(SYMBOL1);
struct obstack objfile_obstack
Definition: objfiles.h:328
Definition: symtab.h:703

Definition at line 1516 of file xcoffread.c.

Referenced by process_xcoff_symbol().

#define SYMNAME_ALLOC (   NAME,
  ALLOCED 
)
Value:
((ALLOCED) ? (NAME) : obstack_copy0 (&objfile->objfile_obstack, \
(NAME), strlen (NAME)))
struct obstack objfile_obstack
Definition: objfiles.h:328
#define NAME
Definition: ada-exp.c:292

Definition at line 1522 of file xcoffread.c.

Referenced by process_xcoff_symbol().

#define XCOFF_DATA (   objfile)

Typedef Documentation

typedef struct _inclTable InclTable

Function Documentation

void _initialize_xcoffread ( void  )

Definition at line 3179 of file xcoffread.c.

References add_symtab_fns(), xcoff_free_info(), and xcoff_objfile_data_key.

static void aix_process_linenos ( struct objfile objfile)
static

Definition at line 810 of file xcoffread.c.

References cur_src_end_addr, last_source_start_addr, and process_linenos().

static void allocate_include_entry ( void  )
static

Definition at line 583 of file xcoffread.c.

References inclLength, INITIAL_INCLUDE_TABLE_LENGTH, xmalloc(), and xrealloc().

Referenced by record_include_begin(), and record_include_end().

static struct linetable * arrange_linetable ( struct linetable oldLineTb)
static
static void bf_notfound_complaint ( void  )
static

Definition at line 175 of file xcoffread.c.

References _, complaint(), and symfile_complaints.

Referenced by read_symbol_lineno().

static char * coff_getfilename ( union internal_auxent *  aux_entry,
struct objfile objfile 
)
static

Definition at line 1672 of file xcoffread.c.

References XCOFF_DATA.

Referenced by read_xcoff_symtab(), and scan_xcoff_symtab().

static int compare_lte ( const void *  lte1p,
const void *  lte2p 
)
static

Definition at line 409 of file xcoffread.c.

References linetable_entry::pc.

Referenced by arrange_linetable().

static void eb_complaint ( int  arg1)
static

Definition at line 189 of file xcoffread.c.

References _, complaint(), and symfile_complaints.

Referenced by read_xcoff_symtab().

static void ef_complaint ( int  arg1)
static

Definition at line 182 of file xcoffread.c.

References _, complaint(), and symfile_complaints.

Referenced by read_xcoff_symtab().

static void enter_line_range ( struct subfile subfile,
unsigned  beginoffset,
unsigned  endoffset,
CORE_ADDR  startaddr,
CORE_ADDR  endaddr,
unsigned *  firstLine 
)
static
static void find_linenos ( struct bfd *  abfd,
struct bfd_section *  asect,
void *  vpinfo 
)
static
static void find_targ_sec ( bfd *  abfd,
asection *  sect,
void *  obj 
)
static
static void function_outside_compilation_unit_complaint ( const char *  arg1)
static

Definition at line 2178 of file xcoffread.c.

References _, complaint(), and symfile_complaints.

Referenced by scan_xcoff_symtab().

static void init_stringtab ( bfd *  abfd,
file_ptr  offset,
struct objfile objfile 
)
static

Definition at line 1953 of file xcoffread.c.

References _, error(), objfile::objfile_obstack, SEEK_SET, coff_symfile_info::strtbl, and XCOFF_DATA.

Referenced by xcoff_initial_scan().

static void process_linenos ( CORE_ADDR  start,
CORE_ADDR  end 
)
static
static struct symbol * process_xcoff_symbol ( struct coff_symbol cs,
struct objfile objfile 
)
static
static void read_symbol ( struct internal_syment *  symbol,
int  symno 
)
static
static int read_symbol_lineno ( int  symno)
static
static CORE_ADDR read_symbol_nvalue ( int  symno)
static

Definition at line 1710 of file xcoffread.c.

References read_symbol().

Referenced by enter_line_range().

static void read_xcoff_symtab ( struct objfile objfile,
struct partial_symtab pst 
)
static
static void record_include_begin ( struct coff_symbol cs)
static
static void record_include_end ( struct coff_symbol cs)
static
static void record_minimal_symbol ( const char *  name,
CORE_ADDR  address,
enum minimal_symbol_type  ms_type,
int  n_scnum,
struct objfile objfile 
)
static

Definition at line 931 of file xcoffread.c.

References name, prim_record_minimal_symbol_and_info(), and secnum_to_section().

Referenced by scan_xcoff_symtab().

static void scan_xcoff_symtab ( struct objfile objfile)
static
static asection * secnum_to_bfd_section ( int  n_scnum,
struct objfile objfile 
)
static

Definition at line 315 of file xcoffread.c.

References find_targ_sec_arg::bfd_sect, and xcoff_secnum_to_sections().

Referenced by scan_xcoff_symtab().

static int secnum_to_section ( int  n_scnum,
struct objfile objfile 
)
static
static void swap_sym ( struct internal_syment *  symbol,
union internal_auxent *  aux,
const char **  name,
char **  raw,
unsigned int symnump,
struct objfile objfile 
)
static

Definition at line 2132 of file xcoffread.c.

References objfile::obfd, objfile::objfile_obstack, and XCOFF_DATA.

Referenced by scan_xcoff_symtab().

static struct partial_symtab* xcoff_end_psymtab ( struct objfile objfile,
struct partial_symtab pst,
const char **  include_list,
int  num_includes,
int  capping_symbol_number,
struct partial_symtab **  dependency_list,
int  number_dependencies,
int  textlow_not_set 
)
static
static void xcoff_free_info ( struct objfile objfile,
void *  arg 
)
static

Definition at line 3170 of file xcoffread.c.

References xfree().

Referenced by _initialize_xcoffread().

static int xcoff_get_core_n_import_files ( bfd *  abfd)
static

Definition at line 3109 of file xcoffread.c.

References offset.

Referenced by xcoff_get_n_import_files().

int xcoff_get_n_import_files ( bfd *  abfd)
CORE_ADDR xcoff_get_toc_offset ( struct objfile objfile)

Definition at line 2921 of file xcoffread.c.

References XCOFF_DATA.

Referenced by solib_aix_get_toc_value().

static void xcoff_initial_scan ( struct objfile objfile,
int  symfile_flags 
)
static
static void xcoff_new_init ( struct objfile objfile)
static

Definition at line 1905 of file xcoffread.c.

References buildsym_new_init(), and stabsread_new_init().

static char * xcoff_next_symbol_text ( struct objfile objfile)
static
static void xcoff_psymtab_to_symtab_1 ( struct objfile objfile,
struct partial_symtab pst 
)
static
static void xcoff_read_symtab ( struct partial_symtab self,
struct objfile objfile 
)
static
static void xcoff_secnum_to_sections ( int  n_scnum,
struct objfile objfile,
asection **  bfd_sect,
int secnum 
)
static
static struct partial_symtab* xcoff_start_psymtab ( struct objfile objfile,
const char *  filename,
int  first_symnum,
struct partial_symbol **  global_syms,
struct partial_symbol **  static_syms 
)
static
static void xcoff_symfile_finish ( struct objfile objfile)
static

Definition at line 1938 of file xcoffread.c.

References dwarf2_free_objfile(), and xfree().

static void xcoff_symfile_init ( struct objfile objfile)
static

Definition at line 1918 of file xcoffread.c.

References objfile::flags, OBJF_REORDERED, and xcoff_objfile_data_key.

static void xcoff_symfile_offsets ( struct objfile objfile,
const struct section_addr_info addrs 
)
static

Variable Documentation

initialize_file_ftype _initialize_xcoffread
CORE_ADDR cur_src_end_addr
static

Definition at line 112 of file xcoffread.c.

Referenced by aix_process_linenos(), and read_xcoff_symtab().

const struct dwarf2_debug_sections dwarf2_xcoff_names
static
Initial value:
= {
{ ".dwinfo", NULL },
{ ".dwabrev", NULL },
{ ".dwline", NULL },
{ ".dwloc", NULL },
{ NULL, NULL },
{ NULL, NULL },
{ ".dwstr", NULL },
{ ".dwrnges", NULL },
{ NULL, NULL },
{ NULL, NULL },
{ ".dwframe", NULL },
{ NULL, NULL },
{ NULL, NULL },
23
}

Definition at line 157 of file xcoffread.c.

struct coff_symbol fcn_cs_saved
static

Definition at line 103 of file xcoffread.c.

Referenced by process_xcoff_symbol(), and read_xcoff_symtab().

unsigned int first_fun_line_offset
static

Definition at line 2003 of file xcoffread.c.

Referenced by xcoff_end_psymtab().

CORE_ADDR first_object_file_end
static

Definition at line 116 of file xcoffread.c.

Referenced by read_xcoff_symtab().

int inclDepth
static

Definition at line 538 of file xcoffread.c.

Referenced by record_include_begin(), and record_include_end().

int inclIndx
static

Definition at line 536 of file xcoffread.c.

Referenced by process_linenos(), record_include_begin(), and record_include_end().

int inclLength
static

Definition at line 537 of file xcoffread.c.

Referenced by allocate_include_entry().

InclTable* inclTable
static

Definition at line 535 of file xcoffread.c.

unsigned local_symesz
static

Definition at line 126 of file xcoffread.c.

Referenced by read_symbol(), read_symbol_lineno(), read_xcoff_symtab(), and scan_xcoff_symtab().

enum language psymtab_language = language_unknown
static

Definition at line 85 of file xcoffread.c.

Referenced by scan_xcoff_symtab(), and xcoff_start_psymtab().

char* raw_symbol
static

Definition at line 962 of file xcoffread.c.

int static_block_base = 0
static

Definition at line 950 of file xcoffread.c.

Referenced by process_xcoff_symbol().

int static_block_section = -1
static

Definition at line 954 of file xcoffread.c.

Referenced by process_xcoff_symbol().

bfd* symfile_bfd
static

Definition at line 105 of file xcoffread.c.

Referenced by read_symbol_lineno(), and xcoff_initial_scan().

int symname_alloced = 0
static

Definition at line 958 of file xcoffread.c.

struct objfile* this_symtab_objfile
static

Definition at line 609 of file xcoffread.c.

Referenced by enter_line_range(), read_symbol_lineno(), and xcoff_next_symbol_text().

struct partial_symtab* this_symtab_psymtab
static

Definition at line 606 of file xcoffread.c.

const struct objfile_data* xcoff_objfile_data_key
static

Definition at line 58 of file xcoffread.c.

Referenced by _initialize_xcoffread(), and xcoff_symfile_init().

const struct sym_fns xcoff_sym_fns
static
Initial value:
=
{
NULL,
NULL,
}
struct symfile_segment_data * default_symfile_segments(bfd *abfd)
Definition: symfile.c:812
static void xcoff_new_init(struct objfile *)
Definition: xcoffread.c:1905
static void xcoff_symfile_offsets(struct objfile *objfile, const struct section_addr_info *addrs)
Definition: xcoffread.c:3042
static void xcoff_initial_scan(struct objfile *, int)
Definition: xcoffread.c:2938
bfd_byte * default_symfile_relocate(struct objfile *objfile, asection *sectp, bfd_byte *buf)
Definition: symfile.c:3740
static void xcoff_symfile_finish(struct objfile *)
Definition: xcoffread.c:1938
static void xcoff_symfile_init(struct objfile *)
Definition: xcoffread.c:1918
const struct quick_symbol_functions psym_functions
Definition: psymtab.c:1466
static void aix_process_linenos(struct objfile *objfile)
Definition: xcoffread.c:810

Definition at line 3081 of file xcoffread.c.