From: Simon Marchi <simon.marchi@polymtl.ca>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA 2/2] C++-ify break-catch-throw
Date: Mon, 05 Jun 2017 08:54:00 -0000 [thread overview]
Message-ID: <2ab77f7b8d7bd7454be1fe232e2b28fd@polymtl.ca> (raw)
In-Reply-To: <20170604225353.18008-3-tom@tromey.com>
> --- a/gdb/break-catch-throw.c
> +++ b/gdb/break-catch-throw.c
> @@ -82,15 +82,15 @@ struct exception_catchpoint : public breakpoint
>
> enum exception_event_kind kind;
>
> - /* If non-NULL, an xmalloc'd string holding the source form of the
> - regular expression to match against. */
> + /* If not empty, a string holding the source form of the regular
> + expression to match against. */
>
> - char *exception_rx;
> + std::string exception_rx;
>
> - /* If non-NULL, an xmalloc'd, compiled regular expression which is
> + /* If non-NULL, a compiled regular expression which is
> used to determine which exceptions to stop on. */
>
> - regex_t *pattern;
> + std::unique_ptr<regex_t> pattern;
From what I understand, we were freeing the regex with regfree, but we
weren't freeing the regex_t object, which is allocated separately, is
that right? Or what is freed in handle_gnu_v3_exceptions by the
cleanup, and then referenced later? Either way your code LGTM.
Simon
next prev parent reply other threads:[~2017-06-05 8:54 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-04 22:54 [RFA 0/2] C++-ify some breakpoint subclasses a bit more Tom Tromey
2017-06-04 22:54 ` [RFA 2/2] C++-ify break-catch-throw Tom Tromey
2017-06-05 8:54 ` Simon Marchi [this message]
2017-06-05 19:10 ` Tom Tromey
2017-06-05 10:21 ` Pedro Alves
2017-06-05 10:33 ` Pedro Alves
2017-06-05 10:36 ` Pedro Alves
2017-06-05 12:29 ` Pedro Alves
2017-06-05 12:32 ` Pedro Alves
2017-06-05 19:27 ` Tom Tromey
2017-06-06 16:22 ` Pedro Alves
2017-06-07 12:38 ` Tom Tromey
2017-06-07 13:40 ` [pushed] Introduce compiled_regex, eliminate make_regfree_cleanup (Re: [RFA 2/2] C++-ify break-catch-throw) Pedro Alves
2017-06-04 22:54 ` [RFA 1/2] C++-ify break-catch-sig Tom Tromey
2017-06-05 8:43 ` Simon Marchi
2017-06-05 13:13 ` Tom Tromey
2017-06-05 13:53 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2ab77f7b8d7bd7454be1fe232e2b28fd@polymtl.ca \
--to=simon.marchi@polymtl.ca \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox