GDB (xrefs)
Classes | Macros | Functions | Variables
/tmp/gdb-7.10/gdb/dbxread.c File Reference
#include "defs.h"
#include "gdb_obstack.h"
#include <sys/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 "aout/aout64.h"
#include "aout/stab_gnu.h"

Go to the source code of this file.

Classes

struct  symloc
 
struct  header_file_location
 

Macros

#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

const 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_locationbincl_list
 
static struct header_file_locationnext_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 const struct sym_fns aout_sym_fns
 

Macro Definition 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 608 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 103 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 848 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)

Definition at line 98 of file dbxread.c.

Referenced by dbx_psymtab_to_symtab_1(), dbx_read_symtab(), end_psymtab(), and read_ofile_symtab().

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

Definition at line 97 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 102 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 101 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 100 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 99 of file dbxread.c.

Function Documentation

void _initialize_dbxread ( void  )

Definition at line 3540 of file dbxread.c.

References add_symtab_fns(), dbx_free_symfile_info(), and dbx_objfile_data_key.

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 2645 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 587 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 726 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 945 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 
)
static void fill_symbuf ( bfd *  sym_bfd)
static
static struct partial_symtab * find_corresponding_bincl_psymtab ( char *  name,
int  instance 
)
static
static CORE_ADDR find_stab_function_addr ( char *  namestring,
const char *  filename,
struct objfile objfile 
)
static
static void find_text_range ( bfd *  sym_bfd,
struct objfile objfile 
)
static

Definition at line 199 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 938 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 1163 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 890 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 174 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

Definition at line 951 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 1175 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(), name, psymbol_allocation_list::next, next_file_string_table_offset, next_symbol_text, next_symbol_text_func, objfile::obfd, objfile::objfile_obstack, OBJSTAT, processing_acc_compilation, psymtab_language, QUIT, record_minimal_symbol(), objfile::sect_index_data, SECT_OFF_BSS, SECT_OFF_RODATA, SECT_OFF_TEXT, objfile::section_offsets, set_last_source_file(), set_namestring(), start_psymtab(), objfile::static_psymbols, 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 181 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 837 of file dbxread.c.

References SEEK_CUR, and 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
static void unknown_symtype_complaint ( const char *  arg1)
static

Definition at line 168 of file dbxread.c.

References _, complaint(), and symfile_complaints.

Referenced by process_one_symbol(), and read_dbx_symtab().

Variable Documentation

const struct sym_fns aout_sym_fns
static
Initial value:
=
{
NULL,
NULL,
NULL,
}
struct symfile_segment_data * default_symfile_segments(bfd *abfd)
Definition: symfile.c:812
static void dbx_symfile_init(struct objfile *)
Definition: dbxread.c:611
bfd_byte * default_symfile_relocate(struct objfile *objfile, asection *sectp, bfd_byte *buf)
Definition: symfile.c:3740
static void dbx_symfile_finish(struct objfile *)
Definition: dbxread.c:726
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 dbx_new_init(struct objfile *)
Definition: dbxread.c:587
static void dbx_symfile_read(struct objfile *, int)
Definition: dbxread.c:523

Definition at line 3524 of file dbxread.c.

struct header_file_location* bincl_list
static

Definition at line 251 of file dbxread.c.

Referenced by add_bincl_to_list().

int bincls_allocated
static

Definition at line 252 of file dbxread.c.

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

int block_address_function_relative = 0
static

Definition at line 150 of file dbxread.c.

Referenced by dbx_symfile_read(), and process_one_symbol().

const struct objfile_data* dbx_objfile_data_key
struct objfile* dbxread_objfile
static

Definition at line 108 of file dbxread.c.

unsigned int file_string_table_offset
static
int has_line_numbers
static

Definition at line 163 of file dbxread.c.

Referenced by end_psymtab(), and read_dbx_symtab().

char* last_function_name
static

Definition at line 761 of file dbxread.c.

Referenced by end_psymtab().

CORE_ADDR lowest_text_address
static

Definition at line 158 of file dbxread.c.

Referenced by read_dbx_symtab(), and record_minimal_symbol().

struct header_file_location * next_bincl
static

Definition at line 251 of file dbxread.c.

Referenced by find_corresponding_bincl_psymtab().

unsigned int next_file_string_table_offset
static

Definition at line 139 of file dbxread.c.

Referenced by read_dbx_symtab().

enum language psymtab_language = language_unknown
static

Definition at line 112 of file dbxread.c.

Referenced by read_dbx_symtab(), and start_psymtab().

bfd_byte* stabs_data
static

Definition at line 781 of file dbxread.c.

unsigned string_table_offset
static

Definition at line 130 of file dbxread.c.

Referenced by start_psymtab().

char* stringtab_global
static

Definition at line 770 of file dbxread.c.

unsigned symbol_size
static
unsigned symbol_table_offset
static

Definition at line 126 of file dbxread.c.

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

struct external_nlist symbuf[4096]
static

Definition at line 755 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 757 of file dbxread.c.

int symbuf_idx
static

Definition at line 756 of file dbxread.c.

Referenced by read_ofile_symtab().

unsigned int symbuf_left
static

Definition at line 776 of file dbxread.c.

Referenced by fill_symbuf().

unsigned int symbuf_read
static

Definition at line 777 of file dbxread.c.

Referenced by fill_symbuf().

struct stab_section_list* symbuf_sections
static

Definition at line 775 of file dbxread.c.

bfd* symfile_bfd
static

Definition at line 116 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 145 of file dbxread.c.

Referenced by dbx_symfile_read(), and process_one_symbol().