Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tom@tromey.com>,
	Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: Re: [PATCH 1/4] gdb: fix length of array view returned by some value_contents functions
Date: Tue, 16 Nov 2021 16:40:58 -0500	[thread overview]
Message-ID: <703da9ad-b42a-5690-b299-4dac7fa7a798@simark.ca> (raw)
In-Reply-To: <87lf1nesu0.fsf@tromey.com>

On 2021-11-16 3:41 p.m., Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:
> 
> Simon> From: Simon Marchi <simon.marchi@polymtl.ca>
> Simon> In commit 50888e42dcd3 ("gdb: change functions returning value contents
> Simon> to use gdb::array_view"), I believe I made a mistake with the length of
> Simon> the array views returned by some functions.  All functions return a view
> Simon> of `TYPE_LENGTH (value_type (type))` length.  This is not correct when
> Simon> the value's enclosing type is larger than the value's type.  In that
> Simon> case, the value's contents buffer is of the size of the enclosing type,
> Simon> and the value's actual contents is a slice of that (as returned by
> Simon> value_contents).  So, functions value_contents_all_raw,
> Simon> value_contents_for_printing and value_contents_for_printing_const are
> Simon> not correct.  Since they are meant to return the value's contents buffer
> Simon> as a whole, they should have the size of the enclosing type.
> 
> This looks good to me.
> 
> Tom
> 

Thanks, I pushed that one.

Simon

      reply	other threads:[~2021-11-16 21:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-08 21:06 Simon Marchi via Gdb-patches
2021-11-08 21:06 ` [PATCH 2/4] gdbsupport: add array_view copy function Simon Marchi via Gdb-patches
2021-11-08 21:11   ` Simon Marchi via Gdb-patches
2021-11-16 20:54     ` Tom Tromey
2021-11-16 20:53   ` Tom Tromey
2021-11-16 21:56     ` Simon Marchi via Gdb-patches
2021-11-17  0:20       ` Tom Tromey
2021-11-18 20:07         ` Simon Marchi
2021-11-08 21:06 ` [PATCH 3/4] gdb: make extract_integer take an array_view Simon Marchi via Gdb-patches
2021-11-08 21:06 ` [PATCH 4/4] gdb: trivial changes to use array_view Simon Marchi via Gdb-patches
2021-11-16 20:41 ` [PATCH 1/4] gdb: fix length of array view returned by some value_contents functions Tom Tromey
2021-11-16 21:40   ` 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=703da9ad-b42a-5690-b299-4dac7fa7a798@simark.ca \
    --to=simark@simark.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@efficios.com \
    --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