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