aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2010-02-02 04:24:26 +0000
committerJoel Brobecker <brobecker@gnat.com>2010-02-02 04:24:26 +0000
commit0718675c768e5a5d2fc96a6a4e70cd52fe148c16 (patch)
tree8c227cc2fa74a7ddb9e511732b3c5a0ac55a4437 /gdb
parent546c74577f9ddfeb870b518f3c1d32e71bed52be (diff)
downloadfsf-binutils-gdb-0718675c768e5a5d2fc96a6a4e70cd52fe148c16.zip
fsf-binutils-gdb-0718675c768e5a5d2fc96a6a4e70cd52fe148c16.tar.gz
fsf-binutils-gdb-0718675c768e5a5d2fc96a6a4e70cd52fe148c16.tar.bz2
gdbserver crash when running 32bits exes on x64 Windows.
* inferiors.c (find_inferior): Add function documentation. (unloaded_dll): Handle the case where the unloaded dll has not been previously registered in the dll list.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/gdbserver/ChangeLog7
-rw-r--r--gdb/gdbserver/inferiors.c25
2 files changed, 29 insertions, 3 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index e62f630..08277da 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,10 @@
+2010-02-02 Nicolas Roche <roche@sourceware.org>
+ Joel Brobecker <brobecker@adacore.com>
+
+ * inferiors.c (find_inferior): Add function documentation.
+ (unloaded_dll): Handle the case where the unloaded dll has not
+ been previously registered in the dll list.
+
2010-02-01 Daniel Jacobowitz <dan@codesourcery.com>
* linux-arm-low.c (thumb_breakpoint_len): Delete.
diff --git a/gdb/gdbserver/inferiors.c b/gdb/gdbserver/inferiors.c
index c1a1881..097326d 100644
--- a/gdb/gdbserver/inferiors.c
+++ b/gdb/gdbserver/inferiors.c
@@ -249,6 +249,9 @@ remove_thread (struct thread_info *thread)
free_one_thread (&thread->entry);
}
+/* Find the first inferior_list_entry E in LIST for which FUNC (E, ARG)
+ returns non-zero. If no entry is found then return NULL. */
+
struct inferior_list_entry *
find_inferior (struct inferior_list *list,
int (*func) (struct inferior_list_entry *, void *), void *arg)
@@ -366,9 +369,25 @@ unloaded_dll (const char *name, CORE_ADDR base_addr)
key_dll.base_addr = base_addr;
dll = (void *) find_inferior (&all_dlls, match_dll, &key_dll);
- remove_inferior (&all_dlls, &dll->entry);
- free_one_dll (&dll->entry);
- dlls_changed = 1;
+
+ if (dll == NULL)
+ /* For some inferiors we might get unloaded_dll events without having
+ a corresponding loaded_dll. In that case, the dll cannot be found
+ in ALL_DLL, and there is nothing further for us to do.
+
+ This has been observed when running 32bit executables on Windows64
+ (i.e. through WOW64, the interface between the 32bits and 64bits
+ worlds). In that case, the inferior always does some strange
+ unloading of unnamed dll. */
+ return;
+ else
+ {
+ /* DLL has been found so remove the entry and free associated
+ resources. */
+ remove_inferior (&all_dlls, &dll->entry);
+ free_one_dll (&dll->entry);
+ dlls_changed = 1;
+ }
}
#define clear_list(LIST) \