15796c8dcSSimon Schubert /* Shared library declarations for GDB, the GNU Debugger. 25796c8dcSSimon Schubert 3*ef5ccd6cSJohn Marino Copyright (C) 1992-2013 Free Software Foundation, Inc. 45796c8dcSSimon Schubert 55796c8dcSSimon Schubert This file is part of GDB. 65796c8dcSSimon Schubert 75796c8dcSSimon Schubert This program is free software; you can redistribute it and/or modify 85796c8dcSSimon Schubert it under the terms of the GNU General Public License as published by 95796c8dcSSimon Schubert the Free Software Foundation; either version 3 of the License, or 105796c8dcSSimon Schubert (at your option) any later version. 115796c8dcSSimon Schubert 125796c8dcSSimon Schubert This program is distributed in the hope that it will be useful, 135796c8dcSSimon Schubert but WITHOUT ANY WARRANTY; without even the implied warranty of 145796c8dcSSimon Schubert MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 155796c8dcSSimon Schubert GNU General Public License for more details. 165796c8dcSSimon Schubert 175796c8dcSSimon Schubert You should have received a copy of the GNU General Public License 185796c8dcSSimon Schubert along with this program. If not, see <http://www.gnu.org/licenses/>. */ 195796c8dcSSimon Schubert 205796c8dcSSimon Schubert #ifndef SOLIB_H 215796c8dcSSimon Schubert #define SOLIB_H 225796c8dcSSimon Schubert 235796c8dcSSimon Schubert /* Forward decl's for prototypes */ 245796c8dcSSimon Schubert struct so_list; 255796c8dcSSimon Schubert struct target_ops; 265796c8dcSSimon Schubert struct target_so_ops; 27cf7f2e2dSJohn Marino struct program_space; 285796c8dcSSimon Schubert 295796c8dcSSimon Schubert /* Called when we free all symtabs, to free the shared library information 305796c8dcSSimon Schubert as well. */ 315796c8dcSSimon Schubert 325796c8dcSSimon Schubert extern void clear_solib (void); 335796c8dcSSimon Schubert 345796c8dcSSimon Schubert /* Called to add symbols from a shared library to gdb's symbol table. */ 355796c8dcSSimon Schubert 365796c8dcSSimon Schubert extern void solib_add (char *, int, struct target_ops *, int); 375796c8dcSSimon Schubert extern int solib_read_symbols (struct so_list *, int); 385796c8dcSSimon Schubert 395796c8dcSSimon Schubert /* Function to be called when the inferior starts up, to discover the 405796c8dcSSimon Schubert names of shared libraries that are dynamically linked, the base 415796c8dcSSimon Schubert addresses to which they are linked, and sufficient information to 425796c8dcSSimon Schubert read in their symbols at a later time. */ 435796c8dcSSimon Schubert 44cf7f2e2dSJohn Marino extern void solib_create_inferior_hook (int from_tty); 455796c8dcSSimon Schubert 465796c8dcSSimon Schubert /* If ADDR lies in a shared library, return its name. */ 475796c8dcSSimon Schubert 48cf7f2e2dSJohn Marino extern char *solib_name_from_address (struct program_space *, CORE_ADDR); 495796c8dcSSimon Schubert 505796c8dcSSimon Schubert /* Return 1 if ADDR lies within SOLIB. */ 515796c8dcSSimon Schubert 525796c8dcSSimon Schubert extern int solib_contains_address_p (const struct so_list *, CORE_ADDR); 535796c8dcSSimon Schubert 54cf7f2e2dSJohn Marino /* Return whether the data starting at VADDR, size SIZE, must be kept 55cf7f2e2dSJohn Marino in a core file for shared libraries loaded before "gcore" is used 56cf7f2e2dSJohn Marino to be handled correctly when the core file is loaded. This only 57cf7f2e2dSJohn Marino applies when the section would otherwise not be kept in the core 58cf7f2e2dSJohn Marino file (in particular, for readonly sections). */ 59cf7f2e2dSJohn Marino 60cf7f2e2dSJohn Marino extern int solib_keep_data_in_core (CORE_ADDR vaddr, unsigned long size); 61cf7f2e2dSJohn Marino 625796c8dcSSimon Schubert /* Return 1 if PC lies in the dynamic symbol resolution code of the 635796c8dcSSimon Schubert run time loader. */ 645796c8dcSSimon Schubert 655796c8dcSSimon Schubert extern int in_solib_dynsym_resolve_code (CORE_ADDR); 665796c8dcSSimon Schubert 675796c8dcSSimon Schubert /* Discard symbols that were auto-loaded from shared libraries. */ 685796c8dcSSimon Schubert 695796c8dcSSimon Schubert extern void no_shared_libraries (char *ignored, int from_tty); 705796c8dcSSimon Schubert 715796c8dcSSimon Schubert /* Set the solib operations for GDBARCH to NEW_OPS. */ 725796c8dcSSimon Schubert 735796c8dcSSimon Schubert extern void set_solib_ops (struct gdbarch *gdbarch, 745796c8dcSSimon Schubert struct target_so_ops *new_ops); 755796c8dcSSimon Schubert 765796c8dcSSimon Schubert /* Return non-zero if NAME is the libpthread shared library. */ 775796c8dcSSimon Schubert 785796c8dcSSimon Schubert extern int libpthread_name_p (const char *name); 795796c8dcSSimon Schubert 80a45ae5f8SJohn Marino /* Look up symbol from both symbol table and dynamic string table. */ 81a45ae5f8SJohn Marino 82a45ae5f8SJohn Marino extern CORE_ADDR gdb_bfd_lookup_symbol (bfd *abfd, 83a45ae5f8SJohn Marino int (*match_sym) (asymbol *, void *), 84a45ae5f8SJohn Marino void *data); 85a45ae5f8SJohn Marino 86a45ae5f8SJohn Marino /* Look up symbol from symbol table. */ 87a45ae5f8SJohn Marino 88*ef5ccd6cSJohn Marino extern CORE_ADDR gdb_bfd_lookup_symbol_from_symtab (bfd *abfd, 89a45ae5f8SJohn Marino int (*match_sym) (asymbol *, 90a45ae5f8SJohn Marino void *), 91a45ae5f8SJohn Marino void *data); 92a45ae5f8SJohn Marino 935796c8dcSSimon Schubert #endif /* SOLIB_H */ 94