xref: /openbsd/gnu/usr.bin/binutils/gdb/solib.h (revision bb02a7f5)
1 /* Shared library declarations for GDB, the GNU Debugger.
2    Copyright 1992, 1993, 1995, 1998, 1999, 2000, 2001, 2003
3    Free Software Foundation, Inc.
4 
5    This file is part of GDB.
6 
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 2 of the License, or
10    (at your option) any later version.
11 
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.
16 
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, write to the Free Software
19    Foundation, Inc., 59 Temple Place - Suite 330,
20    Boston, MA 02111-1307, USA.  */
21 
22 #ifndef SOLIB_H
23 #define SOLIB_H
24 
25 /* Forward decl's for prototypes */
26 struct so_list;
27 struct target_ops;
28 
29 /* Called when we free all symtabs, to free the shared library information
30    as well. */
31 
32 #define CLEAR_SOLIB			clear_solib
33 
34 extern void clear_solib (void);
35 
36 /* Called to add symbols from a shared library to gdb's symbol table. */
37 
38 #define SOLIB_ADD(filename, from_tty, targ, readsyms) \
39     solib_add (filename, from_tty, targ, readsyms)
40 
41 extern void solib_add (char *, int, struct target_ops *, int);
42 extern int solib_read_symbols (struct so_list *, int);
43 
44 /* Function to be called when the inferior starts up, to discover the names
45    of shared libraries that are dynamically linked, the base addresses to
46    which they are linked, and sufficient information to read in their symbols
47    at a later time. */
48 
49 #define SOLIB_CREATE_INFERIOR_HOOK(PID)	solib_create_inferior_hook()
50 
51 /* Function to be called to remove the connection between debugger and
52    dynamic linker that was established by SOLIB_CREATE_INFERIOR_HOOK.
53    (This operation does not remove shared library information from
54    the debugger, as CLEAR_SOLIB does.)
55 
56    This functionality is presently not implemented for this target.
57  */
58 #define SOLIB_REMOVE_INFERIOR_HOOK(PID) (0)
59 
60 extern void solib_create_inferior_hook (void);	/* solib.c */
61 
62 /* This function returns TRUE if pc is the address of an instruction that
63    lies within the dynamic linker (such as the event hook, or the dld
64    itself).
65 
66    This function must be used only when a dynamic linker event has been
67    caught, and the inferior is being stepped out of the hook, or undefined
68    results are guaranteed.
69 
70    Presently, this functionality is not implemented.
71  */
72 
73 /*
74    #define SOLIB_IN_DYNAMIC_LINKER(pid,pc) \
75    error("catch of library loads/unloads not yet implemented on this platform")
76  */
77 
78 #define SOLIB_IN_DYNAMIC_LINKER(pid,pc) \
79 (0)
80 
81 /* This function must be called when the inferior is killed, and the program
82    restarted.  This is not the same as CLEAR_SOLIB, in that it doesn't discard
83    any symbol tables.
84 
85    Presently, this functionality is not implemented.
86  */
87 #define SOLIB_RESTART() \
88   (0)
89 
90 /* If we can't set a breakpoint, and it's in a shared library, just
91    disable it.  */
92 
93 #define DISABLE_UNSETTABLE_BREAK(addr)	(solib_address(addr) != NULL)
94 
95 extern char *solib_address (CORE_ADDR);	/* solib.c */
96 
97 /* If ADDR lies in a shared library, return its name.  */
98 
99 #define PC_SOLIB(addr)	solib_address (addr)
100 
101 /* Return 1 if PC lies in the dynamic symbol resolution code of the
102    run time loader.  */
103 
104 #define IN_SOLIB_DYNSYM_RESOLVE_CODE(pc) in_solib_dynsym_resolve_code (pc)
105 
106 extern int in_solib_dynsym_resolve_code (CORE_ADDR);	/* solib.c */
107 
108 /* Discard symbols that were auto-loaded from shared libraries. */
109 
110 extern void no_shared_libraries (char *ignored, int from_tty);
111 
112 #endif /* SOLIB_H */
113