diff options
Diffstat (limited to 'gdb/objfiles.h')
-rw-r--r-- | gdb/objfiles.h | 151 |
1 files changed, 65 insertions, 86 deletions
diff --git a/gdb/objfiles.h b/gdb/objfiles.h index 342aa09..8b3e5cb 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -17,11 +17,11 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#if !defined (OBJFILES_H) +#if !defined(OBJFILES_H) #define OBJFILES_H #include "hashtab.h" -#include "gdbsupport/gdb_obstack.h" /* For obstack internals. */ +#include "gdbsupport/gdb_obstack.h" /* For obstack internals. */ #include "objfile-flags.h" #include "symfile.h" #include "progspace.h" @@ -127,28 +127,28 @@ struct entry_info unsigned initialized : 1; }; -#define ALL_OBJFILE_OSECTIONS(objfile, osect) \ +#define ALL_OBJFILE_OSECTIONS(objfile, osect) \ for (osect = objfile->sections; osect < objfile->sections_end; osect++) \ - if (osect->the_bfd_section == NULL) \ - { \ - /* Nothing. */ \ - } \ + if (osect->the_bfd_section == NULL) \ + { \ + /* Nothing. */ \ + } \ else -#define SECT_OFF_DATA(objfile) \ - ((objfile->sect_index_data == -1) \ - ? (internal_error (_("sect_index_data not initialized")), -1) \ - : objfile->sect_index_data) +#define SECT_OFF_DATA(objfile) \ + ((objfile->sect_index_data == -1) \ + ? (internal_error (_ ("sect_index_data not initialized")), -1) \ + : objfile->sect_index_data) -#define SECT_OFF_RODATA(objfile) \ - ((objfile->sect_index_rodata == -1) \ - ? (internal_error (_("sect_index_rodata not initialized")), -1) \ - : objfile->sect_index_rodata) +#define SECT_OFF_RODATA(objfile) \ + ((objfile->sect_index_rodata == -1) \ + ? (internal_error (_ ("sect_index_rodata not initialized")), -1) \ + : objfile->sect_index_rodata) -#define SECT_OFF_TEXT(objfile) \ - ((objfile->sect_index_text == -1) \ - ? (internal_error (_("sect_index_text not initialized")), -1) \ - : objfile->sect_index_text) +#define SECT_OFF_TEXT(objfile) \ + ((objfile->sect_index_text == -1) \ + ? (internal_error (_ ("sect_index_text not initialized")), -1) \ + : objfile->sect_index_text) /* Sometimes the .bss section is missing from the objfile, so we don't want to die here. Let the users of SECT_OFF_BSS deal with an @@ -175,7 +175,7 @@ struct objstats int sz_strtab = 0; }; -#define OBJSTAT(objfile, expr) (objfile -> stats.expr) +#define OBJSTAT(objfile, expr) (objfile->stats.expr) #define OBJSTATS struct objstats stats extern void print_objfile_statistics (void); @@ -198,10 +198,7 @@ struct minimal_symbol_iterator { } - value_type operator* () const - { - return m_msym; - } + value_type operator* () const { return m_msym; } bool operator== (const self_type &other) const { @@ -220,6 +217,7 @@ struct minimal_symbol_iterator } private: + struct minimal_symbol *m_msym; }; @@ -231,8 +229,10 @@ private: struct objfile_per_bfd_storage { objfile_per_bfd_storage (bfd *bfd) - : minsyms_read (false), m_bfd (bfd) - {} + : minsyms_read (false), + m_bfd (bfd) + { + } ~objfile_per_bfd_storage (); @@ -255,10 +255,7 @@ struct objfile_per_bfd_storage /* Get the BFD this object is associated to. */ - bfd *get_bfd () const - { - return m_bfd; - } + bfd *get_bfd () const { return m_bfd; } /* The storage has an obstack of its own. */ @@ -339,6 +336,7 @@ struct objfile_per_bfd_storage std::bitset<nr_languages> demangled_hash_languages; private: + /* The BFD this object is associated to. */ bfd *m_bfd; @@ -364,10 +362,7 @@ public: separate_debug_iterator &operator++ (); - struct objfile *operator* () - { - return m_objfile; - } + struct objfile *operator* () { return m_objfile; } private: @@ -466,23 +461,14 @@ public: /* Intern STRING and return the unique copy. The copy has the same lifetime as the per-BFD object. */ - const char *intern (const char *str) - { - return per_bfd->intern (str); - } + const char *intern (const char *str) { return per_bfd->intern (str); } /* Intern STRING and return the unique copy. The copy has the same lifetime as the per-BFD object. */ - const char *intern (const std::string &str) - { - return per_bfd->intern (str); - } + const char *intern (const std::string &str) { return per_bfd->intern (str); } /* Retrieve the gdbarch associated with this objfile. */ - struct gdbarch *arch () const - { - return per_bfd->gdbarch; - } + struct gdbarch *arch () const { return per_bfd->gdbarch; } /* Return true if OBJFILE has partial symbols. */ @@ -512,9 +498,9 @@ public: Then, this calls iterate_over_some_symtabs (or equivalent) over all newly-created symbol tables, passing CALLBACK to it. The result of this call is returned. */ - bool map_symtabs_matching_filename - (const char *name, const char *real_path, - gdb::function_view<bool (symtab *)> callback); + bool + map_symtabs_matching_filename (const char *name, const char *real_path, + gdb::function_view<bool (symtab *)> callback); /* Check to see if the symbol is defined in a "partial" symbol table of this objfile. BLOCK_INDEX should be either GLOBAL_BLOCK or @@ -550,27 +536,24 @@ public: void expand_symtabs_with_fullname (const char *fullname); /* See quick_symbol_functions. */ - void expand_matching_symbols - (const lookup_name_info &name, domain_enum domain, - int global, - symbol_compare_ftype *ordered_compare); + void expand_matching_symbols (const lookup_name_info &name, + domain_enum domain, int global, + symbol_compare_ftype *ordered_compare); /* See quick_symbol_functions. */ - bool expand_symtabs_matching - (gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher, - const lookup_name_info *lookup_name, - gdb::function_view<expand_symtabs_symbol_matcher_ftype> symbol_matcher, - gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify, - block_search_flags search_flags, - domain_enum domain, - enum search_domain kind); + bool expand_symtabs_matching ( + gdb::function_view<expand_symtabs_file_matcher_ftype> file_matcher, + const lookup_name_info *lookup_name, + gdb::function_view<expand_symtabs_symbol_matcher_ftype> symbol_matcher, + gdb::function_view<expand_symtabs_exp_notify_ftype> expansion_notify, + block_search_flags search_flags, domain_enum domain, + enum search_domain kind); /* See quick_symbol_functions. */ - struct compunit_symtab *find_pc_sect_compunit_symtab - (struct bound_minimal_symbol msymbol, - CORE_ADDR pc, - struct obj_section *section, - int warn_if_readin); + struct compunit_symtab * + find_pc_sect_compunit_symtab (struct bound_minimal_symbol msymbol, + CORE_ADDR pc, struct obj_section *section, + int warn_if_readin); /* See quick_symbol_functions. */ void map_symbol_filenames (gdb::function_view<symbol_filename_ftype> fun, @@ -790,17 +773,13 @@ public: struct objfile_deleter { - void operator() (objfile *ptr) const - { - ptr->unlink (); - } + void operator() (objfile *ptr) const { ptr->unlink (); } }; /* A unique pointer that holds an objfile. */ typedef std::unique_ptr<objfile, objfile_deleter> objfile_up; - /* Sections in an objfile. The section offsets are stored in the OBJFILE. */ @@ -900,8 +879,7 @@ extern bool pc_in_section (CORE_ADDR, const char *); static inline int in_plt_section (CORE_ADDR pc) { - return (pc_in_section (pc, ".plt") - || pc_in_section (pc, ".plt.sec")); + return (pc_in_section (pc, ".plt") || pc_in_section (pc, ".plt.sec")); } /* In normal use, the section map will be rebuilt by find_pc_section @@ -912,12 +890,12 @@ in_plt_section (CORE_ADDR pc) call to find_pc_section in the inhibited region relates to a section that is already in the section map and has not since been removed or relocated. */ -extern scoped_restore_tmpl<int> inhibit_section_map_updates - (struct program_space *pspace); +extern scoped_restore_tmpl<int> +inhibit_section_map_updates (struct program_space *pspace); -extern void default_iterate_over_objfiles_in_search_order - (gdbarch *gdbarch, iterate_over_objfiles_in_search_order_cb_ftype cb, - objfile *current_objfile); +extern void default_iterate_over_objfiles_in_search_order ( + gdbarch *gdbarch, iterate_over_objfiles_in_search_order_cb_ftype cb, + objfile *current_objfile); /* Reset the per-BFD storage area on OBJ. */ @@ -945,20 +923,21 @@ const char *objfile_flavour_name (struct objfile *objfile); /* Set the objfile's notion of the "main" name and language. */ -extern void set_objfile_main_name (struct objfile *objfile, - const char *name, enum language lang); +extern void set_objfile_main_name (struct objfile *objfile, const char *name, + enum language lang); /* Find an integer type SIZE_IN_BYTES bytes in size from OF and return it. UNSIGNED_P controls if the integer is unsigned or not. */ extern struct type *objfile_int_type (struct objfile *of, int size_in_bytes, bool unsigned_p); -extern void objfile_register_static_link - (struct objfile *objfile, - const struct block *block, - const struct dynamic_prop *static_link); +extern void +objfile_register_static_link (struct objfile *objfile, + const struct block *block, + const struct dynamic_prop *static_link); -extern const struct dynamic_prop *objfile_lookup_static_link - (struct objfile *objfile, const struct block *block); +extern const struct dynamic_prop * +objfile_lookup_static_link (struct objfile *objfile, + const struct block *block); #endif /* !defined (OBJFILES_H) */ |