GDB (xrefs)
Classes | Defines | Functions | Variables
/home/stan/gdb/src/gdb/dbxread.c File Reference
#include "defs.h"
#include "gdb_string.h"
#include "gdb_obstack.h"
#include "gdb_stat.h"
#include "symtab.h"
#include "breakpoint.h"
#include "target.h"
#include "gdbcore.h"
#include "libaout.h"
#include "filenames.h"
#include "objfiles.h"
#include "buildsym.h"
#include "stabsread.h"
#include "gdb-stabs.h"
#include "demangle.h"
#include "complaints.h"
#include "cp-abi.h"
#include "cp-support.h"
#include "psympriv.h"
#include "block.h"
#include "gdb_assert.h"
#include "aout/aout64.h"
#include "aout/stab_gnu.h"

Go to the source code of this file.

Classes

struct  symloc
struct  header_file_location

Defines

#define LDSYMOFF(p)   (((struct symloc *)((p)->read_symtab_private))->ldsymoff)
#define LDSYMLEN(p)   (((struct symloc *)((p)->read_symtab_private))->ldsymlen)
#define SYMLOC(p)   ((struct symloc *)((p)->read_symtab_private))
#define SYMBOL_SIZE(p)   (SYMLOC(p)->symbol_size)
#define SYMBOL_OFFSET(p)   (SYMLOC(p)->symbol_offset)
#define STRING_OFFSET(p)   (SYMLOC(p)->string_offset)
#define FILE_STRING_OFFSET(p)   (SYMLOC(p)->file_string_offset)
#define DBX_STRINGTAB_SIZE_SIZE   sizeof(long) /* FIXME */
#define STRING_TABLE_OFFSET   (sym_bfd->origin + obj_str_filepos (sym_bfd))
#define SYMBOL_TABLE_OFFSET   (sym_bfd->origin + obj_sym_filepos (sym_bfd))
#define INTERNALIZE_SYMBOL(intern, extern, abfd)
#define COFF_STABS_SYMBOL_SIZE   12 /* XXX FIXME XXX */
#define ELF_STABS_SYMBOL_SIZE   12 /* XXX FIXME XXX */

Functions

static void unknown_symtype_complaint (const char *arg1)
static void lbrac_mismatch_complaint (int arg1)
static void repeated_header_complaint (const char *arg1, int arg2)
static void find_text_range (bfd *sym_bfd, struct objfile *objfile)
void _initialize_dbxread (void)
static void read_ofile_symtab (struct objfile *, struct partial_symtab *)
static void dbx_read_symtab (struct partial_symtab *self, struct objfile *objfile)
static void dbx_psymtab_to_symtab_1 (struct objfile *, struct partial_symtab *)
static void read_dbx_dynamic_symtab (struct objfile *objfile)
static void read_dbx_symtab (struct objfile *)
static void free_bincl_list (struct objfile *)
static struct partial_symtabfind_corresponding_bincl_psymtab (char *, int)
static void add_bincl_to_list (struct partial_symtab *, char *, int)
static void init_bincl_list (int, struct objfile *)
static char * dbx_next_symbol_text (struct objfile *)
static void fill_symbuf (bfd *)
static void dbx_symfile_init (struct objfile *)
static void dbx_new_init (struct objfile *)
static void dbx_symfile_read (struct objfile *, int)
static void dbx_symfile_finish (struct objfile *)
static void record_minimal_symbol (const char *, CORE_ADDR, int, struct objfile *)
static void add_new_header_file (char *, int)
static void add_old_header_file (char *, int)
static void add_this_object_header_file (int)
static struct partial_symtabstart_psymtab (struct objfile *, char *, CORE_ADDR, int, struct partial_symbol **, struct partial_symbol **)
void free_header_files (void)
void init_header_files (void)
static void dbx_free_symfile_info (struct objfile *objfile, void *arg)
static void stabs_seek (int sym_offset)
static void do_free_bincl_list_cleanup (void *objfile)
static struct cleanupmake_cleanup_free_bincl_list (struct objfile *objfile)
static char * set_namestring (struct objfile *objfile, const struct internal_nlist *nlist)
static CORE_ADDR find_stab_function_addr (char *namestring, const char *filename, struct objfile *objfile)
static void function_outside_compilation_unit_complaint (const char *arg1)
struct partial_symtabend_psymtab (struct objfile *objfile, struct partial_symtab *pst, const char **include_list, int num_includes, int capping_symbol_offset, CORE_ADDR capping_text, struct partial_symtab **dependency_list, int number_dependencies, int textlow_not_set)
static void cp_set_block_scope (const struct symbol *symbol, struct block *block, struct obstack *obstack)
void process_one_symbol (int type, int desc, CORE_ADDR valu, char *name, const struct section_offsets *section_offsets, struct objfile *objfile)
void coffstab_build_psymtabs (struct objfile *objfile, CORE_ADDR textaddr, unsigned int textsize, struct stab_section_list *stabsects, file_ptr stabstroffset, unsigned int stabstrsize)
void elfstab_build_psymtabs (struct objfile *objfile, asection *stabsect, file_ptr stabstroffset, unsigned int stabstrsize)
void stabsect_build_psymtabs (struct objfile *objfile, char *stab_name, char *stabstr_name, char *text_name)

