1*a45ae5f8SJohn Marino /* Platform independent shared object routines for GDB. 2*a45ae5f8SJohn Marino 3*a45ae5f8SJohn Marino Copyright (C) 2011-2012 Free Software Foundation, Inc. 4*a45ae5f8SJohn Marino 5*a45ae5f8SJohn Marino This file is part of GDB. 6*a45ae5f8SJohn Marino 7*a45ae5f8SJohn Marino This program is free software; you can redistribute it and/or modify 8*a45ae5f8SJohn Marino it under the terms of the GNU General Public License as published by 9*a45ae5f8SJohn Marino the Free Software Foundation; either version 3 of the License, or 10*a45ae5f8SJohn Marino (at your option) any later version. 11*a45ae5f8SJohn Marino 12*a45ae5f8SJohn Marino This program is distributed in the hope that it will be useful, 13*a45ae5f8SJohn Marino but WITHOUT ANY WARRANTY; without even the implied warranty of 14*a45ae5f8SJohn Marino MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15*a45ae5f8SJohn Marino GNU General Public License for more details. 16*a45ae5f8SJohn Marino 17*a45ae5f8SJohn Marino You should have received a copy of the GNU General Public License 18*a45ae5f8SJohn Marino along with this program. If not, see <http://www.gnu.org/licenses/>. */ 19*a45ae5f8SJohn Marino 20*a45ae5f8SJohn Marino #ifndef GDB_DLFCN_H 21*a45ae5f8SJohn Marino #define GDB_DLFCN_H 22*a45ae5f8SJohn Marino 23*a45ae5f8SJohn Marino #include "defs.h" 24*a45ae5f8SJohn Marino 25*a45ae5f8SJohn Marino /* Load the dynamic library file named FILENAME, and return a handle 26*a45ae5f8SJohn Marino for that dynamic library. Return NULL if the loading fails for any 27*a45ae5f8SJohn Marino reason. */ 28*a45ae5f8SJohn Marino 29*a45ae5f8SJohn Marino void *gdb_dlopen (const char *filename); 30*a45ae5f8SJohn Marino 31*a45ae5f8SJohn Marino /* Return the address of the symbol named SYMBOL inside the shared 32*a45ae5f8SJohn Marino library whose handle is HANDLE. Return NULL when the symbol could 33*a45ae5f8SJohn Marino not be found. */ 34*a45ae5f8SJohn Marino 35*a45ae5f8SJohn Marino void *gdb_dlsym (void *handle, const char *symbol); 36*a45ae5f8SJohn Marino 37*a45ae5f8SJohn Marino /* Install a cleanup routine which closes the handle HANDLE. */ 38*a45ae5f8SJohn Marino 39*a45ae5f8SJohn Marino struct cleanup *make_cleanup_dlclose (void *handle); 40*a45ae5f8SJohn Marino 41*a45ae5f8SJohn Marino /* Cleanup the shared object pointed to by HANDLE. Return 0 on success 42*a45ae5f8SJohn Marino and nonzero on failure. */ 43*a45ae5f8SJohn Marino 44*a45ae5f8SJohn Marino int gdb_dlclose (void *handle); 45*a45ae5f8SJohn Marino 46*a45ae5f8SJohn Marino /* Return non-zero if the dynamic library functions are available on 47*a45ae5f8SJohn Marino this platform. */ 48*a45ae5f8SJohn Marino 49*a45ae5f8SJohn Marino int is_dl_available(void); 50*a45ae5f8SJohn Marino 51*a45ae5f8SJohn Marino #endif /* GDB_DLFCN_H */ 52