1 /* Shared library declarations for GDB, the GNU Debugger.
3 Copyright (C) 1992-2016 Free Software Foundation, Inc.
5 This file is part of GDB.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
23 /* Forward decl's for prototypes */
29 #include "symfile-add-flags.h"
31 /* Called when we free all symtabs, to free the shared library information
34 extern void clear_solib (void);
36 /* Called to add symbols from a shared library to gdb's symbol table. */
38 extern void solib_add (const char *, int, struct target_ops *, int);
39 extern int solib_read_symbols (struct so_list *, symfile_add_flags);
41 /* Function to be called when the inferior starts up, to discover the
42 names of shared libraries that are dynamically linked, the base
43 addresses to which they are linked, and sufficient information to
44 read in their symbols at a later time. */
46 extern void solib_create_inferior_hook (int from_tty);
48 /* If ADDR lies in a shared library, return its name. */
50 extern char *solib_name_from_address (struct program_space *, CORE_ADDR);
52 /* Return 1 if ADDR lies within SOLIB. */
54 extern int solib_contains_address_p (const struct so_list *, CORE_ADDR);
56 /* Return whether the data starting at VADDR, size SIZE, must be kept
57 in a core file for shared libraries loaded before "gcore" is used
58 to be handled correctly when the core file is loaded. This only
59 applies when the section would otherwise not be kept in the core
60 file (in particular, for readonly sections). */
62 extern int solib_keep_data_in_core (CORE_ADDR vaddr, unsigned long size);
64 /* Return 1 if PC lies in the dynamic symbol resolution code of the
67 extern int in_solib_dynsym_resolve_code (CORE_ADDR);
69 /* Discard symbols that were auto-loaded from shared libraries. */
71 extern void no_shared_libraries (char *ignored, int from_tty);
73 /* Set the solib operations for GDBARCH to NEW_OPS. */
75 extern void set_solib_ops (struct gdbarch *gdbarch,
76 const struct target_so_ops *new_ops);
78 /* Return non-zero if NAME is the libpthread shared library. */
80 extern int libpthread_name_p (const char *name);
82 /* Look up symbol from both symbol table and dynamic string table. */
84 extern CORE_ADDR gdb_bfd_lookup_symbol (bfd *abfd,
85 int (*match_sym) (const asymbol *,
89 /* Look up symbol from symbol table. */
91 extern CORE_ADDR gdb_bfd_lookup_symbol_from_symtab (bfd *abfd,
97 /* Enable or disable optional solib event breakpoints as appropriate. */
99 extern void update_solib_breakpoints (void);
101 /* Handle an solib event by calling solib_add. */
103 extern void handle_solib_event (void);