GDB (xrefs)
Classes | Macros | Functions | Variables
/tmp/gdb-8.1/gdb/buildsym.c File Reference
#include "defs.h"
#include "bfd.h"
#include "gdb_obstack.h"
#include "symtab.h"
#include "symfile.h"
#include "objfiles.h"
#include "gdbtypes.h"
#include "complaints.h"
#include "expression.h"
#include "bcache.h"
#include "filenames.h"
#include "macrotab.h"
#include "demangle.h"
#include "block.h"
#include "cp-support.h"
#include "dictionary.h"
#include "addrmap.h"
#include <algorithm>
#include "buildsym.h"
#include "stabsread.h"

Go to the source code of this file.

Classes

struct  buildsym_compunit
 
struct  pending_block
 
struct  subfile_stack
 

Macros

#define EXTERN
 
#define INITIAL_CONTEXT_STACK_SIZE   10
 
#define INITIAL_LINE_VECTOR_LENGTH   1000
 

Functions

static void free_buildsym_compunit (void)
 
static int compare_line_numbers (const void *ln1p, const void *ln2p)
 
static void record_pending_block (struct objfile *objfile, struct block *block, struct pending_block *opblock)
 
void add_symbol_to_list (struct symbol *symbol, struct pending **listhead)
 
struct symbolfind_symbol_in_list (struct pending *list, char *name, int length)
 
void free_pending_blocks (void)
 
static struct blockfinish_block_internal (struct symbol *symbol, struct pending **listhead, struct pending_block *old_blocks, const struct dynamic_prop *static_link, CORE_ADDR start, CORE_ADDR end, int is_global, int expandable)
 
struct blockfinish_block (struct symbol *symbol, struct pending **listhead, struct pending_block *old_blocks, const struct dynamic_prop *static_link, CORE_ADDR start, CORE_ADDR end)
 
void record_block_range (struct block *block, CORE_ADDR start, CORE_ADDR end_inclusive)
 
static struct blockvectormake_blockvector (void)
 
void start_subfile (const char *name)
 
static struct buildsym_compunitstart_buildsym_compunit (struct objfile *objfile, const char *comp_dir, enum language language)
 
void patch_subfile_names (struct subfile *subfile, const char *name)
 
void push_subfile (void)
 
char * pop_subfile (void)
 
void record_line (struct subfile *subfile, int line, CORE_ADDR pc)
 
struct compunit_symtabbuildsym_compunit_symtab (void)
 
struct macro_tableget_macro_table (void)
 
static void prepare_for_building (const char *name, CORE_ADDR start_addr)
 
struct compunit_symtabstart_symtab (struct objfile *objfile, const char *name, const char *comp_dir, CORE_ADDR start_addr, enum language language)
 
void restart_symtab (struct compunit_symtab *cust, const char *name, CORE_ADDR start_addr)
 
static void watch_main_source_file_lossage (void)
 
static void reset_symtab_globals (void)
 
struct blockend_symtab_get_static_block (CORE_ADDR end_addr, int expandable, int required)
 
static struct compunit_symtabend_symtab_with_blockvector (struct block *static_block, int section, int expandable)
 
struct compunit_symtabend_symtab_from_static_block (struct block *static_block, int section, int expandable)
 
struct compunit_symtabend_symtab (CORE_ADDR end_addr, int section)
 
struct compunit_symtabend_expandable_symtab (CORE_ADDR end_addr, int section)
 
static void set_missing_symtab (struct pending *pending_list, struct compunit_symtab *cu)
 
void augment_type_symtab (void)
 
struct context_stackpush_context (int desc, CORE_ADDR valu)
 
struct context_stackpop_context (void)
 
int hashname (const char *name)
 
void record_debugformat (const char *format)
 
void record_producer (const char *producer)
 
void merge_symbol_lists (struct pending **srclist, struct pending **targetlist)
 
void set_last_source_file (const char *name)
 
