1130803Smarcel/* HP PA64 ELF Shared library declarations for GDB, the GNU Debugger. 2130803Smarcel Copyright 1999, 2000 Free Software Foundation, Inc. 3130803Smarcel 4130803Smarcel This file is part of GDB. 5130803Smarcel 6130803Smarcel This program is free software; you can redistribute it and/or modify 7130803Smarcel it under the terms of the GNU General Public License as published by 8130803Smarcel the Free Software Foundation; either version 2 of the License, or 9130803Smarcel (at your option) any later version. 10130803Smarcel 11130803Smarcel This program is distributed in the hope that it will be useful, 12130803Smarcel but WITHOUT ANY WARRANTY; without even the implied warranty of 13130803Smarcel MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14130803Smarcel GNU General Public License for more details. 15130803Smarcel 16130803Smarcel You should have received a copy of the GNU General Public License 17130803Smarcel along with this program; if not, write to the Free Software 18130803Smarcel Foundation, Inc., 59 Temple Place - Suite 330, 19130803Smarcel Boston, MA 02111-1307, USA. */ 20130803Smarcel 21130803Smarcel/* Forward decl's for prototypes */ 22130803Smarcelstruct target_ops; 23130803Smarcelstruct objfile; 24130803Smarcelstruct section_offsets; 25130803Smarcel 26130803Smarcel/* Called to add symbols from a shared library to gdb's symbol table. */ 27130803Smarcel 28130803Smarcel#define SOLIB_ADD(filename, from_tty, targ, readsyms) \ 29130803Smarcel pa64_solib_add (filename, from_tty, targ, readsyms) 30130803Smarcel 31130803Smarcelextern void pa64_solib_add (char *, int, struct target_ops *, int); 32130803Smarcel 33130803Smarcelextern CORE_ADDR pa64_solib_get_got_by_pc (CORE_ADDR); 34130803Smarcel 35130803Smarcel/* Function to be called when the inferior starts up, to discover the names 36130803Smarcel of shared libraries that are dynamically linked, the base addresses to 37130803Smarcel which they are linked, and sufficient information to read in their symbols 38130803Smarcel at a later time. */ 39130803Smarcel 40130803Smarcel#define SOLIB_CREATE_INFERIOR_HOOK(PID) pa64_solib_create_inferior_hook() 41130803Smarcel 42130803Smarcelextern void pa64_solib_create_inferior_hook (void); 43130803Smarcel 44130803Smarcel/* Function to be called to remove the connection between debugger and 45130803Smarcel dynamic linker that was established by SOLIB_CREATE_INFERIOR_HOOK. 46130803Smarcel (This operation does not remove shared library information from 47130803Smarcel the debugger, as CLEAR_SOLIB does.) */ 48130803Smarcel#define SOLIB_REMOVE_INFERIOR_HOOK(PID) pa64_solib_remove_inferior_hook(PID) 49130803Smarcel 50130803Smarcelextern void pa64_solib_remove_inferior_hook (int); 51130803Smarcel 52130803Smarcel/* This function is called by the "catch load" command. It allows 53130803Smarcel the debugger to be notified by the dynamic linker when a specified 54130803Smarcel library file (or any library file, if filename is NULL) is loaded. */ 55130803Smarcel#define SOLIB_CREATE_CATCH_LOAD_HOOK(pid,tempflag, filename,cond_string) \ 56130803Smarcel pa64_solib_create_catch_load_hook (pid, tempflag, filename, cond_string) 57130803Smarcel 58130803Smarcelextern void pa64_solib_create_catch_load_hook (int, int, char *, char *); 59130803Smarcel 60130803Smarcel/* This function is called by the "catch unload" command. It allows 61130803Smarcel the debugger to be notified by the dynamic linker when a specified 62130803Smarcel library file (or any library file, if filename is NULL) is unloaded. */ 63130803Smarcel#define SOLIB_CREATE_CATCH_UNLOAD_HOOK(pid,tempflag,filename, cond_string) \ 64130803Smarcel pa64_solib_create_catch_unload_hook (pid, tempflag, filename, cond_string) 65130803Smarcel 66130803Smarcelextern void pa64_solib_create_catch_unload_hook (int, int, char *, char *); 67130803Smarcel 68130803Smarcel/* This function returns TRUE if the dynamic linker has just reported 69130803Smarcel a load of a library. 70130803Smarcel 71130803Smarcel This function must be used only when the inferior has stopped in 72130803Smarcel the dynamic linker hook, or undefined results are guaranteed. */ 73130803Smarcel#define SOLIB_HAVE_LOAD_EVENT(pid) \ 74130803Smarcel pa64_solib_have_load_event (pid) 75130803Smarcel 76130803Smarcelextern int pa64_solib_have_load_event (int); 77130803Smarcel 78130803Smarcel/* This function returns a pointer to the string representation of the 79130803Smarcel pathname of the dynamically-linked library that has just been loaded. 80130803Smarcel 81130803Smarcel This function must be used only when SOLIB_HAVE_LOAD_EVENT is TRUE, 82130803Smarcel or undefined results are guaranteed. 83130803Smarcel 84130803Smarcel This string's contents are only valid immediately after the inferior 85130803Smarcel has stopped in the dynamic linker hook, and becomes invalid as soon 86130803Smarcel as the inferior is continued. Clients should make a copy of this 87130803Smarcel string if they wish to continue the inferior and then access the string. */ 88130803Smarcel#define SOLIB_LOADED_LIBRARY_PATHNAME(pid) \ 89130803Smarcel pa64_solib_loaded_library_pathname (pid) 90130803Smarcel 91130803Smarcelextern char *pa64_solib_loaded_library_pathname (int); 92130803Smarcel 93130803Smarcel/* This function returns TRUE if the dynamic linker has just reported 94130803Smarcel an unload of a library. 95130803Smarcel 96130803Smarcel This function must be used only when the inferior has stopped in 97130803Smarcel the dynamic linker hook, or undefined results are guaranteed. */ 98130803Smarcel#define SOLIB_HAVE_UNLOAD_EVENT(pid) \ 99130803Smarcel pa64_solib_have_unload_event (pid) 100130803Smarcel 101130803Smarcelextern int pa64_solib_have_unload_event (int); 102130803Smarcel 103130803Smarcel/* This function returns a pointer to the string representation of the 104130803Smarcel pathname of the dynamically-linked library that has just been unloaded. 105130803Smarcel 106130803Smarcel This function must be used only when SOLIB_HAVE_UNLOAD_EVENT is TRUE, 107130803Smarcel or undefined results are guaranteed. 108130803Smarcel 109130803Smarcel This string's contents are only valid immediately after the inferior 110130803Smarcel has stopped in the dynamic linker hook, and becomes invalid as soon 111130803Smarcel as the inferior is continued. Clients should make a copy of this 112130803Smarcel string if they wish to continue the inferior and then access the string. */ 113130803Smarcel#define SOLIB_UNLOADED_LIBRARY_PATHNAME(pid) \ 114130803Smarcel pa64_solib_unloaded_library_pathname (pid) 115130803Smarcel 116130803Smarcelextern char *pa64_solib_unloaded_library_pathname (int); 117130803Smarcel 118130803Smarcel/* This function returns TRUE if pc is the address of an instruction that 119130803Smarcel lies within the dynamic linker (such as the event hook, or the dld 120130803Smarcel itself). 121130803Smarcel 122130803Smarcel This function must be used only when a dynamic linker event has been 123130803Smarcel caught, and the inferior is being stepped out of the hook, or undefined 124130803Smarcel results are guaranteed. */ 125130803Smarcel#define SOLIB_IN_DYNAMIC_LINKER(pid,pc) \ 126130803Smarcel pa64_solib_in_dynamic_linker (pid, pc) 127130803Smarcel 128130803Smarcelextern int pa64_solib_in_dynamic_linker (int, CORE_ADDR); 129130803Smarcel 130130803Smarcel/* This function must be called when the inferior is killed, and the program 131130803Smarcel restarted. This is not the same as CLEAR_SOLIB, in that it doesn't discard 132130803Smarcel any symbol tables. 133130803Smarcel 134130803Smarcel Presently, this functionality is not implemented. */ 135130803Smarcel#define SOLIB_RESTART() \ 136130803Smarcel pa64_solib_restart () 137130803Smarcel 138130803Smarcelextern void pa64_solib_restart (void); 139130803Smarcel 140130803Smarcel/* If we can't set a breakpoint, and it's in a shared library, just 141130803Smarcel disable it. */ 142130803Smarcel 143130803Smarcel#define DISABLE_UNSETTABLE_BREAK(addr) (pa64_solib_address(addr) != NULL) 144130803Smarcel 145130803Smarcelextern char *pa64_solib_address (CORE_ADDR); /* somsolib.c */ 146130803Smarcel 147130803Smarcel/* If ADDR lies in a shared library, return its name. */ 148130803Smarcel 149130803Smarcel#define PC_SOLIB(addr) pa64_solib_address (addr) 150