X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fobjfiles.h;h=80e61c523489bea337d9cabcb71f13c7a7405792;hb=ecd51ad39f03eccde40cad9b5f69de264f160136;hp=b04abc1056c4c28abed0832f7c06433aacc77fcf;hpb=08c0b5bc8aa9a569238542b6d563b420e7c3261a;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/objfiles.h b/gdb/objfiles.h index b04abc1056..80e61c5234 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -1,6 +1,7 @@ /* Definitions for symbol file management in GDB. - Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 - Free Software Foundation, Inc. + + Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, + 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GDB. @@ -22,7 +23,11 @@ #if !defined (OBJFILES_H) #define OBJFILES_H -#include "bcache.h" +#include "gdb_obstack.h" /* For obstack internals. */ +#include "symfile.h" /* For struct psymbol_allocation_list */ + +struct bcache; +struct htab; /* This structure maintains information on a per-objfile basis about the "entry point" of the objfile, and the scope within which the entry point @@ -60,14 +65,15 @@ confused. However, we almost always have debugging information available for main(). - These variables are used to save the range of PC values which are valid - within the main() function and within the function containing the process - entry point. If we always consider the frame for main() as the outermost - frame when debugging user code, and the frame for the process entry - point function as the outermost frame when debugging startup code, then - all we have to do is have FRAME_CHAIN_VALID return false whenever a - frame's current PC is within the range specified by these variables. - In essence, we set "ceilings" in the frame chain beyond which we will + These variables are used to save the range of PC values which are + valid within the main() function and within the function containing + the process entry point. If we always consider the frame for + main() as the outermost frame when debugging user code, and the + frame for the process entry point function as the outermost frame + when debugging startup code, then all we have to do is have + DEPRECATED_FRAME_CHAIN_VALID return false whenever a frame's + current PC is within the range specified by these variables. In + essence, we set "ceilings" in the frame chain beyond which we will not proceed when following the frame chain back up the stack. A nice side effect is that we can still debug startup code without @@ -78,9 +84,10 @@ information but we do have usable information for main(), backtraces from user code don't go wandering off into the startup code. - To use this method, define your FRAME_CHAIN_VALID macro like: + To use this method, define your DEPRECATED_FRAME_CHAIN_VALID macro + like: - #define FRAME_CHAIN_VALID(chain, thisframe) \ + #define DEPRECATED_FRAME_CHAIN_VALID(chain, thisframe) \ (chain != 0 \ && !(inside_main_func ((thisframe)->pc)) \ && !(inside_entry_func ((thisframe)->pc))) @@ -234,7 +241,8 @@ struct objfile struct objfile *next; - /* The object file's name. Malloc'd; free it if you free this struct. */ + /* The object file's name, tilde-expanded and absolute. + Malloc'd; free it if you free this struct. */ char *name; @@ -278,8 +286,15 @@ struct objfile /* A byte cache where we can stash arbitrary "chunks" of bytes that will not change. */ - struct bcache psymbol_cache; /* Byte cache for partial syms */ - struct bcache macro_cache; /* Byte cache for macros */ + struct bcache *psymbol_cache; /* Byte cache for partial syms */ + struct bcache *macro_cache; /* Byte cache for macros */ + + /* Hash table for mapping symbol names to demangled names. Each + entry in the hash table is actually two consecutive strings, + both null-terminated; the first one is a mangled or linkage + name, and the second is the demangled name or just a zero byte + if the name doesn't demangle. */ + struct htab *demangled_names_hash; /* Vectors of all partial symbols read in from file. The actual data is stored in the psymbol_obstack. */ @@ -324,7 +339,7 @@ struct objfile the memory mapped malloc() package to manage storage for this objfile's data. NULL if we are not. */ - PTR md; + void *md; /* The file descriptor that was used to obtain the mmalloc descriptor for this objfile. If we call mmalloc_detach with the malloc descriptor @@ -355,7 +370,7 @@ struct objfile typically a pointer to malloc'd memory. The symbol reader's finish function is responsible for freeing the memory thusly allocated. */ - PTR sym_private; + void *sym_private; /* Hook for target-architecture-specific information. This must point to memory allocated on one of the obstacks in this objfile, @@ -364,6 +379,13 @@ struct objfile void *obj_private; + /* Per objfile data-pointers required by other GDB modules. */ + /* FIXME: kettenis/20030711: This mechanism could replace + sym_stab_info, sym_private and obj_private entirely. */ + + void **data; + unsigned num_data; + /* Set of relocation offsets to apply to each section. Currently on the psymbol_obstack (which makes no sense, but I'm not sure it's harming anything). @@ -410,6 +432,15 @@ struct objfile ExportEntry *export_list; int export_list_size; + /* Link to objfile that contains the debug symbols for this one. + One is loaded if this file has an debug link to an existing + debug file with the right checksum */ + struct objfile *separate_debug_objfile; + + /* If this is a separate debug object, this is used as a link to the + actual executable objfile. */ + struct objfile *separate_debug_objfile_backlink; + /* Place to stash various statistics about this objfile */ OBJSTATS; }; @@ -501,6 +532,10 @@ extern struct objfile *allocate_objfile (bfd *, int); extern int build_objfile_section_table (struct objfile *); +extern void terminate_minimal_symbol_table (struct objfile *objfile); + +extern void put_objfile_before (struct objfile *, struct objfile *); + extern void objfile_to_front (struct objfile *); extern void unlink_objfile (struct objfile *); @@ -537,6 +572,16 @@ extern int in_plt_section (CORE_ADDR, char *); extern int is_in_import_list (char *, struct objfile *); +/* Keep a registry of per-objfile data-pointers required by other GDB + modules. */ + +extern const struct objfile_data *register_objfile_data (void); +extern void set_objfile_data (struct objfile *objfile, + const struct objfile_data *data, void *value); +extern void *objfile_data (struct objfile *objfile, + const struct objfile_data *data); + + /* Traverse all object files. ALL_OBJFILES_SAFE works even if you delete the objfile during the traversal. */ @@ -561,7 +606,7 @@ extern int is_in_import_list (char *, struct objfile *); /* Traverse all minimal symbols in one objfile. */ #define ALL_OBJFILE_MSYMBOLS(objfile, m) \ - for ((m) = (objfile) -> msymbols; SYMBOL_NAME(m) != NULL; (m)++) + for ((m) = (objfile) -> msymbols; DEPRECATED_SYMBOL_NAME(m) != NULL; (m)++) /* Traverse all symtabs in all objfiles. */ @@ -579,8 +624,7 @@ extern int is_in_import_list (char *, struct objfile *); #define ALL_MSYMBOLS(objfile, m) \ ALL_OBJFILES (objfile) \ - if ((objfile)->msymbols) \ - ALL_OBJFILE_MSYMBOLS (objfile, m) + ALL_OBJFILE_MSYMBOLS (objfile, m) #define ALL_OBJFILE_OSECTIONS(objfile, osect) \ for (osect = objfile->sections; osect < objfile->sections_end; osect++)