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