Commit | Line | Data |
---|---|---|
c906108c SS |
1 | /* HP SOM Shared library declarations for GDB, the GNU Debugger. |
2 | Copyright (C) 1992 Free Software Foundation, Inc. | |
3 | ||
c5aa993b | 4 | This file is part of GDB. |
c906108c | 5 | |
c5aa993b JM |
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. | |
c906108c | 10 | |
c5aa993b JM |
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. | |
c906108c | 15 | |
c5aa993b JM |
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. | |
c906108c | 20 | |
c5aa993b JM |
21 | Written by the Center for Software Science at the Univerity of Utah |
22 | and by Cygnus Support. */ | |
c906108c | 23 | |
104c1213 | 24 | /* Forward decl's for prototypes */ |
c906108c SS |
25 | struct target_ops; |
26 | struct objfile; | |
27 | struct section_offsets; | |
c906108c SS |
28 | |
29 | /* Called to add symbols from a shared library to gdb's symbol table. */ | |
30 | ||
31 | #define SOLIB_ADD(filename, from_tty, targ) \ | |
32 | som_solib_add (filename, from_tty, targ) | |
33 | ||
a14ed312 | 34 | extern void som_solib_add (char *, int, struct target_ops *); |
c906108c | 35 | |
a14ed312 | 36 | extern CORE_ADDR som_solib_get_got_by_pc (CORE_ADDR); |
c906108c SS |
37 | |
38 | extern int | |
a14ed312 | 39 | som_solib_section_offsets (struct objfile *, struct section_offsets *); |
c906108c SS |
40 | |
41 | /* Function to be called when the inferior starts up, to discover the names | |
42 | of shared libraries that are dynamically linked, the base addresses to | |
43 | which they are linked, and sufficient information to read in their symbols | |
44 | at a later time. */ | |
45 | ||
46 | #define SOLIB_CREATE_INFERIOR_HOOK(PID) som_solib_create_inferior_hook() | |
47 | ||
a14ed312 | 48 | extern void som_solib_create_inferior_hook (void); |
c906108c SS |
49 | |
50 | /* Function to be called to remove the connection between debugger and | |
51 | dynamic linker that was established by SOLIB_CREATE_INFERIOR_HOOK. | |
52 | (This operation does not remove shared library information from | |
53 | the debugger, as CLEAR_SOLIB does.) | |
c5aa993b | 54 | */ |
c906108c SS |
55 | #define SOLIB_REMOVE_INFERIOR_HOOK(PID) som_solib_remove_inferior_hook(PID) |
56 | ||
a14ed312 | 57 | extern void som_solib_remove_inferior_hook (int); |
c906108c SS |
58 | |
59 | /* This function is called by the "catch load" command. It allows | |
60 | the debugger to be notified by the dynamic linker when a specified | |
61 | library file (or any library file, if filename is NULL) is loaded. | |
c5aa993b | 62 | */ |
c906108c SS |
63 | #define SOLIB_CREATE_CATCH_LOAD_HOOK(pid,tempflag, filename,cond_string) \ |
64 | som_solib_create_catch_load_hook (pid, tempflag, filename, cond_string) | |
65 | ||
a14ed312 | 66 | extern void som_solib_create_catch_load_hook (int, int, char *, char *); |
c906108c SS |
67 | |
68 | /* This function is called by the "catch unload" command. It allows | |
69 | the debugger to be notified by the dynamic linker when a specified | |
70 | library file (or any library file, if filename is NULL) is unloaded. | |
c5aa993b | 71 | */ |
c906108c SS |
72 | #define SOLIB_CREATE_CATCH_UNLOAD_HOOK(pid,tempflag,filename, cond_string) \ |
73 | som_solib_create_catch_unload_hook (pid, tempflag, filename, cond_string) | |
74 | ||
a14ed312 | 75 | extern void som_solib_create_catch_unload_hook (int, int, char *, char *); |
c906108c SS |
76 | |
77 | /* This function returns TRUE if the dynamic linker has just reported | |
78 | a load of a library. | |
79 | ||
80 | This function must be used only when the inferior has stopped in | |
81 | the dynamic linker hook, or undefined results are guaranteed. | |
c5aa993b | 82 | */ |
c906108c SS |
83 | #define SOLIB_HAVE_LOAD_EVENT(pid) \ |
84 | som_solib_have_load_event (pid) | |
85 | ||
a14ed312 | 86 | extern int som_solib_have_load_event (int); |
c906108c SS |
87 | |
88 | /* This function returns a pointer to the string representation of the | |
89 | pathname of the dynamically-linked library that has just been loaded. | |
90 | ||
91 | This function must be used only when SOLIB_HAVE_LOAD_EVENT is TRUE, | |
92 | or undefined results are guaranteed. | |
93 | ||
94 | This string's contents are only valid immediately after the inferior | |
95 | has stopped in the dynamic linker hook, and becomes invalid as soon | |
96 | as the inferior is continued. Clients should make a copy of this | |
97 | string if they wish to continue the inferior and then access the string. | |
c5aa993b | 98 | */ |
c906108c SS |
99 | #define SOLIB_LOADED_LIBRARY_PATHNAME(pid) \ |
100 | som_solib_loaded_library_pathname (pid) | |
101 | ||
a14ed312 | 102 | extern char *som_solib_loaded_library_pathname (int); |
c906108c SS |
103 | |
104 | /* This function returns TRUE if the dynamic linker has just reported | |
105 | an unload of a library. | |
106 | ||
107 | This function must be used only when the inferior has stopped in | |
108 | the dynamic linker hook, or undefined results are guaranteed. | |
c5aa993b | 109 | */ |
c906108c SS |
110 | #define SOLIB_HAVE_UNLOAD_EVENT(pid) \ |
111 | som_solib_have_unload_event (pid) | |
112 | ||
a14ed312 | 113 | extern int som_solib_have_unload_event (int); |
c906108c SS |
114 | |
115 | /* This function returns a pointer to the string representation of the | |
116 | pathname of the dynamically-linked library that has just been unloaded. | |
117 | ||
118 | This function must be used only when SOLIB_HAVE_UNLOAD_EVENT is TRUE, | |
119 | or undefined results are guaranteed. | |
120 | ||
121 | This string's contents are only valid immediately after the inferior | |
122 | has stopped in the dynamic linker hook, and becomes invalid as soon | |
123 | as the inferior is continued. Clients should make a copy of this | |
124 | string if they wish to continue the inferior and then access the string. | |
c5aa993b | 125 | */ |
c906108c SS |
126 | #define SOLIB_UNLOADED_LIBRARY_PATHNAME(pid) \ |
127 | som_solib_unloaded_library_pathname (pid) | |
128 | ||
a14ed312 | 129 | extern char *som_solib_unloaded_library_pathname (int); |
c906108c SS |
130 | |
131 | /* This function returns TRUE if pc is the address of an instruction that | |
132 | lies within the dynamic linker (such as the event hook, or the dld | |
133 | itself). | |
134 | ||
135 | This function must be used only when a dynamic linker event has been | |
136 | caught, and the inferior is being stepped out of the hook, or undefined | |
137 | results are guaranteed. | |
c5aa993b | 138 | */ |
c906108c SS |
139 | #define SOLIB_IN_DYNAMIC_LINKER(pid,pc) \ |
140 | som_solib_in_dynamic_linker (pid, pc) | |
141 | ||
a14ed312 | 142 | extern int som_solib_in_dynamic_linker (int, CORE_ADDR); |
c906108c SS |
143 | |
144 | /* This function must be called when the inferior is killed, and the program | |
145 | restarted. This is not the same as CLEAR_SOLIB, in that it doesn't discard | |
146 | any symbol tables. | |
147 | ||
148 | Presently, this functionality is not implemented. | |
c5aa993b | 149 | */ |
c906108c SS |
150 | #define SOLIB_RESTART() \ |
151 | som_solib_restart () | |
152 | ||
a14ed312 | 153 | extern void som_solib_restart (void); |
c906108c SS |
154 | |
155 | /* If we can't set a breakpoint, and it's in a shared library, just | |
156 | disable it. */ | |
157 | ||
158 | #define DISABLE_UNSETTABLE_BREAK(addr) (som_solib_address(addr) != NULL) | |
159 | ||
a14ed312 | 160 | extern char *som_solib_address (CORE_ADDR); /* somsolib.c */ |
c906108c SS |
161 | |
162 | /* If ADDR lies in a shared library, return its name. */ | |
163 | ||
164 | #define PC_SOLIB(addr) som_solib_address (addr) |