import gdb-1999-08-23 snapshot
[binutils-gdb.git] / gdb / pa64solib.h
1 /* HP PA64 ELF Shared library declarations for GDB, the GNU Debugger.
2 Copyright (C) 1999 Free Software Foundation, Inc.
3
4 This file is part of GDB.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
20
21 /* Forward decl's for prototypes */
22 #ifdef __STDC__
23 struct target_ops;
24 struct objfile;
25 struct section_offsets;
26 #endif
27
28 /* Called to add symbols from a shared library to gdb's symbol table. */
29
30 #define SOLIB_ADD(filename, from_tty, targ) \
31 pa64_solib_add (filename, from_tty, targ)
32
33 extern void
34 pa64_solib_add PARAMS ((char *, int, struct target_ops *));
35
36 extern CORE_ADDR
37 pa64_solib_get_got_by_pc PARAMS ((CORE_ADDR));
38
39 /* Function to be called when the inferior starts up, to discover the names
40 of shared libraries that are dynamically linked, the base addresses to
41 which they are linked, and sufficient information to read in their symbols
42 at a later time. */
43
44 #define SOLIB_CREATE_INFERIOR_HOOK(PID) pa64_solib_create_inferior_hook()
45
46 extern void
47 pa64_solib_create_inferior_hook PARAMS ((void));
48
49 /* Function to be called to remove the connection between debugger and
50 dynamic linker that was established by SOLIB_CREATE_INFERIOR_HOOK.
51 (This operation does not remove shared library information from
52 the debugger, as CLEAR_SOLIB does.) */
53 #define SOLIB_REMOVE_INFERIOR_HOOK(PID) pa64_solib_remove_inferior_hook(PID)
54
55 extern void
56 pa64_solib_remove_inferior_hook PARAMS ((int));
57
58 /* This function is called by the "catch load" command. It allows
59 the debugger to be notified by the dynamic linker when a specified
60 library file (or any library file, if filename is NULL) is loaded. */
61 #define SOLIB_CREATE_CATCH_LOAD_HOOK(pid,tempflag, filename,cond_string) \
62 pa64_solib_create_catch_load_hook (pid, tempflag, filename, cond_string)
63
64 extern void
65 pa64_solib_create_catch_load_hook PARAMS ((int, int, char *, char *));
66
67 /* This function is called by the "catch unload" command. It allows
68 the debugger to be notified by the dynamic linker when a specified
69 library file (or any library file, if filename is NULL) is unloaded. */
70 #define SOLIB_CREATE_CATCH_UNLOAD_HOOK(pid,tempflag,filename, cond_string) \
71 pa64_solib_create_catch_unload_hook (pid, tempflag, filename, cond_string)
72
73 extern void
74 pa64_solib_create_catch_unload_hook PARAMS ((int, int, char *, char *));
75
76 /* This function returns TRUE if the dynamic linker has just reported
77 a load of a library.
78
79 This function must be used only when the inferior has stopped in
80 the dynamic linker hook, or undefined results are guaranteed. */
81 #define SOLIB_HAVE_LOAD_EVENT(pid) \
82 pa64_solib_have_load_event (pid)
83
84 extern int
85 pa64_solib_have_load_event PARAMS ((int));
86
87 /* This function returns a pointer to the string representation of the
88 pathname of the dynamically-linked library that has just been loaded.
89
90 This function must be used only when SOLIB_HAVE_LOAD_EVENT is TRUE,
91 or undefined results are guaranteed.
92
93 This string's contents are only valid immediately after the inferior
94 has stopped in the dynamic linker hook, and becomes invalid as soon
95 as the inferior is continued. Clients should make a copy of this
96 string if they wish to continue the inferior and then access the string. */
97 #define SOLIB_LOADED_LIBRARY_PATHNAME(pid) \
98 pa64_solib_loaded_library_pathname (pid)
99
100 extern char *
101 pa64_solib_loaded_library_pathname PARAMS ((int));
102
103 /* This function returns TRUE if the dynamic linker has just reported
104 an unload of a library.
105
106 This function must be used only when the inferior has stopped in
107 the dynamic linker hook, or undefined results are guaranteed. */
108 #define SOLIB_HAVE_UNLOAD_EVENT(pid) \
109 pa64_solib_have_unload_event (pid)
110
111 extern int
112 pa64_solib_have_unload_event PARAMS ((int));
113
114 /* This function returns a pointer to the string representation of the
115 pathname of the dynamically-linked library that has just been unloaded.
116
117 This function must be used only when SOLIB_HAVE_UNLOAD_EVENT is TRUE,
118 or undefined results are guaranteed.
119
120 This string's contents are only valid immediately after the inferior
121 has stopped in the dynamic linker hook, and becomes invalid as soon
122 as the inferior is continued. Clients should make a copy of this
123 string if they wish to continue the inferior and then access the string. */
124 #define SOLIB_UNLOADED_LIBRARY_PATHNAME(pid) \
125 pa64_solib_unloaded_library_pathname (pid)
126
127 extern char *
128 pa64_solib_unloaded_library_pathname PARAMS ((int));
129
130 /* This function returns TRUE if pc is the address of an instruction that
131 lies within the dynamic linker (such as the event hook, or the dld
132 itself).
133
134 This function must be used only when a dynamic linker event has been
135 caught, and the inferior is being stepped out of the hook, or undefined
136 results are guaranteed. */
137 #define SOLIB_IN_DYNAMIC_LINKER(pid,pc) \
138 pa64_solib_in_dynamic_linker (pid, pc)
139
140 extern int
141 pa64_solib_in_dynamic_linker PARAMS ((int, CORE_ADDR));
142
143 /* This function must be called when the inferior is killed, and the program
144 restarted. This is not the same as CLEAR_SOLIB, in that it doesn't discard
145 any symbol tables.
146
147 Presently, this functionality is not implemented. */
148 #define SOLIB_RESTART() \
149 pa64_solib_restart ()
150
151 extern void
152 pa64_solib_restart PARAMS ((void));
153
154 /* If we can't set a breakpoint, and it's in a shared library, just
155 disable it. */
156
157 #define DISABLE_UNSETTABLE_BREAK(addr) (pa64_solib_address(addr) != NULL)
158
159 extern char *
160 pa64_solib_address PARAMS ((CORE_ADDR)); /* somsolib.c */
161
162 /* If ADDR lies in a shared library, return its name. */
163
164 #define PC_SOLIB(addr) pa64_solib_address (addr)