GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions | Variables
xcoffread.c File Reference
#include "defs.h"
#include "bfd.h"
#include <sys/types.h>
#include <fcntl.h>
#include <ctype.h>
#include <sys/stat.h>
#include <algorithm>
#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-legacy.h"
#include "stabsread.h"
#include "expression.h"
#include "complaints.h"
#include "psymtab.h"
#include "dwarf2/sect-names.h"
#include "dwarf2/public.h"
#include "gdb-stabs.h"
#include "aout/stab_gnu.h"

Go to the source code of this file.

Classes

struct  xcoff_symloc
 
struct  xcoff_symbol
 
struct  xcoff_symfile_info
 
struct  xcoff_find_targ_sec_arg
 
struct  _inclTable
 

Macros

#define INITIAL_STABVECTOR_LENGTH   40
 
#define XCOFF_DATA(objfile)    xcoff_objfile_data_key.get (objfile)
 
#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.u64)
 
#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 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 *, symfile_add_flags)
 
static void scan_xcoff_symtab (minimal_symbol_reader &, psymtab_storage *partial_symtabs, struct objfile *)
 
static const char * xcoff_next_symbol_text (struct objfile *)
 
static void record_include_begin (struct xcoff_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 xcoff_symbol *, struct objfile *)
 
static void read_xcoff_symtab (struct objfile *, legacy_psymtab *)
 
static void record_include_end (struct xcoff_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 arrange_linetable (std::vector< linetable_entry > &old_linetable)
 
static void allocate_include_entry (void)
 
static void aix_process_linenos (struct objfile *objfile)
 
static void record_minimal_symbol (minimal_symbol_reader &reader, const char *name, unrelocated_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_expand_psymtab (legacy_psymtab *pst, struct objfile *objfile)
 
static void xcoff_read_symtab (legacy_psymtab *self, struct objfile *objfile)
 
static legacy_psymtabxcoff_start_psymtab (psymtab_storage *partial_symtabs, struct objfile *objfile, const char *filename, int first_symnum)
 
static legacy_psymtabxcoff_end_psymtab (struct objfile *objfile, psymtab_storage *partial_symtabs, legacy_psymtab *pst, const char **include_list, int num_includes, int capping_symbol_number, legacy_psymtab **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 section_addr_info &addrs)
 
static int xcoff_get_core_n_import_files (bfd *abfd)
 
int xcoff_get_n_import_files (bfd *abfd)
 
void _initialize_xcoffread ()
 

Variables

static enum language psymtab_language = language_unknown
 
static struct xcoff_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 registry< objfile >::key< xcoff_symfile_infoxcoff_objfile_data_key
 
static const struct dwarf2_debug_sections dwarf2_xcoff_names
 
static InclTableinclTable
 
static int inclIndx
 
static int inclLength
 
static int inclDepth
 
static subfilemain_subfile
 
static legacy_psymtabthis_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
 

Macro Definition Documentation

◆ complete_symtab

#define complete_symtab ( name,
start_addr )
Value:
{ \
set_last_source_file (name); \
set_last_source_start_addr (start_addr); \
}
const char *const name

Definition at line 816 of file xcoffread.c.

Referenced by coff_symtab_read(), and read_xcoff_symtab().

◆ CSECT

#define CSECT ( PP)    ((PP)->x_csect)

◆ CSECT_ALIGN

#define CSECT_ALIGN ( PP)    (SMTYP_ALIGN(CSECT(PP).x_smtyp))

◆ CSECT_LEN

#define CSECT_LEN ( PP)    (CSECT(PP).x_scnlen.u64)

◆ CSECT_SCLAS

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

◆ CSECT_SMTYP

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

◆ INITIAL_INCLUDE_TABLE_LENGTH

#define INITIAL_INCLUDE_TABLE_LENGTH   20

Definition at line 496 of file xcoffread.c.

Referenced by allocate_include_entry().

◆ INITIAL_STABVECTOR_LENGTH

#define INITIAL_STABVECTOR_LENGTH   40

Definition at line 119 of file xcoffread.c.

◆ SYMNAME_ALLOC

#define SYMNAME_ALLOC ( NAME,
ALLOCED )
Value:
((ALLOCED) ? (NAME) : obstack_strdup (&objfile->objfile_obstack, \
(NAME)))
#define NAME
Definition ada-exp.c:568
auto_obstack objfile_obstack
Definition objfiles.h:760

