This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Updated patch for Bug 13217 - thread apply all detach throws a SEGFAULT
- From: Tom Tromey <tromey at redhat dot com>
- To: ali_anwar <ali_anwar at codesourcery dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Thu, 27 Sep 2012 09:32:48 -0600
- Subject: Re: Updated patch for Bug 13217 - thread apply all detach throws a SEGFAULT
- References: <5062EA9B.1060505@codesourcery.com>
>>>>> "Ali" == ali anwar <ali_anwar@codesourcery.com> writes:
Ali> +static int
Ali> +thread_valid (struct thread_info *tp)
Ali> +{
Ali> + struct thread_info *utp;
Ali> + for (utp = thread_list; utp; utp = utp->next)
Ali> + if (tp == utp)
Ali> + return 1;
Ali> + return 0;
Ali> +}
Ali> + for (tp = thread_list; thread_valid(tp); tp = tp->next)
It seems like this introduces quadratic behavior here.
I think it would be better to avoid this.
Ali> + if (thread_count() == 0)
Ali> + break;
Here too.
Tom