Variables

struct objfile_data * dbx_objfile_data_key
static struct objfiledbxread_objfile
static enum language psymtab_language = language_unknown
static bfd * symfile_bfd
static unsigned symbol_size
static unsigned symbol_table_offset
static unsigned string_table_offset
static unsigned int file_string_table_offset
static unsigned int next_file_string_table_offset
static int symfile_relocatable = 0
static int block_address_function_relative = 0
static CORE_ADDR lowest_text_address
static int has_line_numbers
static struct
header_file_location
bincl_list
static struct
header_file_location
next_bincl
static int bincls_allocated
static struct external_nlist symbuf [4096]
static int symbuf_idx
static int symbuf_end
static char * last_function_name
static char * stringtab_global
static struct stab_section_listsymbuf_sections
static unsigned int symbuf_left
static unsigned int symbuf_read
static bfd_byte * stabs_data
static struct sym_fns aout_sym_fns

Define Documentation

#define COFF_STABS_SYMBOL_SIZE   12 /* XXX FIXME XXX */

Referenced by coffstab_build_psymtabs().

#define DBX_STRINGTAB_SIZE_SIZE   sizeof(long) /* FIXME */

Definition at line 613 of file dbxread.c.

Referenced by dbx_symfile_init().

#define ELF_STABS_SYMBOL_SIZE   12 /* XXX FIXME XXX */

Referenced by elfstab_build_psymtabs().

#define FILE_STRING_OFFSET (   p)    (SYMLOC(p)->file_string_offset)

Definition at line 108 of file dbxread.c.

Referenced by dbx_psymtab_to_symtab_1(), and start_psymtab().

#define INTERNALIZE_SYMBOL (   intern,
  extern,
  abfd 
)
Value:
{                                                                       \
    (intern).n_strx = bfd_h_get_32 (abfd, (extern)->e_strx);            \
    (intern).n_type = bfd_h_get_8 (abfd, (extern)->e_type);             \
    (intern).n_other = 0;                                               \
    (intern).n_desc = bfd_h_get_16 (abfd, (extern)->e_desc);            \
    if (bfd_get_sign_extend_vma (abfd))                                 \
      (intern).n_value = bfd_h_get_signed_32 (abfd, (extern)->e_value); \
    else                                                                \
      (intern).n_value = bfd_h_get_32 (abfd, (extern)->e_value);        \
  }

Definition at line 855 of file dbxread.c.

Referenced by dbx_next_symbol_text(), read_dbx_symtab(), and read_ofile_symtab().

#define LDSYMLEN (   p)    (((struct symloc *)((p)->read_symtab_private))->ldsymlen)
#define LDSYMOFF (   p)    (((struct symloc *)((p)->read_symtab_private))->ldsymoff)

Definition at line 102 of file dbxread.c.

