This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA/Ada(v2) 1/3] Add command to list Ada exceptions
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: Pedro Alves <palves at redhat dot com>, gdb-patches at sourceware dot org
- Date: Fri, 8 Nov 2013 19:46:15 +0400
- Subject: Re: [RFA/Ada(v2) 1/3] Add command to list Ada exceptions
- Authentication-results: sourceware.org; auth=none
- References: <1383912219-13012-1-git-send-email-brobecker at adacore dot com> <1383912219-13012-2-git-send-email-brobecker at adacore dot com> <527CDD03 dot 9000200 at redhat dot com> <20131108133725 dot GA4585 at adacore dot com> <87li0zq7jq dot fsf at fleche dot redhat dot com>
> Joel> + if (regexp != NULL)
> Joel> + {
> Joel> + preg = alloca (sizeof (regex_t));
>
> I think regex_t is sufficiently small that you might as well declare an
> object in the outer scope and avoid alloca.
Sure, I can do that. I found this to be a fairly interesting
approach, because it avoids the need to check regexp repeatedly
in order to decide whether to pass &preg, or NULL.
> Joel> + discard_cleanups (old_chain);
>
> This leaks anything done by compile_rx_or_error. I think you need to
> pass an inner cleanup to do_cleanups.
Oops. I will fix!
Thank you :)
--
Joel