Definition at line 1445 of file xcoffread.c.

Referenced by process_xcoff_symbol().

◆ XCOFF_DATA

#define XCOFF_DATA ( objfile)     xcoff_objfile_data_key.get (objfile)

Typedef Documentation

◆ InclTable

typedef struct _inclTable InclTable

Function Documentation

◆ _initialize_xcoffread()

void _initialize_xcoffread ( )

Definition at line 3004 of file xcoffread.c.

References add_symtab_fns(), and xcoff_sym_fns.

◆ aix_process_linenos()

static void aix_process_linenos ( struct objfile * objfile)
static

◆ allocate_include_entry()

static void allocate_include_entry ( void )
static

◆ arrange_linetable()

static void arrange_linetable ( std::vector< linetable_entry > & old_linetable)
static

◆ bf_notfound_complaint()

static void bf_notfound_complaint ( void )
static

Definition at line 186 of file xcoffread.c.

References complaint.

Referenced by read_symbol_lineno().

◆ coff_getfilename()

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

Definition at line 1593 of file xcoffread.c.

References XCOFF_DATA.

Referenced by read_xcoff_symtab(), and scan_xcoff_symtab().

◆ eb_complaint()

static void eb_complaint ( int arg1)
static

Definition at line 198 of file xcoffread.c.

References complaint.

Referenced by read_xcoff_symtab().

◆ ef_complaint()

static void ef_complaint ( int arg1)
static

Definition at line 192 of file xcoffread.c.

References complaint.

Referenced by read_xcoff_symtab().

◆ enter_line_range()

static void enter_line_range ( struct subfile * subfile,
unsigned beginoffset,
unsigned endoffset,
CORE_ADDR startaddr,
CORE_ADDR endaddr,
unsigned * firstLine )
static

◆ find_linenos()

static void find_linenos ( struct bfd * abfd,
struct bfd_section * asect,
void * vpinfo )
static

Definition at line 1714 of file xcoffread.c.

References xcoff_symfile_info::min_lineno_offset, and size.

Referenced by xcoff_initial_scan().

◆ find_targ_sec()

static void find_targ_sec ( bfd * abfd,
asection * sect,
void * obj )
static

Definition at line 263 of file xcoffread.c.

References gdb_bfd_section_index(), SECT_OFF_DATA, and SECT_OFF_TEXT.

Referenced by xcoff_secnum_to_sections().

◆ function_outside_compilation_unit_complaint()

static void function_outside_compilation_unit_complaint ( const char * arg1)
static

Definition at line 2025 of file xcoffread.c.

References complaint.

Referenced by scan_xcoff_symtab().

◆ init_stringtab()

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

Definition at line 1817 of file xcoffread.c.

References objfile::objfile_obstack, SEEK_SET, xcoff_symfile_info::strtbl, and XCOFF_DATA.

Referenced by xcoff_initial_scan().

◆ process_linenos()

static void process_linenos ( CORE_ADDR start,
CORE_ADDR end )
static

◆ process_xcoff_symbol()

static struct symbol * process_xcoff_symbol ( struct xcoff_symbol * cs,
struct objfile * objfile )
static

◆ read_symbol()

static void read_symbol ( struct internal_syment * symbol,
int symno )
static

◆ read_symbol_lineno()

static int read_symbol_lineno ( int symno)
static

◆ read_symbol_nvalue()

static CORE_ADDR read_symbol_nvalue ( int symno)
static

Definition at line 1632 of file xcoffread.c.

References read_symbol().

Referenced by enter_line_range().

◆ read_xcoff_symtab()

static void read_xcoff_symtab ( struct objfile * objfile,
legacy_psymtab * pst )
static

◆ record_include_begin()

static void record_include_begin ( struct xcoff_symbol * cs)
static