Referenced by end_psymtab(), read_ofile_symtab(), and start_psymtab().

#define STRING_OFFSET (   p)    (SYMLOC(p)->string_offset)

Definition at line 107 of file dbxread.c.

Referenced by start_psymtab().

#define STRING_TABLE_OFFSET   (sym_bfd->origin + obj_str_filepos (sym_bfd))

Referenced by dbx_symfile_init().

#define SYMBOL_OFFSET (   p)    (SYMLOC(p)->symbol_offset)

Definition at line 106 of file dbxread.c.

Referenced by dbx_psymtab_to_symtab_1(), and start_psymtab().

#define SYMBOL_SIZE (   p)    (SYMLOC(p)->symbol_size)

Definition at line 105 of file dbxread.c.

Referenced by dbx_psymtab_to_symtab_1(), and start_psymtab().

#define SYMBOL_TABLE_OFFSET   (sym_bfd->origin + obj_sym_filepos (sym_bfd))

Referenced by dbx_symfile_init().

#define SYMLOC (   p)    ((struct symloc *)((p)->read_symtab_private))

Definition at line 104 of file dbxread.c.


Function Documentation

void _initialize_dbxread ( void  )
static void add_bincl_to_list ( struct partial_symtab pst,
char *  name,
int  instance 
) [static]
static void add_new_header_file ( char *  name,
int  instance 
) [static]
static void add_old_header_file ( char *  name,
int  instance 
) [static]
static void add_this_object_header_file ( int  i) [static]
void coffstab_build_psymtabs ( struct objfile objfile,
CORE_ADDR  textaddr,
unsigned int  textsize,
struct stab_section_list stabsects,
file_ptr  stabstroffset,
unsigned int  stabstrsize 
)
static void cp_set_block_scope ( const struct symbol symbol,
struct block block,
struct obstack *  obstack 
) [static]

Definition at line 2681 of file dbxread.c.

References block_set_scope(), cp_entire_prefix_len(), name, and SYMBOL_DEMANGLED_NAME.

Referenced by process_one_symbol().

static void dbx_free_symfile_info ( struct objfile objfile,
void *  arg 
) [static]
static void dbx_new_init ( struct objfile ignore) [static]

Definition at line 592 of file dbxread.c.

References buildsym_new_init(), init_header_files(), and stabsread_new_init().

static char * dbx_next_symbol_text ( struct objfile objfile) [static]
static void dbx_psymtab_to_symtab_1 ( struct objfile objfile,
struct partial_symtab pst 
) [static]
static void dbx_read_symtab ( struct partial_symtab self,
struct objfile objfile 
) [static]
static void dbx_symfile_finish ( struct objfile objfile) [static]

Definition at line 733 of file dbxread.c.

References free_header_files().

static void dbx_symfile_init ( struct objfile objfile) [static]
static void dbx_symfile_read ( struct objfile objfile,
int  symfile_flags 
) [static]
static void do_free_bincl_list_cleanup ( void *  objfile) [static]

Definition at line 952 of file dbxread.c.

References free_bincl_list().

Referenced by make_cleanup_free_bincl_list().

void elfstab_build_psymtabs ( struct objfile objfile,
asection *  stabsect,
file_ptr  stabstroffset,
unsigned int  stabstrsize 
)
struct partial_symtab* end_psymtab ( struct objfile objfile,
struct partial_symtab pst,
const char **  include_list,
int  num_includes,
int  capping_symbol_offset,
CORE_ADDR  capping_text,
struct partial_symtab **  dependency_list,
int  number_dependencies,
int  textlow_not_set 
) [read]
static void fill_symbuf ( bfd *  sym_bfd) [static]
static struct partial_symtab * find_corresponding_bincl_psymtab ( char *  name,
int  instance 
) [static, read]
static CORE_ADDR find_stab_function_addr ( char *  namestring,
const char *  filename,
struct objfile objfile 
) [static]

Definition at line 1134 of file dbxread.c.

References lookup_minimal_symbol(), p, strchr(), and SYMBOL_VALUE_ADDRESS.