const char * get_last_source_file (void)
 
void buildsym_init (void)
 
void buildsym_new_init (void)
 

Variables

static struct buildsym_compunitbuildsym_compunit
 
static struct pendingfree_pendings
 
static int have_line_numbers
 
static struct addrmappending_addrmap
 
static struct obstack pending_addrmap_obstack
 
static int pending_addrmap_interesting
 
static struct obstack pending_block_obstack
 
static struct pending_blockpending_blocks
 
static struct subfile_stacksubfile_stack
 
static struct macro_tablepending_macros
 
static char * last_source_file
 

Macro Definition Documentation

◆ EXTERN

#define EXTERN

Definition at line 88 of file buildsym.c.

◆ INITIAL_CONTEXT_STACK_SIZE

#define INITIAL_CONTEXT_STACK_SIZE   10

Definition at line 207 of file buildsym.c.

Referenced by buildsym_init().

◆ INITIAL_LINE_VECTOR_LENGTH

#define INITIAL_LINE_VECTOR_LENGTH   1000

Definition at line 208 of file buildsym.c.

Referenced by record_line().

Function Documentation

◆ add_symbol_to_list()

void add_symbol_to_list ( struct symbol symbol,
struct pending **  listhead 
)

◆ augment_type_symtab()

void augment_type_symtab ( void  )

◆ buildsym_compunit_symtab()

struct compunit_symtab* buildsym_compunit_symtab ( void  )

Definition at line 986 of file buildsym.c.

References buildsym_compunit::compunit_symtab, and gdb_assert.

Referenced by dwarf_decode_lines().

◆ buildsym_init()

void buildsym_init ( void  )

◆ buildsym_new_init()

void buildsym_new_init ( void  )

◆ compare_line_numbers()

static int compare_line_numbers ( const void *  ln1p,
const void *  ln2p 
)
static

Definition at line 965 of file buildsym.c.

References linetable_entry::line, and linetable_entry::pc.

Referenced by end_symtab_with_blockvector().

◆ end_expandable_symtab()

struct compunit_symtab* end_expandable_symtab ( CORE_ADDR  end_addr,
int  section 
)

Definition at line 1547 of file buildsym.c.

References end_symtab_from_static_block(), and end_symtab_get_static_block().

Referenced by process_full_type_unit().

◆ end_symtab()

struct compunit_symtab* end_symtab ( CORE_ADDR  end_addr,
int  section 
)

◆ end_symtab_from_static_block()

struct compunit_symtab* end_symtab_from_static_block ( struct block static_block,
int  section,
int  expandable 
)

◆ end_symtab_get_static_block()

struct block* end_symtab_get_static_block ( CORE_ADDR  end_addr,
int  expandable,
int  required 
)

◆ end_symtab_with_blockvector()

static struct compunit_symtab* end_symtab_with_blockvector ( struct block static_block,
int  section,
int  expandable 
)
static

◆ find_symbol_in_list()

struct symbol* find_symbol_in_list ( struct pending list,
char *  name,
int  length 
)

Definition at line 250 of file buildsym.c.

References name, pending::next, pending::nsyms, pending::symbol, and SYMBOL_LINKAGE_NAME.

Referenced by patch_block_stabs().

◆ finish_block()

struct block* finish_block ( struct symbol symbol,
struct pending **  listhead,
struct pending_block old_blocks,
const struct dynamic_prop static_link,
CORE_ADDR  start,
CORE_ADDR  end 
)

◆ finish_block_internal()

static struct block* finish_block_internal ( struct symbol symbol,
struct pending **  listhead,
struct pending_block old_blocks,
const struct dynamic_prop static_link,
CORE_ADDR  start,
CORE_ADDR  end,
int  is_global,
int  expandable 
)
static

◆ free_buildsym_compunit()

static void free_buildsym_compunit ( void  )
static

◆ free_pending_blocks()

void free_pending_blocks ( void  )

