From 989d9cbac846036a85f6c7160e3ee9a534d0cfc5 Mon Sep 17 00:00:00 2001 From: Jim Kingdon Date: Fri, 21 Apr 1995 13:19:22 +0000 Subject: [PATCH] * dwarfread.c (struct dwfinfo), dbxread.c (struct symloc), mdebugread.c (struct symloc), hpread.c (struct symloc): Clean up comments. --- gdb/ChangeLog | 6 ++++++ gdb/dbxread.c | 51 +++++++++++++++++++++++++++++------------------- gdb/dwarfread.c | 49 ++++++++++++++++++++-------------------------- gdb/hpread.c | 32 ++++++++++++++++-------------- gdb/mdebugread.c | 34 ++++++++++++++++---------------- 5 files changed, 92 insertions(+), 80 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2dcfe69f03e..df8106c66f6 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +Thu Apr 20 10:12:21 1995 Jim Kingdon (kingdon@lioth.cygnus.com) + + * dwarfread.c (struct dwfinfo), dbxread.c (struct symloc), + mdebugread.c (struct symloc), hpread.c (struct symloc): Clean + up comments. + Wed Apr 19 16:58:11 1995 Stu Grossman (grossman@andros.cygnus.com) * hppa-tdep.c (deposit_17): New routine to deposit 17 bit diff --git a/gdb/dbxread.c b/gdb/dbxread.c index e7793667528..927a0e1de8a 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -69,37 +69,47 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define SEEK_SET 0 #define SEEK_CUR 1 #endif - + /* Each partial symbol table entry contains a pointer to private data for the - read_symtab() function to use when expanding a partial symbol table entry - to a full symbol table entry. + sym_read function to use when expanding a partial symbol table entry + to a full symbol table entry. */ - For dbxread this structure contains the offset within the file symbol table - of first local symbol for this file, and length (in bytes) of the section - of the symbol table devoted to this file's symbols (actually, the section - bracketed may contain more than just this file's symbols). It also contains - further information needed to locate the symbols if they are in an ELF file. - - If ldsymlen is 0, the only reason for this thing's existence is the - dependency list. Nothing else will happen when it is read in. */ +struct symloc { -#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) + /* Offset within the file symbol table of first local symbol for this + file. */ -struct symloc { int ldsymoff; + + /* Length (in bytes) of the section of the symbol table devoted to + this file's symbols (actually, the section bracketed may contain + more than just this file's symbols). If ldsymlen is 0, the only + reason for this thing's existence is the dependency list. Nothing + else will happen when it is read in. */ + int ldsymlen; + + /* The size of each symbol in the symbol file (in external form). */ + int symbol_size; + + /* Further information needed to locate the symbols if they are in + an ELF file. */ + int symbol_offset; int string_offset; int file_string_offset; }; +#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) + + /* Macro to determine which symbols to ignore when reading the first symbol of a file. Some machines override this definition. */ #ifndef IGNORE_SYMBOL @@ -2050,7 +2060,8 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile) #ifdef SOFUN_ADDRESS_MAYBE_MISSING /* Deal with the SunPRO 3.0 compiler which omits the address from N_FUN symbols. */ - if (type == N_FUN && valu == 0) + if (type == N_FUN + && valu == ANOFFSET (section_offsets, SECT_OFF_TEXT)) { struct minimal_symbol *msym; char *p; diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c index c059ad934f3..7b2cf638771 100644 --- a/gdb/dwarfread.c +++ b/gdb/dwarfread.c @@ -343,36 +343,29 @@ static CORE_ADDR baseaddr; /* Add to each symbol value */ static struct section_offsets *base_section_offsets; /* Each partial symbol table entry contains a pointer to private data for the - read_symtab() function to use when expanding a partial symbol table entry - to a full symbol table entry. For DWARF debugging info, this data is - contained in the following structure and macros are provided for easy - access to the members given a pointer to a partial symbol table entry. - - dbfoff Always the absolute file offset to the start of the ".debug" - section for the file containing the DIE's being accessed. - - dbroff Relative offset from the start of the ".debug" access to the - first DIE to be accessed. When building the partial symbol - table, this value will be zero since we are accessing the - entire ".debug" section. When expanding a partial symbol - table entry, this value will be the offset to the first - DIE for the compilation unit containing the symbol that - triggers the expansion. - - dblength The size of the chunk of DIE's being examined, in bytes. - - lnfoff The absolute file offset to the line table fragment. Ignored - when building partial symbol tables, but used when expanding - them, and contains the absolute file offset to the fragment - of the ".line" section containing the line numbers for the - current compilation unit. - */ + sym_read function to use when expanding a partial symbol table entry + to a full symbol table entry. */ struct dwfinfo { - file_ptr dbfoff; /* Absolute file offset to start of .debug section */ - int dbroff; /* Relative offset from start of .debug section */ - int dblength; /* Size of the chunk of DIE's being examined */ - file_ptr lnfoff; /* Absolute file offset to line table fragment */ + /* Always the absolute file offset to the start of the ".debug" + section for the file containing the DIE's being accessed. */ + file_ptr dbfoff; + /* Relative offset from the start of the ".debug" section to the + first DIE to be accessed. When building the partial symbol + table, this value will be zero since we are accessing the + entire ".debug" section. When expanding a partial symbol + table entry, this value will be the offset to the first + DIE for the compilation unit containing the symbol that + triggers the expansion. */ + int dbroff; + /* The size of the chunk of DIE's being examined, in bytes. */ + int dblength; + /* The absolute file offset to the line table fragment. Ignored + when building partial symbol tables, but used when expanding + them, and contains the absolute file offset to the fragment + of the ".line" section containing the line numbers for the + current compilation unit. */ + file_ptr lnfoff; }; #define DBFOFF(p) (((struct dwfinfo *)((p)->read_symtab_private))->dbfoff) diff --git a/gdb/hpread.c b/gdb/hpread.c index bc8f83408ee..05a659a54b9 100644 --- a/gdb/hpread.c +++ b/gdb/hpread.c @@ -99,29 +99,31 @@ struct hpread_symfile_info } \ else \ *NAMEP = (SYM)->dsfile.name + VT (OBJFILE) - + /* Each partial symbol table entry contains a pointer to private data for the - read_symtab() function to use when expanding a partial symbol table entry - to a full symbol table entry. - - For hpuxread this structure contains the offset within the file symbol table - of first local symbol for this file, and length (in bytes) of the section - of the symbol table devoted to this file's symbols (actually, the section - bracketed may contain more than just this file's symbols). - - If ldsymlen is 0, the only reason for this thing's existence is the - dependency list. Nothing else will happen when it is read in. */ - -#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)) + sym_read function to use when expanding a partial symbol table entry + to a full symbol table entry. */ struct symloc { + /* The offset within the file symbol table of first local symbol for + this file. */ + int ldsymoff; + + /* Length (in bytes) of the section of the symbol table devoted to + this file's symbols (actually, the section bracketed may contain + more than just this file's symbols). If ldsymlen is 0, the only + reason for this thing's existence is the dependency list. + Nothing else will happen when it is read in. */ + int ldsymlen; }; +#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)) + /* FIXME: Shouldn't this stuff be in a .h file somewhere? */ /* Nonzero means give verbose info on gdb action. */ extern int info_verbose; diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index 7bf8e4f8197..9499f665cd1 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -97,34 +97,34 @@ typedef struct mips_extra_func_info { #ifndef ECOFF_REG_TO_REGNUM #define ECOFF_REG_TO_REGNUM(num) (num) #endif - -/* Each partial symbol table entry contains a pointer to private data - for the read_symtab() function to use when expanding a partial - symbol table entry to a full symbol table entry. - - For mdebugread this structure contains the index of the FDR that this - psymtab represents and a pointer to the BFD that the psymtab was - created from. */ - -#define PST_PRIVATE(p) ((struct symloc *)(p)->read_symtab_private) -#define FDR_IDX(p) (PST_PRIVATE(p)->fdr_idx) -#define CUR_BFD(p) (PST_PRIVATE(p)->cur_bfd) -#define DEBUG_SWAP(p) (PST_PRIVATE(p)->debug_swap) -#define DEBUG_INFO(p) (PST_PRIVATE(p)->debug_info) -#define PENDING_LIST(p) (PST_PRIVATE(p)->pending_list) + +/* Each partial symbol table entry contains a pointer to private data for the + sym_read function to use when expanding a partial symbol table entry + to a full symbol table entry. */ struct symloc { + /* Index of the FDR that this psymtab represents. */ int fdr_idx; + /* The BFD that the psymtab was created from. */ bfd *cur_bfd; const struct ecoff_debug_swap *debug_swap; struct ecoff_debug_info *debug_info; struct mdebug_pending **pending_list; - EXTR *extern_tab; /* Pointer to external symbols for this file. */ - int extern_count; /* Size of extern_tab. */ + /* Pointer to external symbols for this file. */ + EXTR *extern_tab; + /* Size of extern_tab. */ + int extern_count; enum language pst_language; }; +#define PST_PRIVATE(p) ((struct symloc *)(p)->read_symtab_private) +#define FDR_IDX(p) (PST_PRIVATE(p)->fdr_idx) +#define CUR_BFD(p) (PST_PRIVATE(p)->cur_bfd) +#define DEBUG_SWAP(p) (PST_PRIVATE(p)->debug_swap) +#define DEBUG_INFO(p) (PST_PRIVATE(p)->debug_info) +#define PENDING_LIST(p) (PST_PRIVATE(p)->pending_list) + /* Things we import explicitly from other modules */ extern int info_verbose; -- 2.30.2