Referenced by process_one_symbol(), and read_dbx_symtab().

static void find_text_range ( bfd *  sym_bfd,
struct objfile objfile 
) [static]

Definition at line 204 of file dbxread.c.

References _, DBX_TEXT_ADDR, DBX_TEXT_SIZE, and error().

Referenced by elfstab_build_psymtabs().

static void free_bincl_list ( struct objfile objfile) [static]

Definition at line 945 of file dbxread.c.

References bincls_allocated, and xfree().

Referenced by do_free_bincl_list_cleanup().

void free_header_files ( void  )
static void function_outside_compilation_unit_complaint ( const char *  arg1) [static]

Definition at line 1178 of file dbxread.c.

References _, complaint(), and symfile_complaints.

Referenced by read_dbx_symtab().

static void init_bincl_list ( int  number,
struct objfile objfile 
) [static]

Definition at line 897 of file dbxread.c.

References bincls_allocated, and xmalloc().

Referenced by read_dbx_symtab().

void init_header_files ( void  )
static void lbrac_mismatch_complaint ( int  arg1) [static]

Definition at line 179 of file dbxread.c.

References _, complaint(), and symfile_complaints.

Referenced by process_one_symbol().

static struct cleanup* make_cleanup_free_bincl_list ( struct objfile objfile) [static, read]

Definition at line 958 of file dbxread.c.

References do_free_bincl_list_cleanup(), and make_cleanup().

Referenced by read_dbx_symtab().

void process_one_symbol ( int  type,
int  desc,
CORE_ADDR  valu,
char *  name,
const struct section_offsets section_offsets,
struct objfile objfile 
)
static void read_dbx_dynamic_symtab ( struct objfile objfile) [static]
static void read_dbx_symtab ( struct objfile objfile) [static]

Definition at line 1190 of file dbxread.c.

References _, add_bincl_to_list(), add_psymbol_to_list(), ANOFFSET, complaint(), cp_canonicalize_string(), dbx_next_symbol_text(), DBX_STRINGTAB, DBX_SYMCOUNT, DBX_TEXT_ADDR, DBX_TEXT_SIZE, deduce_language_from_filename(), partial_symtab::dirname, do_cleanups(), end_psymtab(), error(), file_string_table_offset, partial_symtab::filename, fill_symbuf(), find_corresponding_bincl_psymtab(), find_stab_function_addr(), fprintf_unfiltered(), function_outside_compilation_unit_complaint(), gdb_stderr, gdbarch_sofun_address_maybe_missing(), gdbarch_static_transform_name(), gdbarch_static_transform_name_p(), get_objfile_arch(), objfile::global_psymbols, has_line_numbers, hex_string(), init_bincl_list(), INTERNALIZE_SYMBOL, language_c, language_cplus, language_unknown, LOC_BLOCK, LOC_CONST, LOC_STATIC, LOC_TYPEDEF, lowest_text_address, make_cleanup_free_bincl_list(), memcpy(), name, psymbol_allocation_list::next, next_file_string_table_offset, next_symbol_text, next_symbol_text_func, objfile::obfd, objfile::objfile_obstack, OBJSTAT, p, processing_acc_compilation, psymtab_language, QUIT, record_minimal_symbol(), objfile::sect_index_data, SECT_OFF_BSS, SECT_OFF_DATA, SECT_OFF_RODATA, SECT_OFF_TEXT, objfile::section_offsets, set_last_source_file(), set_namestring(), start_psymtab(), objfile::static_psymbols, strchr(), STRUCT_DOMAIN, symbol_size, symbuf, symfile_bfd, symfile_complaints, symnum, partial_symtab::texthigh, partial_symtab::textlow, unknown_symtype_complaint(), VAR_DOMAIN, xfree(), and xmalloc().

Referenced by dbx_symfile_read().

static void read_ofile_symtab ( struct objfile objfile,
struct partial_symtab pst 
) [static]
static void record_minimal_symbol ( const char *  name,
CORE_ADDR  address,
int  type,
struct objfile objfile 
) [static]
static void repeated_header_complaint ( const char *  arg1,
int  arg2 
) [static]