◆ get_last_source_file()

const char* get_last_source_file ( void  )

◆ get_macro_table()

struct macro_table* get_macro_table ( void  )

◆ hashname()

int hashname ( const char *  name)

◆ make_blockvector()

static struct blockvector* make_blockvector ( void  )
static

◆ merge_symbol_lists()

void merge_symbol_lists ( struct pending **  srclist,
struct pending **  targetlist 
)

Definition at line 1698 of file buildsym.c.

References add_symbol_to_list(), free_pendings, and merge_symbol_lists().

Referenced by merge_symbol_lists().

◆ patch_subfile_names()

void patch_subfile_names ( struct subfile subfile,
const char *  name 
)

◆ pop_context()

struct context_stack* pop_context ( void  )

◆ pop_subfile()

char* pop_subfile ( void  )

◆ prepare_for_building()

static void prepare_for_building ( const char *  name,
CORE_ADDR  start_addr 
)
static

◆ push_context()

struct context_stack* push_context ( int  desc,
CORE_ADDR  valu 
)

◆ push_subfile()

void push_subfile ( void  )

◆ record_block_range()

void record_block_range ( struct block block,
CORE_ADDR  start,
CORE_ADDR  end_inclusive 
)

◆ record_debugformat()

void record_debugformat ( const char *  format)

◆ record_line()

void record_line ( struct subfile subfile,
int  line,
CORE_ADDR  pc 
)

◆ record_pending_block()

static void record_pending_block ( struct objfile objfile,
struct block block,
struct pending_block opblock 
)
static

◆ record_producer()

void record_producer ( const char *  producer)

Definition at line 1684 of file buildsym.c.

References buildsym_compunit::producer.

Referenced by dwarf2_start_symtab().

◆ reset_symtab_globals()

static void reset_symtab_globals ( void  )
static

◆ restart_symtab()

void restart_symtab ( struct compunit_symtab cust,
const char *  name,
CORE_ADDR  start_addr 
)

◆ set_last_source_file()

void set_last_source_file ( const char *  name)

◆ set_missing_symtab()

static void set_missing_symtab ( struct pending pending_list,
struct compunit_symtab cu 
)
static

◆ start_buildsym_compunit()

static struct buildsym_compunit* start_buildsym_compunit ( struct objfile objfile,
const char *  comp_dir,
enum language  language 
)
static

◆ start_subfile()

void start_subfile ( const char *  name)

◆ start_symtab()

struct compunit_symtab* start_symtab ( struct objfile objfile,
const char *  name,
const char *  comp_dir,
CORE_ADDR  start_addr,
enum language language   
)

◆ watch_main_source_file_lossage()

static void watch_main_source_file_lossage ( void  )
static

Variable Documentation

◆ buildsym_compunit

Definition at line 136 of file buildsym.c.

Referenced by start_subfile().

◆ free_pendings

struct pending* free_pendings
static

◆ have_line_numbers

int have_line_numbers
static

◆ last_source_file

char* last_source_file
static

Definition at line 1722 of file buildsym.c.

Referenced by get_last_source_file(), and set_last_source_file().

◆ pending_addrmap

struct addrmap* pending_addrmap
static

◆ pending_addrmap_interesting

int pending_addrmap_interesting
static

Definition at line 161 of file buildsym.c.

Referenced by buildsym_init(), make_blockvector(), and record_block_range().

◆ pending_addrmap_obstack

struct obstack pending_addrmap_obstack
static

◆ pending_block_obstack

struct obstack pending_block_obstack
static

Definition at line 165 of file buildsym.c.

Referenced by free_pending_blocks(), and record_pending_block().

◆ pending_blocks

struct pending_block* pending_blocks
static

◆ pending_macros

struct macro_table* pending_macros
static

◆ subfile_stack

struct subfile_stack* subfile_stack
static

Definition at line 189 of file buildsym.c.

Referenced by pop_subfile(), and push_subfile().