diff options
author | Pedro Alves <palves@redhat.com> | 2009-03-22 22:34:04 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2009-03-22 22:34:04 +0000 |
commit | a07b2135dbda574558da179559ccc1cd335f896e (patch) | |
tree | e6a19a0707914c518699df20abc72b3893b66057 /gdb | |
parent | 67cc2626af61ad9a85dbc775f06a2220baf7ed15 (diff) | |
download | gdb-a07b2135dbda574558da179559ccc1cd335f896e.zip gdb-a07b2135dbda574558da179559ccc1cd335f896e.tar.gz gdb-a07b2135dbda574558da179559ccc1cd335f896e.tar.bz2 |
* inferiors.c (find_inferior): Make it safe for the callback
function to delete the currently iterated inferior.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/gdbserver/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/gdbserver/inferiors.c | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 5060258..f4a5ca7 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,5 +1,10 @@ 2009-03-22 Pedro Alves <pedro@codesourcery.com> + * inferiors.c (find_inferior): Make it safe for the callback + function to delete the currently iterated inferior. + +2009-03-22 Pedro Alves <pedro@codesourcery.com> + * Makefile.in (linuw_low_h): Move higher. (thread-db.o): Depend on $(linux_low_h). diff --git a/gdb/gdbserver/inferiors.c b/gdb/gdbserver/inferiors.c index bebec9a..8ad64fa 100644 --- a/gdb/gdbserver/inferiors.c +++ b/gdb/gdbserver/inferiors.c @@ -180,9 +180,12 @@ find_inferior (struct inferior_list *list, while (inf != NULL) { + struct inferior_list_entry *next; + + next = inf->next; if ((*func) (inf, arg)) return inf; - inf = inf->next; + inf = next; } return NULL; |