Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
Subject: Re: [RFA] Change enable_thread_stack_temporaries to an RAII class
Date: Fri, 09 Mar 2018 03:58:00 -0000	[thread overview]
Message-ID: <c03c742f-ed36-650c-2d9a-99312042d37a@simark.ca> (raw)
In-Reply-To: <20180308053543.18516-1-tom@tromey.com>

Oops, forgot this one:

On 2018-03-08 12:35 AM, Tom Tromey wrote:
> @@ -810,29 +771,26 @@ push_thread_stack_temporary (ptid_t ptid, struct value *v)
>    struct thread_info *tp = find_thread_ptid (ptid);
>  
>    gdb_assert (tp != NULL && tp->stack_temporaries_enabled);
> -  VEC_safe_push (value_ptr, tp->stack_temporaries, v);
> +  tp->stack_temporaries.push_back (v);
>  }
>  
> -/* Return 1 if VAL is among the stack temporaries of the thread
> -   with id PTID.  Return 0 otherwise.  */
> +/* Return true if VAL is among the stack temporaries of the thread
> +   with id PTID.  Return false otherwise.  */
>  
> -int
> +bool
>  value_in_thread_stack_temporaries (struct value *val, ptid_t ptid)
>  {
>    struct thread_info *tp = find_thread_ptid (ptid);
>  
>    gdb_assert (tp != NULL && tp->stack_temporaries_enabled);
> -  if (!VEC_empty (value_ptr, tp->stack_temporaries))
> +  if (!tp->stack_temporaries.empty ())
>      {
> -      struct value *v;
> -      int i;
> -
> -      for (i = 0; VEC_iterate (value_ptr, tp->stack_temporaries, i, v); i++)
> +      for (struct value *v : tp->stack_temporaries)
>  	if (v == val)
> -	  return 1;
> +	  return true;

The "if (!tp->stack_temporaries.empty ())" here is now unnecessary.

Simon


      parent reply	other threads:[~2018-03-09  3:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-08  5:35 Tom Tromey
2018-03-09  3:57 ` Simon Marchi
2018-03-09  4:58   ` Tom Tromey
2018-03-09  3:58 ` Simon Marchi [this message]

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=c03c742f-ed36-650c-2d9a-99312042d37a@simark.ca \
    --to=simark@simark.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