From: Matt Rice <ratmice@gmail.com>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: RFA: implement ambiguous linespec proposal
Date: Fri, 28 Oct 2011 20:52:00 -0000 [thread overview]
Message-ID: <CACTLOFrCdE7bcM8baby7ydPfg4+zcm0V6_nMdKdYXyy==WOLDg@mail.gmail.com> (raw)
In-Reply-To: <m3obx184iu.fsf@fleche.redhat.com>
On Fri, Oct 28, 2011 at 9:28 AM, Tom Tromey <tromey@redhat.com> wrote:
> I'd appreciate comments on this patch.
In the following snippet, the initial comment doesn't mention
destroy_linespec_result,
and some of the field comments mention that the caller is responsible
for freeing.
destroy_linespec_result seems to fulfill this obligation,
I imagine that the comments just predate destroy_linespec_result, or
there is an OR situation e.g. if the caller wants to save some fields
they are responsible. Anyhow it'd be nice to clarify that in the
comments.
thanks
> /* An instance of this may be filled in by decode_line_1. The caller
> must call init_linespec_result to initialize it. */
>
> @@ -30,22 +49,85 @@ struct linespec_result
> display mechanism would do the wrong thing. */
> int special_display;
>
> - /* If non-NULL, an array of canonical names for returned
> - symtab_and_line objects. The array has as many elements as the
> - `nelts' field in the symtabs_and_line returned by decode_line_1.
> - An element in the array may be NULL. The array and each non-NULL
> - element in it are allocated with xmalloc and must be freed by the
> - caller. */
> - char **canonical;
> + /* If non-zero, the linespec result should be considered to be a
> + "pre-expanded" multi-location linespec. A pre-expanded linespec
> + holds all matching locations in a single linespec_sals
> + object. */
> + int pre_expanded;
> +
> + /* If PRE_EXPANDED is non-zero, this is set to the linespec entered
> + by the user. This is allocated with xmalloc and the caller is
> + responsible for freeing it. */
> + char *addr_string;
> +
> + /* The sals. The vector should be freed by the caller. */
> + VEC (linespec_sals) *sals;
> };
>
> /* Initialize a linespec_result. */
>
> extern void init_linespec_result (struct linespec_result *);
>
> +/* Destroy a linespec_result. */
> +
> +extern void destroy_linespec_result (struct linespec_result *);
> +
> +/* Return a cleanup that destroys a linespec_result. */
> +
> +extern struct cleanup *
> + make_cleanup_destroy_linespec_result (struct linespec_result *);
> +
next prev parent reply other threads:[~2011-10-28 20:51 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-28 17:34 Tom Tromey
2011-10-28 20:52 ` Matt Rice [this message]
2011-11-01 20:38 ` Tom Tromey
2011-10-28 22:41 ` Jan Kratochvil
2011-11-01 20:58 ` Tom Tromey
2011-11-03 20:49 ` Tom Tromey
2011-11-04 7:46 ` Jan Kratochvil
2011-11-08 16:36 ` Tom Tromey
2011-11-09 16:05 ` Joel Brobecker
2011-11-09 17:12 ` Tom Tromey
2011-11-09 17:56 ` Joel Brobecker
2011-11-09 18:19 ` Tom Tromey
2011-11-09 19:00 ` Joel Brobecker
2011-11-14 21:04 ` Tom Tromey
2011-11-14 21:32 ` Jerome Guitton
2011-11-09 18:37 ` Tom Tromey
2011-11-14 21:11 ` Tom Tromey
2011-11-15 16:30 ` Tom Tromey
2011-11-15 16:59 ` Pierre Muller
2011-11-16 0:09 ` Jan Kratochvil
2011-11-16 1:58 ` Joel Brobecker
2011-11-16 14:46 ` Tom Tromey
2011-11-18 14:10 ` Tom Tromey
2011-11-16 21:23 ` Stan Shebs
2011-11-16 2:28 ` Yao Qi
2011-11-16 3:20 ` Doug Evans
2011-11-16 14:46 ` Tom Tromey
2011-11-16 16:06 ` Tom Tromey
2011-11-16 4:57 ` Doug Evans
2011-11-16 5:22 ` Doug Evans
2011-11-16 14:54 ` Tom Tromey
2011-11-16 16:32 ` Doug Evans
2011-11-16 16:39 ` Tom Tromey
2011-11-16 14:49 ` Tom Tromey
2011-11-16 8:15 ` Yao Qi
2011-11-16 16:17 ` Tom Tromey
2011-11-16 15:43 ` Yao Qi
2011-11-16 16:11 ` Tom Tromey
2011-11-16 16:44 ` Tom Tromey
2011-11-17 3:49 ` Yao Qi
2011-11-21 21:50 ` Tom Tromey
2011-11-23 21:33 ` 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='CACTLOFrCdE7bcM8baby7ydPfg4+zcm0V6_nMdKdYXyy==WOLDg@mail.gmail.com' \
--to=ratmice@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@redhat.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