◆ record_include_end()

static void record_include_end ( struct xcoff_symbol * cs)
static

◆ record_minimal_symbol()

static void record_minimal_symbol ( minimal_symbol_reader & reader,
const char * name,
unrelocated_addr address,
enum minimal_symbol_type ms_type,
int n_scnum,
struct objfile * objfile )
static

Definition at line 845 of file xcoffread.c.

References name, minimal_symbol_reader::record_with_info(), and secnum_to_section().

Referenced by scan_xcoff_symtab().

◆ scan_xcoff_symtab()

static void scan_xcoff_symtab ( minimal_symbol_reader & reader,
psymtab_storage * partial_symtabs,
struct objfile * objfile )
static

◆ secnum_to_bfd_section()

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

Definition at line 322 of file xcoffread.c.

References xcoff_find_targ_sec_arg::bfd_sect, and xcoff_secnum_to_sections().

Referenced by scan_xcoff_symtab().

◆ secnum_to_section()

static int secnum_to_section ( int n_scnum,
struct objfile * objfile )
static

◆ swap_sym()

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 1978 of file xcoffread.c.

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

Referenced by scan_xcoff_symtab().

◆ xcoff_end_psymtab()

static legacy_psymtab * xcoff_end_psymtab ( struct objfile * objfile,
psymtab_storage * partial_symtabs,
legacy_psymtab * pst,
const char ** include_list,
int num_includes,
int capping_symbol_number,
legacy_psymtab ** dependency_list,
int number_dependencies,
int textlow_not_set )
static

◆ xcoff_expand_psymtab()

static void xcoff_expand_psymtab ( legacy_psymtab * pst,
struct objfile * objfile )
static

◆ xcoff_get_core_n_import_files()

static int xcoff_get_core_n_import_files ( bfd * abfd)
static

Definition at line 2944 of file xcoffread.c.

Referenced by xcoff_get_n_import_files().

◆ xcoff_get_n_import_files()

int xcoff_get_n_import_files ( bfd * abfd)

◆ xcoff_get_toc_offset()

CORE_ADDR xcoff_get_toc_offset ( struct objfile * objfile)

Definition at line 2767 of file xcoffread.c.

References XCOFF_DATA.

Referenced by solib_aix_get_toc_value().

◆ xcoff_initial_scan()

static void xcoff_initial_scan ( struct objfile * objfile,
symfile_add_flags symfile_flags )
static

◆ xcoff_new_init()

static void xcoff_new_init ( struct objfile * objfile)
static

Definition at line 1779 of file xcoffread.c.

References stabsread_new_init().

◆ xcoff_next_symbol_text()

static const char * xcoff_next_symbol_text ( struct objfile * objfile)
static

Definition at line 880 of file xcoffread.c.

References complaint, objfile::obfd, raw_symbol, symnum, this_symtab_objfile, and XCOFF_DATA.

Referenced by scan_xcoff_symtab(), and xcoff_read_symtab().

◆ xcoff_read_symtab()

static void xcoff_read_symtab ( legacy_psymtab * self,
struct objfile * objfile )
static

◆ xcoff_secnum_to_sections()

static void xcoff_secnum_to_sections ( int n_scnum,
struct objfile * objfile,
asection ** bfd_sect,
int * secnum )
static

◆ xcoff_start_psymtab()

static legacy_psymtab * xcoff_start_psymtab ( psymtab_storage * partial_symtabs,
struct objfile * objfile,
const char * filename,
int first_symnum )
static

◆ xcoff_symfile_finish()

static void xcoff_symfile_finish ( struct objfile * objfile)
static

Definition at line 1803 of file xcoffread.c.

References inclDepth, inclIndx, inclLength, inclTable, main_subfile, and xfree().

◆ xcoff_symfile_init()

static void xcoff_symfile_init ( struct objfile * objfile)
static

Definition at line 1791 of file xcoffread.c.

References xcoff_objfile_data_key.

◆ xcoff_symfile_offsets()

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

Variable Documentation

◆ cur_src_end_addr

CORE_ADDR cur_src_end_addr
static

