diff options
author | Daniel Jacobowitz <dan@debian.org> | 2007-07-17 12:51:41 +0000 |
---|---|---|
committer | Daniel Jacobowitz <dan@debian.org> | 2007-07-17 12:51:41 +0000 |
commit | 4505688a76e09ca0c8c516558a0b59ca82fa8ff8 (patch) | |
tree | aef7689456e2691357675833ec20ef2e1c113c94 /gdb/testsuite/gdb.base/unload.c | |
parent | a964ff0867341ee67711c7a38cfebe99e9a0f04a (diff) | |
download | gdb-4505688a76e09ca0c8c516558a0b59ca82fa8ff8.tar.gz |
2007-07-17 Pedro Alves <pedro_alves@portugalmail.pt>
Daniel Jacobowitz <dan@codesourcery.com>
* config/i386/cygwin.mt (TDEPFILES): Add solib-target.o.
* coff-pe-read.c (read_pe_exported_syms): Delete verbose
printf.
* NEWS: Mention gdbserver DLL support.
* gdb.base/unload.c (dlopen, dlsym, dlclose, dlerror): Define
for __WIN32__.
(SHLIB_NAME): Delete definition. Always pass dlerror to fprintf.
* gdb.base/unload.exp: Use shared library test routines.
* inferiors.c (all_dlls, dlls_changed, get_dll): New.
(add_thread): Minor cleanups.
(clear_inferiors): Move lower in the file. Clear the DLL
list.
(free_one_dll, match_dll, loaded_dll, unloaded_dll, clear_list): New.
* remote-utils.c (prepare_resume_reply): Check dlls_changed.
(xml_escape_text): New.
* server.c (handle_query): Handle qXfer:libraries:read. Report it
for qSupported.
(handle_v_cont): Report errors.
(gdbserver_version): Update.
(main): Correct size of own_buf. Do not report initial DLL events.
* server.h (struct dll_info, all_dlls, dlls_changed, loaded_dll)
(unloaded_dll, xml_escape_text): New.
* win32-low.c (enum target_waitkind): Update comments.
(win32_add_one_solib, get_image_name, winapi_EnumProcessModules)
(winapi_GetModuleInformation, winapi_GetModuleFileNameExA)
(win32_EnumProcessModules, win32_GetModuleInformation)
(win32_GetModuleFileNameExA, load_psapi, psapi_get_dll_name)
(winapi_CreateToolhelp32Snapshot, winapi_Module32First)
(winapi_Module32Next, win32_CreateToolhelp32Snapshot)
(win32_Module32First, win32_Module32Next, load_toolhelp)
(toolhelp_get_dll_name, handle_load_dll, handle_unload_dll): New.
(get_child_debug_event): Handle DLL events.
(win32_wait): Likewise.
Diffstat (limited to 'gdb/testsuite/gdb.base/unload.c')
-rw-r--r-- | gdb/testsuite/gdb.base/unload.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gdb/testsuite/gdb.base/unload.c b/gdb/testsuite/gdb.base/unload.c index 799bb55584a..f8c8046e983 100644 --- a/gdb/testsuite/gdb.base/unload.c +++ b/gdb/testsuite/gdb.base/unload.c @@ -18,12 +18,19 @@ #include <stdio.h> #include <stdlib.h> + +#ifdef __WIN32__ +#include <windows.h> +#define dlopen(name, mode) LoadLibrary (name) +#define dlsym(handle, func) GetProcAddress (handle, func) +#define dlclose(handle) FreeLibrary (handle) +#define dlerror() "error %d occurred", GetLastError () +#else #include <dlfcn.h> +#endif int k = 0; -#define SHLIB_NAME SHLIB_DIR "/unloadshr.sl" - int main() { void *handle; @@ -32,11 +39,10 @@ int main() const char *msg; handle = dlopen (SHLIB_NAME, RTLD_LAZY); - msg = dlerror (); if (!handle) { - fprintf (stderr, msg); + fprintf (stderr, dlerror ()); exit (1); } |