| 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 target_ops; |
| 27 | |
| 28 | /* Called when we free all symtabs, to free the shared library information |
| 29 | as well. */ |
| 30 | |
| 31 | #define CLEAR_SOLIB clear_solib |
| 32 | |
| 33 | extern void clear_solib (void); |
| 34 | |
| 35 | /* Called to add symbols from a shared library to gdb's symbol table. */ |
| 36 | |
| 37 | #define SOLIB_ADD(filename, from_tty, targ, readsyms) \ |
| 38 | solib_add (filename, from_tty, targ, readsyms) |
| 39 | |
| 40 | extern void solib_add (char *, int, struct target_ops *, int); |
| 41 | |
| 42 | /* Function to be called when the inferior starts up, to discover the names |
| 43 | of shared libraries that are dynamically linked, the base addresses to |
| 44 | which they are linked, and sufficient information to read in their symbols |
| 45 | at a later time. */ |
| 46 | |
| 47 | #define SOLIB_CREATE_INFERIOR_HOOK(PID) solib_create_inferior_hook() |
| 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 | |
| 54 | This functionality is presently not implemented for this target. |
| 55 | */ |
| 56 | #define SOLIB_REMOVE_INFERIOR_HOOK(PID) (0) |
| 57 | |
| 58 | extern void solib_create_inferior_hook (void); /* solib.c */ |
| 59 | |
| 60 | /* This function returns TRUE if pc is the address of an instruction that |
| 61 | lies within the dynamic linker (such as the event hook, or the dld |
| 62 | itself). |
| 63 | |
| 64 | This function must be used only when a dynamic linker event has been |
| 65 | caught, and the inferior is being stepped out of the hook, or undefined |
| 66 | results are guaranteed. |
| 67 | |
| 68 | Presently, this functionality is not implemented. |
| 69 | */ |
| 70 | |
| 71 | /* |
| 72 | #define SOLIB_IN_DYNAMIC_LINKER(pid,pc) \ |
| 73 | error("catch of library loads/unloads not yet implemented on this platform") |
| 74 | */ |
| 75 | |
| 76 | #define SOLIB_IN_DYNAMIC_LINKER(pid,pc) \ |
| 77 | (0) |
| 78 | |
| 79 | /* This function must be called when the inferior is killed, and the program |
| 80 | restarted. This is not the same as CLEAR_SOLIB, in that it doesn't discard |
| 81 | any symbol tables. |
| 82 | |
| 83 | Presently, this functionality is not implemented. |
| 84 | */ |
| 85 | #define SOLIB_RESTART() \ |
| 86 | (0) |
| 87 | |
| 88 | /* If we can't set a breakpoint, and it's in a shared library, just |
| 89 | disable it. */ |
| 90 | |
| 91 | #define DISABLE_UNSETTABLE_BREAK(addr) (solib_address(addr) != NULL) |
| 92 | |
| 93 | extern char *solib_address (CORE_ADDR); /* solib.c */ |
| 94 | |
| 95 | /* If ADDR lies in a shared library, return its name. */ |
| 96 | |
| 97 | #define PC_SOLIB(addr) solib_address (addr) |
| 98 | |
| 99 | /* Return 1 if PC lies in the dynamic symbol resolution code of the |
| 100 | run time loader. */ |
| 101 | |
| 102 | #define IN_SOLIB_DYNSYM_RESOLVE_CODE(pc) in_solib_dynsym_resolve_code (pc) |
| 103 | |
| 104 | extern int in_solib_dynsym_resolve_code (CORE_ADDR); /* solib.c */ |
| 105 | |
| 106 | /* Discard symbols that were auto-loaded from shared libraries. */ |
| 107 | |
| 108 | extern void no_shared_libraries (char *ignored, int from_tty); |
| 109 | |
| 110 | #endif /* SOLIB_H */ |