GDB (API)
/home/stan/gdb/src/gdb/symfile.h
Go to the documentation of this file.
00001 /* Definitions for reading symbol files into GDB.
00002 
00003    Copyright (C) 1990-2013 Free Software Foundation, Inc.
00004 
00005    This file is part of GDB.
00006 
00007    This program is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation; either version 3 of the License, or
00010    (at your option) any later version.
00011 
00012    This program is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015    GNU General Public License for more details.
00016 
00017    You should have received a copy of the GNU General Public License
00018    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
00019 
00020 #if !defined (SYMFILE_H)
00021 #define SYMFILE_H
00022 
00023 /* This file requires that you first include "bfd.h".  */
00024 #include "symtab.h"
00025 #include "probe.h"
00026 
00027 /* Opaque declarations.  */
00028 struct target_section;
00029 struct objfile;
00030 struct obj_section;
00031 struct obstack;
00032 struct block;
00033 struct probe;
00034 struct value;
00035 struct frame_info;
00036 struct agent_expr;
00037 struct axs_value;
00038 
00039 /* Comparison function for symbol look ups.  */
00040 
00041 typedef int (symbol_compare_ftype) (const char *string1,
00042                                     const char *string2);
00043 
00044 /* Partial symbols are stored in the psymbol_cache and pointers to
00045    them are kept in a dynamically grown array that is obtained from
00046    malloc and grown as necessary via realloc.  Each objfile typically
00047    has two of these, one for global symbols and one for static
00048    symbols.  Although this adds a level of indirection for storing or
00049    accessing the partial symbols, it allows us to throw away duplicate
00050    psymbols and set all pointers to the single saved instance.  */
00051 
00052 struct psymbol_allocation_list
00053 {
00054 
00055   /* Pointer to beginning of dynamically allocated array of pointers
00056      to partial symbols.  The array is dynamically expanded as
00057      necessary to accommodate more pointers.  */
00058 
00059   struct partial_symbol **list;
00060 
00061   /* Pointer to next available slot in which to store a pointer to a
00062      partial symbol.  */
00063 
00064   struct partial_symbol **next;
00065 
00066   /* Number of allocated pointer slots in current dynamic array (not
00067      the number of bytes of storage).  The "next" pointer will always
00068      point somewhere between list[0] and list[size], and when at
00069      list[size] the array will be expanded on the next attempt to
00070      store a pointer.  */
00071 
00072   int size;
00073 };
00074 
00075 /* Define an array of addresses to accommodate non-contiguous dynamic
00076    loading of modules.  This is for use when entering commands, so we
00077    can keep track of the section names until we read the file and can
00078    map them to bfd sections.  This structure is also used by solib.c
00079    to communicate the section addresses in shared objects to
00080    symbol_file_add ().  */
00081 
00082 struct section_addr_info
00083 {
00084   /* The number of sections for which address information is
00085      available.  */
00086   size_t num_sections;
00087   /* Sections whose names are file format dependent.  */
00088   struct other_sections
00089   {
00090     CORE_ADDR addr;
00091     char *name;
00092 
00093     /* SECTINDEX must be valid for associated BFD or set to -1.  */
00094     int sectindex;
00095   } other[1];
00096 };
00097 
00098 
00099 /* A table listing the load segments in a symfile, and which segment
00100    each BFD section belongs to.  */
00101 struct symfile_segment_data
00102 {
00103   /* How many segments are present in this file.  If there are
00104      two, the text segment is the first one and the data segment
00105      is the second one.  */
00106   int num_segments;
00107 
00108   /* If NUM_SEGMENTS is greater than zero, the original base address
00109      of each segment.  */
00110   CORE_ADDR *segment_bases;
00111 
00112   /* If NUM_SEGMENTS is greater than zero, the memory size of each
00113      segment.  */
00114   CORE_ADDR *segment_sizes;
00115 
00116   /* If NUM_SEGMENTS is greater than zero, this is an array of entries
00117      recording which segment contains each BFD section.
00118      SEGMENT_INFO[I] is S+1 if the I'th BFD section belongs to segment
00119      S, or zero if it is not in any segment.  */
00120   int *segment_info;
00121 };
00122 
00123 /* Callback for quick_symbol_functions->map_symbol_filenames.  */
00124 
00125 typedef void (symbol_filename_ftype) (const char *filename,
00126                                       const char *fullname, void *data);
00127 
00128 /* The "quick" symbol functions exist so that symbol readers can
00129    avoiding an initial read of all the symbols.  For example, symbol
00130    readers might choose to use the "partial symbol table" utilities,
00131    which is one implementation of the quick symbol functions.
00132 
00133    The quick symbol functions are generally opaque: the underlying
00134    representation is hidden from the caller.
00135 
00136    In general, these functions should only look at whatever special
00137    index the symbol reader creates -- looking through the symbol
00138    tables themselves is handled by generic code.  If a function is
00139    defined as returning a "symbol table", this means that the function
00140    should only return a newly-created symbol table; it should not
00141    examine pre-existing ones.
00142 
00143    The exact list of functions here was determined in an ad hoc way
00144    based on gdb's history.  */
00145 
00146 struct quick_symbol_functions
00147 {
00148   /* Return true if this objfile has any "partial" symbols
00149      available.  */
00150   int (*has_symbols) (struct objfile *objfile);
00151 
00152   /* Return the symbol table for the "last" file appearing in
00153      OBJFILE.  */
00154   struct symtab *(*find_last_source_symtab) (struct objfile *objfile);
00155 
00156   /* Forget all cached full file names for OBJFILE.  */
00157   void (*forget_cached_source_info) (struct objfile *objfile);
00158 
00159   /* Expand and iterate over each "partial" symbol table in OBJFILE
00160      where the source file is named NAME.
00161 
00162      If NAME is not absolute, a match after a '/' in the symbol table's
00163      file name will also work, REAL_PATH is NULL then.  If NAME is
00164      absolute then REAL_PATH is non-NULL absolute file name as resolved
00165      via gdb_realpath from NAME.
00166 
00167      If a match is found, the "partial" symbol table is expanded.
00168      Then, this calls iterate_over_some_symtabs (or equivalent) over
00169      all newly-created symbol tables, passing CALLBACK and DATA to it.
00170      The result of this call is returned.  */
00171   int (*map_symtabs_matching_filename) (struct objfile *objfile,
00172                                         const char *name,
00173                                         const char *real_path,
00174                                         int (*callback) (struct symtab *,
00175                                                          void *),
00176                                         void *data);
00177 
00178   /* Check to see if the symbol is defined in a "partial" symbol table
00179      of OBJFILE.  KIND should be either GLOBAL_BLOCK or STATIC_BLOCK,
00180      depending on whether we want to search global symbols or static
00181      symbols.  NAME is the name of the symbol to look for.  DOMAIN
00182      indicates what sort of symbol to search for.
00183 
00184      Returns the newly-expanded symbol table in which the symbol is
00185      defined, or NULL if no such symbol table exists.  If OBJFILE
00186      contains !TYPE_OPAQUE symbol prefer its symtab.  If it contains
00187      only TYPE_OPAQUE symbol(s), return at least that symtab.  */
00188   struct symtab *(*lookup_symbol) (struct objfile *objfile,
00189                                    int kind, const char *name,
00190                                    domain_enum domain);
00191 
00192   /* Print statistics about any indices loaded for OBJFILE.  The
00193      statistics should be printed to gdb_stdout.  This is used for
00194      "maint print statistics".  */
00195   void (*print_stats) (struct objfile *objfile);
00196 
00197   /* Dump any indices loaded for OBJFILE.  The dump should go to
00198      gdb_stdout.  This is used for "maint print objfiles".  */
00199   void (*dump) (struct objfile *objfile);
00200 
00201   /* This is called by objfile_relocate to relocate any indices loaded
00202      for OBJFILE.  */
00203   void (*relocate) (struct objfile *objfile,
00204                     const struct section_offsets *new_offsets,
00205                     const struct section_offsets *delta);
00206 
00207   /* Find all the symbols in OBJFILE named FUNC_NAME, and ensure that
00208      the corresponding symbol tables are loaded.  */
00209   void (*expand_symtabs_for_function) (struct objfile *objfile,
00210                                        const char *func_name);
00211 
00212   /* Read all symbol tables associated with OBJFILE.  */
00213   void (*expand_all_symtabs) (struct objfile *objfile);
00214 
00215   /* Read all symbol tables associated with OBJFILE which have
00216      symtab_to_fullname equal to FULLNAME.
00217      This is for the purposes of examining code only, e.g., expand_line_sal.
00218      The routine may ignore debug info that is known to not be useful with
00219      code, e.g., DW_TAG_type_unit for dwarf debug info.  */
00220   void (*expand_symtabs_with_fullname) (struct objfile *objfile,
00221                                         const char *fullname);
00222 
00223   /* Find global or static symbols in all tables that are in NAMESPACE 
00224      and for which MATCH (symbol name, NAME) == 0, passing each to 
00225      CALLBACK, reading in partial symbol tables as needed.  Look
00226      through global symbols if GLOBAL and otherwise static symbols.
00227      Passes NAME, NAMESPACE, and DATA to CALLBACK with each symbol
00228      found.  After each block is processed, passes NULL to CALLBACK.
00229      MATCH must be weaker than strcmp_iw_ordered in the sense that
00230      strcmp_iw_ordered(x,y) == 0 --> MATCH(x,y) == 0.  ORDERED_COMPARE,
00231      if non-null, must be an ordering relation compatible with
00232      strcmp_iw_ordered in the sense that
00233             strcmp_iw_ordered(x,y) == 0 --> ORDERED_COMPARE(x,y) == 0
00234      and 
00235             strcmp_iw_ordered(x,y) <= 0 --> ORDERED_COMPARE(x,y) <= 0
00236      (allowing strcmp_iw_ordered(x,y) < 0 while ORDERED_COMPARE(x, y) == 0).
00237      CALLBACK returns 0 to indicate that the scan should continue, or
00238      non-zero to indicate that the scan should be terminated.  */
00239 
00240   void (*map_matching_symbols) (struct objfile *,
00241                                 const char *name, domain_enum namespace,
00242                                 int global,
00243                                 int (*callback) (struct block *,
00244                                                  struct symbol *, void *),
00245                                 void *data,
00246                                 symbol_compare_ftype *match,
00247                                 symbol_compare_ftype *ordered_compare);
00248 
00249   /* Expand all symbol tables in OBJFILE matching some criteria.
00250 
00251      FILE_MATCHER is called for each file in OBJFILE.  The file name
00252      and the DATA argument are passed to it.  If it returns zero, this
00253      file is skipped.  If FILE_MATCHER is NULL such file is not skipped.
00254      If BASENAMES is non-zero the function should consider only base name of
00255      DATA (passed file name is already only the lbasename part).
00256 
00257      Otherwise, if KIND does not match this symbol is skipped.
00258 
00259      If even KIND matches, then NAME_MATCHER is called for each symbol
00260      defined in the file.  The symbol "search" name and DATA are passed
00261      to NAME_MATCHER.
00262 
00263      If NAME_MATCHER returns zero, then this symbol is skipped.
00264 
00265      Otherwise, this symbol's symbol table is expanded.
00266 
00267      DATA is user data that is passed unmodified to the callback
00268      functions.  */
00269   void (*expand_symtabs_matching)
00270     (struct objfile *objfile,
00271      int (*file_matcher) (const char *, void *, int basenames),
00272      int (*name_matcher) (const char *, void *),
00273      enum search_domain kind,
00274      void *data);
00275 
00276   /* Return the symbol table from OBJFILE that contains PC and
00277      SECTION.  Return NULL if there is no such symbol table.  This
00278      should return the symbol table that contains a symbol whose
00279      address exactly matches PC, or, if there is no exact match, the
00280      symbol table that contains a symbol whose address is closest to
00281      PC.  */
00282   struct symtab *(*find_pc_sect_symtab) (struct objfile *objfile,
00283                                          struct minimal_symbol *msymbol,
00284                                          CORE_ADDR pc,
00285                                          struct obj_section *section,
00286                                          int warn_if_readin);
00287 
00288   /* Call a callback for every file defined in OBJFILE whose symtab is
00289      not already read in.  FUN is the callback.  It is passed the file's
00290      FILENAME, the file's FULLNAME (if need_fullname is non-zero), and
00291      the DATA passed to this function.  */
00292   void (*map_symbol_filenames) (struct objfile *objfile,
00293                                 symbol_filename_ftype *fun, void *data,
00294                                 int need_fullname);
00295 };
00296 
00297 /* Structure of functions used for probe support.  If one of these functions
00298    is provided, all must be.  */
00299 
00300 struct sym_probe_fns
00301 {
00302   /* If non-NULL, return an array of probe objects.
00303 
00304      The returned value does not have to be freed and it has lifetime of the
00305      OBJFILE.  */
00306   VEC (probe_p) *(*sym_get_probes) (struct objfile *);
00307 
00308   /* Return the number of arguments available to PROBE.  PROBE will
00309      have come from a call to this objfile's sym_get_probes method.
00310      If you provide an implementation of sym_get_probes, you must
00311      implement this method as well.  */
00312   unsigned (*sym_get_probe_argument_count) (struct probe *probe);
00313 
00314   /* Return 1 if the probe interface can evaluate the arguments of probe
00315      PROBE, zero otherwise.  This function can be probe-specific, informing
00316      whether only the arguments of PROBE can be evaluated, of generic,
00317      informing whether the probe interface is able to evaluate any kind of
00318      argument.  If you provide an implementation of sym_get_probes, you must
00319      implement this method as well.  */
00320   int (*can_evaluate_probe_arguments) (struct probe *probe);
00321 
00322   /* Evaluate the Nth argument available to PROBE.  PROBE will have
00323      come from a call to this objfile's sym_get_probes method.  N will
00324      be between 0 and the number of arguments available to this probe.
00325      FRAME is the frame in which the evaluation is done; the frame's
00326      PC will match the address of the probe.  If you provide an
00327      implementation of sym_get_probes, you must implement this method
00328      as well.  */
00329   struct value *(*sym_evaluate_probe_argument) (struct probe *probe,
00330                                                 unsigned n);
00331 
00332   /* Compile the Nth probe argument to an agent expression.  PROBE
00333      will have come from a call to this objfile's sym_get_probes
00334      method.  N will be between 0 and the number of arguments
00335      available to this probe.  EXPR and VALUE are the agent expression
00336      that is being updated.  */
00337   void (*sym_compile_to_ax) (struct probe *probe,
00338                              struct agent_expr *expr,
00339                              struct axs_value *value,
00340                              unsigned n);
00341 
00342   /* Relocate the probe section of OBJFILE.  */
00343   void (*sym_relocate_probe) (struct objfile *objfile,
00344                               const struct section_offsets *new_offsets,
00345                               const struct section_offsets *delta);
00346 };
00347 
00348 /* Structure to keep track of symbol reading functions for various
00349    object file types.  */
00350 
00351 struct sym_fns
00352 {
00353   /* Initializes anything that is global to the entire symbol table.
00354      It is called during symbol_file_add, when we begin debugging an
00355      entirely new program.  */
00356 
00357   void (*sym_new_init) (struct objfile *);
00358 
00359   /* Reads any initial information from a symbol file, and initializes
00360      the struct sym_fns SF in preparation for sym_read().  It is
00361      called every time we read a symbol file for any reason.  */
00362 
00363   void (*sym_init) (struct objfile *);
00364 
00365   /* sym_read (objfile, symfile_flags) Reads a symbol file into a psymtab
00366      (or possibly a symtab).  OBJFILE is the objfile struct for the
00367      file we are reading.  SYMFILE_FLAGS are the flags passed to
00368      symbol_file_add & co.  */
00369 
00370   void (*sym_read) (struct objfile *, int);
00371 
00372   /* Read the partial symbols for an objfile.  This may be NULL, in which case
00373      gdb has to check other ways if this objfile has any symbols.  This may
00374      only be non-NULL if the objfile actually does have debuginfo available.
00375      */
00376 
00377   void (*sym_read_psymbols) (struct objfile *);
00378 
00379   /* Called when we are finished with an objfile.  Should do all
00380      cleanup that is specific to the object file format for the
00381      particular objfile.  */
00382 
00383   void (*sym_finish) (struct objfile *);
00384 
00385   /* This function produces a file-dependent section_offsets
00386      structure, allocated in the objfile's storage, and based on the
00387      parameter.  The parameter is currently a CORE_ADDR (FIXME!) for
00388      backward compatibility with the higher levels of GDB.  It should
00389      probably be changed to a string, where NULL means the default,
00390      and others are parsed in a file dependent way.  */
00391 
00392   void (*sym_offsets) (struct objfile *, const struct section_addr_info *);
00393 
00394   /* This function produces a format-independent description of
00395      the segments of ABFD.  Each segment is a unit of the file
00396      which may be relocated independently.  */
00397 
00398   struct symfile_segment_data *(*sym_segments) (bfd *abfd);
00399 
00400   /* This function should read the linetable from the objfile when
00401      the line table cannot be read while processing the debugging
00402      information.  */
00403 
00404   void (*sym_read_linetable) (struct objfile *);
00405 
00406   /* Relocate the contents of a debug section SECTP.  The
00407      contents are stored in BUF if it is non-NULL, or returned in a
00408      malloc'd buffer otherwise.  */
00409 
00410   bfd_byte *(*sym_relocate) (struct objfile *, asection *sectp, bfd_byte *buf);
00411 
00412   /* If non-NULL, this objfile has probe support, and all the probe
00413      functions referred to here will be non-NULL.  */
00414   const struct sym_probe_fns *sym_probe_fns;
00415 
00416   /* The "quick" (aka partial) symbol functions for this symbol
00417      reader.  */
00418   const struct quick_symbol_functions *qf;
00419 };
00420 
00421 extern struct section_addr_info *
00422   build_section_addr_info_from_objfile (const struct objfile *objfile);
00423 
00424 extern void relative_addr_info_to_section_offsets
00425   (struct section_offsets *section_offsets, int num_sections,
00426    const struct section_addr_info *addrs);
00427 
00428 extern void addr_info_make_relative (struct section_addr_info *addrs,
00429                                      bfd *abfd);
00430 
00431 /* The default version of sym_fns.sym_offsets for readers that don't
00432    do anything special.  */
00433 
00434 extern void default_symfile_offsets (struct objfile *objfile,
00435                                      const struct section_addr_info *);
00436 
00437 /* The default version of sym_fns.sym_segments for readers that don't
00438    do anything special.  */
00439 
00440 extern struct symfile_segment_data *default_symfile_segments (bfd *abfd);
00441 
00442 /* The default version of sym_fns.sym_relocate for readers that don't
00443    do anything special.  */
00444 
00445 extern bfd_byte *default_symfile_relocate (struct objfile *objfile,
00446                                            asection *sectp, bfd_byte *buf);
00447 
00448 extern struct symtab *allocate_symtab (const char *, struct objfile *)
00449   ATTRIBUTE_NONNULL (1);
00450 
00451 extern void add_symtab_fns (enum bfd_flavour flavour, const struct sym_fns *);
00452 
00453 /* This enum encodes bit-flags passed as ADD_FLAGS parameter to
00454    symbol_file_add, etc.  */
00455 
00456 enum symfile_add_flags
00457   {
00458     /* Be chatty about what you are doing.  */
00459     SYMFILE_VERBOSE = 1 << 1,
00460 
00461     /* This is the main symbol file (as opposed to symbol file for dynamically
00462        loaded code).  */
00463     SYMFILE_MAINLINE = 1 << 2,
00464 
00465     /* Do not call breakpoint_re_set when adding this symbol file.  */
00466     SYMFILE_DEFER_BP_RESET = 1 << 3,
00467 
00468     /* Do not immediately read symbols for this file.  By default,
00469        symbols are read when the objfile is created.  */
00470     SYMFILE_NO_READ = 1 << 4
00471   };
00472 
00473 extern void new_symfile_objfile (struct objfile *, int);
00474 
00475 extern struct objfile *symbol_file_add (const char *, int,
00476                                         struct section_addr_info *, int);
00477 
00478 extern struct objfile *symbol_file_add_from_bfd (bfd *, const char *, int,
00479                                                  struct section_addr_info *,
00480                                                  int, struct objfile *parent);
00481 
00482 extern void symbol_file_add_separate (bfd *, const char *, int,
00483                                       struct objfile *);
00484 
00485 extern char *find_separate_debug_file_by_debuglink (struct objfile *);
00486 
00487 /* Create a new section_addr_info, with room for NUM_SECTIONS.  */
00488 
00489 extern struct section_addr_info *alloc_section_addr_info (size_t
00490                                                           num_sections);
00491 
00492 /* Build (allocate and populate) a section_addr_info struct from an
00493    existing section table.  */
00494 
00495 extern struct section_addr_info
00496   *build_section_addr_info_from_section_table (const struct target_section
00497                                                *start,
00498                                                const struct target_section
00499                                                *end);
00500 
00501 /* Free all memory allocated by
00502    build_section_addr_info_from_section_table.  */
00503 
00504 extern void free_section_addr_info (struct section_addr_info *);
00505 
00506 
00507                         /*   Variables   */
00508 
00509 /* If non-zero, shared library symbols will be added automatically
00510    when the inferior is created, new libraries are loaded, or when
00511    attaching to the inferior.  This is almost always what users will
00512    want to have happen; but for very large programs, the startup time
00513    will be excessive, and so if this is a problem, the user can clear
00514    this flag and then add the shared library symbols as needed.  Note
00515    that there is a potential for confusion, since if the shared
00516    library symbols are not loaded, commands like "info fun" will *not*
00517    report all the functions that are actually present.  */
00518 
00519 extern int auto_solib_add;
00520 
00521 /* From symfile.c */
00522 
00523 extern void set_initial_language (void);
00524 
00525 extern void find_lowest_section (bfd *, asection *, void *);
00526 
00527 extern bfd *symfile_bfd_open (const char *);
00528 
00529 extern bfd *gdb_bfd_open_maybe_remote (const char *);
00530 
00531 extern int get_section_index (struct objfile *, char *);
00532 
00533 /* Utility functions for overlay sections: */
00534 extern enum overlay_debugging_state
00535 {
00536   ovly_off,
00537   ovly_on,
00538   ovly_auto
00539 } overlay_debugging;
00540 extern int overlay_cache_invalid;
00541 
00542 /* Return the "mapped" overlay section containing the PC.  */
00543 extern struct obj_section *find_pc_mapped_section (CORE_ADDR);
00544 
00545 /* Return any overlay section containing the PC (even in its LMA
00546    region).  */
00547 extern struct obj_section *find_pc_overlay (CORE_ADDR);
00548 
00549 /* Return true if the section is an overlay.  */
00550 extern int section_is_overlay (struct obj_section *);
00551 
00552 /* Return true if the overlay section is currently "mapped".  */
00553 extern int section_is_mapped (struct obj_section *);
00554 
00555 /* Return true if pc belongs to section's VMA.  */
00556 extern CORE_ADDR pc_in_mapped_range (CORE_ADDR, struct obj_section *);
00557 
00558 /* Return true if pc belongs to section's LMA.  */
00559 extern CORE_ADDR pc_in_unmapped_range (CORE_ADDR, struct obj_section *);
00560 
00561 /* Map an address from a section's LMA to its VMA.  */
00562 extern CORE_ADDR overlay_mapped_address (CORE_ADDR, struct obj_section *);
00563 
00564 /* Map an address from a section's VMA to its LMA.  */
00565 extern CORE_ADDR overlay_unmapped_address (CORE_ADDR, struct obj_section *);
00566 
00567 /* Convert an address in an overlay section (force into VMA range).  */
00568 extern CORE_ADDR symbol_overlayed_address (CORE_ADDR, struct obj_section *);
00569 
00570 /* Load symbols from a file.  */
00571 extern void symbol_file_add_main (const char *args, int from_tty);
00572 
00573 /* Clear GDB symbol tables.  */
00574 extern void symbol_file_clear (int from_tty);
00575 
00576 /* Default overlay update function.  */
00577 extern void simple_overlay_update (struct obj_section *);
00578 
00579 extern bfd_byte *symfile_relocate_debug_section (struct objfile *, asection *,
00580                                                  bfd_byte *);
00581 
00582 extern int symfile_map_offsets_to_segments (bfd *,
00583                                             const struct symfile_segment_data *,
00584                                             struct section_offsets *,
00585                                             int, const CORE_ADDR *);
00586 struct symfile_segment_data *get_symfile_segment_data (bfd *abfd);
00587 void free_symfile_segment_data (struct symfile_segment_data *data);
00588 
00589 extern struct cleanup *increment_reading_symtab (void);
00590 
00591 /* From dwarf2read.c */
00592 
00593 /* Names for a dwarf2 debugging section.  The field NORMAL is the normal
00594    section name (usually from the DWARF standard), while the field COMPRESSED
00595    is the name of compressed sections.  If your object file format doesn't
00596    support compressed sections, the field COMPRESSED can be NULL.  Likewise,
00597    the debugging section is not supported, the field NORMAL can be NULL too.
00598    It doesn't make sense to have a NULL NORMAL field but a non-NULL COMPRESSED
00599    field.  */
00600 
00601 struct dwarf2_section_names {
00602   const char *normal;
00603   const char *compressed;
00604 };
00605 
00606 /* List of names for dward2 debugging sections.  Also most object file formats
00607    use the standardized (ie ELF) names, some (eg XCOFF) have customized names
00608    due to restrictions.
00609    The table for the standard names is defined in dwarf2read.c.  Please
00610    update all instances of dwarf2_debug_sections if you add a field to this
00611    structure.  It is always safe to use { NULL, NULL } in this case.  */
00612 
00613 struct dwarf2_debug_sections {
00614   struct dwarf2_section_names info;
00615   struct dwarf2_section_names abbrev;
00616   struct dwarf2_section_names line;
00617   struct dwarf2_section_names loc;
00618   struct dwarf2_section_names macinfo;
00619   struct dwarf2_section_names macro;
00620   struct dwarf2_section_names str;
00621   struct dwarf2_section_names ranges;
00622   struct dwarf2_section_names types;
00623   struct dwarf2_section_names addr;
00624   struct dwarf2_section_names frame;
00625   struct dwarf2_section_names eh_frame;
00626   struct dwarf2_section_names gdb_index;
00627   /* This field has no meaning, but exists solely to catch changes to
00628      this structure which are not reflected in some instance.  */
00629   int sentinel;
00630 };
00631 
00632 extern int dwarf2_has_info (struct objfile *,
00633                             const struct dwarf2_debug_sections *);
00634 
00635 /* Dwarf2 sections that can be accessed by dwarf2_get_section_info.  */
00636 enum dwarf2_section_enum {
00637   DWARF2_DEBUG_FRAME,
00638   DWARF2_EH_FRAME
00639 };
00640 
00641 extern void dwarf2_get_section_info (struct objfile *,
00642                                      enum dwarf2_section_enum,
00643                                      asection **, const gdb_byte **,
00644                                      bfd_size_type *);
00645 
00646 extern int dwarf2_initialize_objfile (struct objfile *);
00647 extern void dwarf2_build_psymtabs (struct objfile *);
00648 extern void dwarf2_build_frame_info (struct objfile *);
00649 
00650 void dwarf2_free_objfile (struct objfile *);
00651 
00652 /* From mdebugread.c */
00653 
00654 extern void mdebug_build_psymtabs (struct objfile *,
00655                                    const struct ecoff_debug_swap *,
00656                                    struct ecoff_debug_info *);
00657 
00658 extern void elfmdebug_build_psymtabs (struct objfile *,
00659                                       const struct ecoff_debug_swap *,
00660                                       asection *);
00661 
00662 /* From minidebug.c.  */
00663 
00664 extern bfd *find_separate_debug_file_in_section (struct objfile *);
00665 
00666 #endif /* !defined(SYMFILE_H) */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines