aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2007-09-03 22:04:02 +0000
committerPedro Alves <palves@redhat.com>2007-09-03 22:04:02 +0000
commit34d86dddf2da7c73da45f0d42b1799021bf86395 (patch)
tree7f10527c6fd74624b9d828f1f831e09ecb8e6404
parentca8385e5eda5a1521138ef3566c3b0970d7a919c (diff)
downloadgdb-34d86dddf2da7c73da45f0d42b1799021bf86395.zip
gdb-34d86dddf2da7c73da45f0d42b1799021bf86395.tar.gz
gdb-34d86dddf2da7c73da45f0d42b1799021bf86395.tar.bz2
* win32-low.c (handle_load_dll): Don't use toolhelp when waiting.
-rw-r--r--gdb/gdbserver/ChangeLog4
-rw-r--r--gdb/gdbserver/win32-low.c15
2 files changed, 16 insertions, 3 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 9698a28..2313e28 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,7 @@
+2007-09-03 Pedro Alves <pedro_alves@portugalmail.pt>
+
+ * win32-low.c (handle_load_dll): Don't use toolhelp when waiting.
+
2007-08-23 Joel Brobecker <brobecker@adacore.com>
* configure.ac: Switch license to GPLv3.
diff --git a/gdb/gdbserver/win32-low.c b/gdb/gdbserver/win32-low.c
index 42cbb90..755f816 100644
--- a/gdb/gdbserver/win32-low.c
+++ b/gdb/gdbserver/win32-low.c
@@ -1066,9 +1066,18 @@ handle_load_dll (void)
dll_buf[0] = dll_buf[sizeof (dll_buf) - 1] = '\0';
- if (!psapi_get_dll_name ((DWORD) (event->lpBaseOfDll), dll_buf)
- && !toolhelp_get_dll_name ((DWORD) (event->lpBaseOfDll), dll_buf))
- dll_buf[0] = dll_buf[sizeof (dll_buf) - 1] = '\0';
+ /* Windows does not report the image name of the dlls in the debug
+ event on attaches. We resort to iterating over the list of
+ loaded dlls looking for a match by image base. */
+ if (!psapi_get_dll_name ((DWORD) event->lpBaseOfDll, dll_buf))
+ {
+ if (!server_waiting)
+ /* On some versions of Windows and Windows CE, we can't create
+ toolhelp snapshots while the inferior is stopped in a
+ LOAD_DLL_DEBUG_EVENT due to a dll load, but we can while
+ Windows is reporting the already loaded dlls. */
+ toolhelp_get_dll_name ((DWORD) event->lpBaseOfDll, dll_buf);
+ }
dll_name = dll_buf;