Definition at line 111 of file xcoffread.c.

Referenced by aix_process_linenos(), and read_xcoff_symtab().

◆ dwarf2_xcoff_names

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

Definition at line 159 of file xcoffread.c.

Referenced by xcoff_initial_scan().

◆ fcn_cs_saved

struct xcoff_symbol fcn_cs_saved
static

Definition at line 102 of file xcoffread.c.

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

◆ first_fun_line_offset

unsigned int first_fun_line_offset
static

Definition at line 1867 of file xcoffread.c.

Referenced by scan_xcoff_symtab(), and xcoff_end_psymtab().

◆ first_object_file_end

CORE_ADDR first_object_file_end
static

Definition at line 115 of file xcoffread.c.

Referenced by read_xcoff_symtab().

◆ inclDepth

int inclDepth
static

Definition at line 500 of file xcoffread.c.

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

◆ inclIndx

int inclIndx
static

◆ inclLength

int inclLength
static

Definition at line 499 of file xcoffread.c.

Referenced by allocate_include_entry(), and xcoff_symfile_finish().

◆ inclTable

InclTable* inclTable
static

◆ local_symesz

unsigned local_symesz
static

Definition at line 125 of file xcoffread.c.

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

◆ main_subfile

subfile* main_subfile
static

Definition at line 503 of file xcoffread.c.

Referenced by allocate_include_entry(), process_linenos(), and xcoff_symfile_finish().

◆ psymtab_language

enum language psymtab_language = language_unknown
static

Definition at line 84 of file xcoffread.c.

Referenced by scan_xcoff_symtab(), and xcoff_start_psymtab().

◆ raw_symbol

char* raw_symbol
static

Definition at line 874 of file xcoffread.c.

Referenced by read_xcoff_symtab(), and xcoff_next_symbol_text().

◆ static_block_base

int static_block_base = 0
static

Definition at line 862 of file xcoffread.c.

Referenced by process_xcoff_symbol(), and read_xcoff_symtab().

◆ static_block_section

int static_block_section = -1
static

Definition at line 866 of file xcoffread.c.

Referenced by process_xcoff_symbol(), and read_xcoff_symtab().

◆ symfile_bfd

bfd* symfile_bfd
static

Definition at line 104 of file xcoffread.c.

Referenced by read_symbol_lineno(), and xcoff_initial_scan().

◆ symname_alloced

int symname_alloced = 0
static

Definition at line 870 of file xcoffread.c.

Referenced by process_xcoff_symbol(), and read_xcoff_symtab().

◆ this_symtab_objfile

struct objfile* this_symtab_objfile
static

◆ this_symtab_psymtab

legacy_psymtab* this_symtab_psymtab
static

Definition at line 568 of file xcoffread.c.

Referenced by aix_process_linenos(), process_linenos(), and read_xcoff_symtab().

◆ xcoff_objfile_data_key

const registry<objfile>::key<xcoff_symfile_info> xcoff_objfile_data_key
static

Definition at line 150 of file xcoffread.c.

Referenced by xcoff_symfile_init().

◆ xcoff_sym_fns

const struct sym_fns xcoff_sym_fns
static
Initial value:
=
{
NULL,
}
symfile_segment_data_up default_symfile_segments(bfd *abfd)
Definition symfile.c:711
bfd_byte * default_symfile_relocate(struct objfile *objfile, asection *sectp, bfd_byte *buf)
Definition symfile.c:3595
static void aix_process_linenos(struct objfile *objfile)
Definition xcoffread.c:722
static void xcoff_symfile_finish(struct objfile *)
Definition xcoffread.c:1803
static void xcoff_symfile_offsets(struct objfile *objfile, const section_addr_info &addrs)
Definition xcoffread.c:2879
static void xcoff_initial_scan(struct objfile *, symfile_add_flags)
Definition xcoffread.c:2784
static void xcoff_new_init(struct objfile *)
Definition xcoffread.c:1779
static void xcoff_symfile_init(struct objfile *)
Definition xcoffread.c:1791

Definition at line 2918 of file xcoffread.c.

Referenced by _initialize_xcoffread().