diff options
Diffstat (limited to 'gdb/symtab.h')
-rw-r--r-- | gdb/symtab.h | 100 |
1 files changed, 94 insertions, 6 deletions
diff --git a/gdb/symtab.h b/gdb/symtab.h index 6d1b22e..f54cc5b 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -108,8 +108,14 @@ struct general_symbol_info also tries to set it correctly). */ short section; + + /* The bfd section associated with this symbol. */ + + asection *bfd_section; }; +extern CORE_ADDR symbol_overlayed_address PARAMS((CORE_ADDR, asection *)); + #define SYMBOL_NAME(symbol) (symbol)->ginfo.name #define SYMBOL_VALUE(symbol) (symbol)->ginfo.value.ivalue #define SYMBOL_VALUE_ADDRESS(symbol) (symbol)->ginfo.value.address @@ -118,6 +124,7 @@ struct general_symbol_info #define SYMBOL_VALUE_CHAIN(symbol) (symbol)->ginfo.value.chain #define SYMBOL_LANGUAGE(symbol) (symbol)->ginfo.language #define SYMBOL_SECTION(symbol) (symbol)->ginfo.section +#define SYMBOL_BFD_SECTION(symbol) (symbol)->ginfo.bfd_section #define SYMBOL_CPLUS_DEMANGLED_NAME(symbol) \ (symbol)->ginfo.language_specific.cplus_specific.demangled_name @@ -320,7 +327,6 @@ struct minimal_symbol mst_file_data, /* Static version of mst_data */ mst_file_bss /* Static version of mst_bss */ } type BYTE_BITFIELD; - }; #define MSYMBOL_INFO(msymbol) (msymbol)->info @@ -591,6 +597,11 @@ struct symbol /* Name space code. */ +#ifdef __MFC4__ + /* FIXME: don't conflict with C++'s namespace */ + /* would be safer to do a global change for all namespace identifiers. */ + #define namespace _namespace +#endif namespace_enum namespace BYTE_BITFIELD; /* Address class */ @@ -981,17 +992,27 @@ extern int currently_reading_symtab; extern int demangle; extern int asm_demangle; +/* symtab.c lookup functions */ + +/* lookup a symbol table by source file name */ + extern struct symtab * lookup_symtab PARAMS ((char *)); +/* lookup a symbol by name (optional block, optional symtab) */ + extern struct symbol * lookup_symbol PARAMS ((const char *, const struct block *, const namespace_enum, int *, struct symtab **)); +/* lookup a symbol by name, within a specified block */ + extern struct symbol * lookup_block_symbol PARAMS ((const struct block *, const char *, const namespace_enum)); +/* lookup a [struct, union, enum] by name, within a specified block */ + extern struct type * lookup_struct PARAMS ((char *, struct block *)); @@ -1001,30 +1022,68 @@ lookup_union PARAMS ((char *, struct block *)); extern struct type * lookup_enum PARAMS ((char *, struct block *)); +/* lookup the function corresponding to the block */ + extern struct symbol * block_function PARAMS ((struct block *)); +/* from blockframe.c: */ + +/* lookup the function symbol corresponding to the address */ + extern struct symbol * find_pc_function PARAMS ((CORE_ADDR)); -extern int find_pc_partial_function - PARAMS ((CORE_ADDR, char **, CORE_ADDR *, CORE_ADDR *)); +/* lookup the function corresponding to the address and section */ + +extern struct symbol * +find_pc_sect_function PARAMS ((CORE_ADDR, asection *)); + +/* lookup function from address, return name, start addr and end addr */ + +extern int find_pc_partial_function PARAMS ((CORE_ADDR, char **, + CORE_ADDR *, CORE_ADDR *)); extern void clear_pc_function_cache PARAMS ((void)); +/* from symtab.c: */ + +/* lookup partial symbol table by filename */ + extern struct partial_symtab * lookup_partial_symtab PARAMS ((char *)); +/* lookup partial symbol table by address */ + extern struct partial_symtab * find_pc_psymtab PARAMS ((CORE_ADDR)); +/* lookup partial symbol table by address and section */ + +extern struct partial_symtab * +find_pc_sect_psymtab PARAMS ((CORE_ADDR, asection *)); + +/* lookup full symbol table by address */ + extern struct symtab * find_pc_symtab PARAMS ((CORE_ADDR)); +/* lookup full symbol table by address and section */ + +extern struct symtab * +find_pc_sect_symtab PARAMS ((CORE_ADDR, asection *)); + +/* lookup partial symbol by address */ + extern struct partial_symbol * find_pc_psymbol PARAMS ((struct partial_symtab *, CORE_ADDR)); +/* lookup partial symbol by address and section */ + +extern struct partial_symbol * +find_pc_sect_psymbol PARAMS ((struct partial_symtab *, CORE_ADDR, asection *)); + extern int find_pc_line_pc_range PARAMS ((CORE_ADDR, CORE_ADDR *, CORE_ADDR *)); @@ -1055,6 +1114,7 @@ extern struct minimal_symbol *prim_record_minimal_symbol_and_info PARAMS ((const char *, CORE_ADDR, enum minimal_symbol_type, char *info, int section, + asection *bfd_section, struct objfile *)); #ifdef SOFUN_ADDRESS_MAYBE_MISSING @@ -1078,6 +1138,9 @@ extern struct minimal_symbol * lookup_minimal_symbol_by_pc PARAMS ((CORE_ADDR)); extern struct minimal_symbol * +lookup_minimal_symbol_by_pc_section PARAMS ((CORE_ADDR, asection *)); + +extern struct minimal_symbol * lookup_solib_trampoline_symbol_by_pc PARAMS ((CORE_ADDR)); extern CORE_ADDR @@ -1099,7 +1162,7 @@ extern void msymbols_sort PARAMS ((struct objfile *objfile)); struct symtab_and_line { struct symtab *symtab; - + asection *section; /* Line number. Line numbers start at 1 and proceed through symtab->nlines. 0 is never a valid line number; it is used to indicate that line number information is not available. */ @@ -1109,6 +1172,14 @@ struct symtab_and_line CORE_ADDR end; }; +#define INIT_SAL(sal) { \ + (sal)->symtab = 0; \ + (sal)->section = 0; \ + (sal)->line = 0; \ + (sal)->pc = 0; \ + (sal)->end = 0; \ +} + struct symtabs_and_lines { struct symtab_and_line *sals; @@ -1121,6 +1192,11 @@ struct symtabs_and_lines extern struct symtab_and_line find_pc_line PARAMS ((CORE_ADDR, int)); +/* Same function, but specify a section as well as an address */ + +extern struct symtab_and_line +find_pc_sect_line PARAMS ((CORE_ADDR, asection *, int)); + /* Given an address, return the nearest symbol at or below it in memory. Optionally return the symtab it's from through 2nd arg, and the address in inferior memory of the symbol through 3rd arg. */ @@ -1152,10 +1228,10 @@ decode_line_spec_1 PARAMS ((char *, int)); extern struct symtabs_and_lines decode_line_1 PARAMS ((char **, int, struct symtab *, int, char ***)); -/* Symmisc.c */ - #if MAINTENANCE_CMDS +/* Symmisc.c */ + void maintenance_print_symbols PARAMS ((char *, int)); @@ -1171,6 +1247,11 @@ maintenance_print_objfiles PARAMS ((char *, int)); void maintenance_check_symtabs PARAMS ((char *, int)); +/* maint.c */ + +void +maintenance_print_statistics PARAMS ((char *, int)); + #endif extern void @@ -1213,6 +1294,10 @@ find_main_psymtab PARAMS ((void)); extern struct blockvector * blockvector_for_pc PARAMS ((CORE_ADDR, int *)); + +extern struct blockvector * +blockvector_for_pc_sect PARAMS ((CORE_ADDR, asection *, int *, + struct symtab *)); /* symfile.c */ extern void @@ -1226,4 +1311,7 @@ deduce_language_from_filename PARAMS ((char *)); extern int in_prologue PARAMS ((CORE_ADDR pc, CORE_ADDR func_start)); +extern struct symbol * +fixup_symbol_section PARAMS ((struct symbol *, struct objfile *)); + #endif /* !defined(SYMTAB_H) */ |