Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Joel Brobecker <brobecker@adacore.com>
Subject: Re: [RFA/RFC] Restore old handling of multi-register variables
Date: Thu, 06 Oct 2011 17:55:00 -0000	[thread overview]
Message-ID: <201110061854.52856.pedro@codesourcery.com> (raw)
In-Reply-To: <1317675787-7351-1-git-send-email-brobecker@adacore.com>

Hi Joel.

This is a bit a step backwards in that it doesn't allow
marking parts of the value as unavailable when the type
is longer than one register.  get_frame_register_value
was invented to allow for partially available registers.

> --- a/gdb/findvar.c
> +++ b/gdb/findvar.c
> @@ -668,9 +668,35 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame)
>        v = gdbarch_value_from_register (gdbarch, type, regnum, frame);
>  
>        /* Get the data.  */
> -      v2 = get_frame_register_value (frame, regnum);
> +      if (len > register_size (gdbarch, regnum))
> +       {

I'd rather we get rid of get_frame_register_bytes.
That is, pass down a value to get_frame_register_bytes (renaming
it along the way) instead of a buffer, and have it do basically
the same, but filling the value contents instead of writting to the buffer,
and have it mark the value pieces that are unavailable instead of
bailing out with error.  (May need to pass two different offsets
to it, one of register offset, other for value embedded offset,
not sure).  We could then reimplement get_frame_register_bytes as a
wrapper for the new  function as an interim until we get rid of
get_frame_register_bytes completely.  Something like:

int
get_frame_register_bytes (*type, regnum, offset, len, *myaddr,
                          *optimizedp, *unavailablep)
{
  val = allocate_value (type);
  read_frame_register_value?(v, frame, regnum, offset, len,
                             val_contents_all_raw (val));
  if (value_optimized_out (val))
    *optimizedp = 1;
  if (value_bytes_available (val, offset, len))
    *unavailablep = 1;
  if (!*optimizedp && !*unavailablep)
    {
      memcpy (myaddr, val_contents_all_raw (val) + offset, len);
      return 1;
    }
   return 0;
}

-- 
Pedro Alves


  reply	other threads:[~2011-10-06 17:55 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-03 21:03 Joel Brobecker
2011-10-06 17:55 ` Pedro Alves [this message]
2011-10-06 20:11   ` Joel Brobecker
2011-10-06 21:00     ` Pedro Alves
2011-10-07 16:38       ` Joel Brobecker
2011-10-07 16:52         ` Pedro Alves
2011-10-22 14:48   ` Joel Brobecker
2011-10-25 19:34     ` Pedro Alves
2011-10-25 20:37       ` Joel Brobecker
2011-10-25 21:09         ` Pedro Alves
2011-10-26 21:44           ` Joel Brobecker
2011-10-26 22:11             ` Joel Brobecker
2011-10-27 15:57               ` Tom Tromey
2011-10-27 17:51                 ` Joel Brobecker
2011-10-27  2:56             ` Joel Brobecker
2011-10-27 11:10             ` Pedro Alves
2011-10-27 17:56               ` Joel Brobecker
2011-10-31  3:17             ` [RFA] read_frame_register_value and big endian arches Joel Brobecker
2011-11-07 19:42               ` Pedro Alves
2011-11-07 21:24                 ` Joel Brobecker
2011-11-10 17:15                 ` Checked in: " Joel Brobecker
2011-11-16 18:23                   ` Ulrich Weigand
2011-11-18  2:01                     ` Joel Brobecker
2011-11-18 17:40                       ` Ulrich Weigand
2011-11-18 19:41                         ` Joel Brobecker
2011-11-18 20:06                           ` [commit] " Ulrich Weigand

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=201110061854.52856.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /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