Definition at line 186 of file dbxread.c.

References _, complaint(), and symfile_complaints.

Referenced by add_old_header_file(), and find_corresponding_bincl_psymtab().

static char* set_namestring ( struct objfile objfile,
const struct internal_nlist *  nlist 
) [static]
static void stabs_seek ( int  sym_offset) [static]

Definition at line 844 of file dbxread.c.

References symfile_bfd.

Referenced by read_ofile_symtab().

void stabsect_build_psymtabs ( struct objfile objfile,
char *  stab_name,
char *  stabstr_name,
char *  text_name 
)
static struct partial_symtab * start_psymtab ( struct objfile objfile,
char *  filename,
CORE_ADDR  textlow,
int  ldsymoff,
struct partial_symbol **  global_syms,
struct partial_symbol **  static_syms 
) [static, read]
static void unknown_symtype_complaint ( const char *  arg1) [static]

Definition at line 173 of file dbxread.c.

References _, complaint(), and symfile_complaints.

Referenced by process_one_symbol(), and read_dbx_symtab().


Variable Documentation

struct sym_fns aout_sym_fns [static]
struct header_file_location* bincl_list [static]

Definition at line 256 of file dbxread.c.

Referenced by add_bincl_to_list().

Definition at line 257 of file dbxread.c.

Referenced by add_bincl_to_list(), free_bincl_list(), and init_bincl_list().

Definition at line 155 of file dbxread.c.

Referenced by dbx_symfile_read(), and process_one_symbol().

struct objfile_data* dbx_objfile_data_key
struct objfile* dbxread_objfile [static]

Definition at line 113 of file dbxread.c.

unsigned int file_string_table_offset [static]

Definition at line 168 of file dbxread.c.

Referenced by end_psymtab(), and read_dbx_symtab().

char* last_function_name [static]

Definition at line 768 of file dbxread.c.

Referenced by end_psymtab().

Definition at line 163 of file dbxread.c.

Referenced by read_dbx_symtab(), and record_minimal_symbol().

struct header_file_location * next_bincl [static]

Definition at line 256 of file dbxread.c.

Referenced by find_corresponding_bincl_psymtab().

Definition at line 144 of file dbxread.c.

Referenced by read_dbx_symtab().

Definition at line 117 of file dbxread.c.

Referenced by read_dbx_symtab(), and start_psymtab().

bfd_byte* stabs_data [static]

Definition at line 788 of file dbxread.c.

unsigned string_table_offset [static]

Definition at line 135 of file dbxread.c.

Referenced by start_psymtab().

char* stringtab_global [static]

Definition at line 777 of file dbxread.c.

unsigned symbol_size [static]
unsigned symbol_table_offset [static]

Definition at line 131 of file dbxread.c.

Referenced by dbx_symfile_read(), fill_symbuf(), and start_psymtab().

struct external_nlist symbuf[4096] [static]

Definition at line 762 of file dbxread.c.

Referenced by dbx_next_symbol_text(), fill_symbuf(), read_dbx_symtab(), and read_ofile_symtab().

int symbuf_end [static]

Definition at line 764 of file dbxread.c.

int symbuf_idx [static]

Definition at line 763 of file dbxread.c.

Referenced by read_ofile_symtab().

unsigned int symbuf_left [static]

Definition at line 783 of file dbxread.c.

Referenced by fill_symbuf().

unsigned int symbuf_read [static]

Definition at line 784 of file dbxread.c.

Referenced by fill_symbuf().

Definition at line 782 of file dbxread.c.

bfd* symfile_bfd [static]

Definition at line 121 of file dbxread.c.

Referenced by dbx_next_symbol_text(), read_dbx_symtab(), read_ofile_symtab(), and stabs_seek().

int symfile_relocatable = 0 [static]

Definition at line 150 of file dbxread.c.

Referenced by dbx_symfile_read(), and process_one_symbol().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines