From: Pedro Alves <palves@redhat.com>
To: Simon Marchi <simon.marchi@ericsson.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 5/5] Add new test internalvar.exp
Date: Fri, 24 Jul 2015 11:41:00 -0000 [thread overview]
Message-ID: <55B22461.8090702@redhat.com> (raw)
In-Reply-To: <1437072684-26565-5-git-send-email-simon.marchi@ericsson.com>
On 07/16/2015 07:51 PM, Simon Marchi wrote:
> I wrote this test While doing the work that lead to the previous patch,
> so I thought I would contribute it upstream. From what I can see, there
> is no test currently to verify operations on internal variables (please
> point me to it if I'm wrong).
Pedantically, it'd be better to call these convenience vars.
Convenience var specifics are tested in gdbvars.exp. Likely we have this
more covered on the C++ tests. Something like what you're testing, but
for bitfields, is done in bitfields.exp. structs.exp is for infcalls, which IIRC
your target doesn't do. I guess one could hack a bug in the value field access
code somewhere in value.c/valops.c/valprint.c, and the find the test that
has more failures. :-)
In any case, more tests can't hurt. :-)
AFAICS, this is really more about getting value field offsets and contents
right than convenience vars per se, which end up just exercising the
routine value paths.
You could put these in gdb.base/struct3.c|.exp, which if you look
at struct3.c, it's structure is similar, with an inner and outer struct too.
Otherwise, I'd suggest renaming the test in the value
direction -- value-fields.exp, value-units.exp, value-offsets.exp or
some such.
I'd also suggest making the describing comment be something like:
# Test accessing different fields of structures, inner structures,
# arrays, etc., and make sure GDB prints the right contents. Handy to
# exercise the value machinery code that handles host vs target bytes/memory
# units.
Anyway, the test code itself looks good to me, with:
> ---
> gdb/testsuite/gdb.base/internalvar.c | 45 ++++++++++++++++++++++++++++++++++
> gdb/testsuite/gdb.base/internalvar.exp | 42 +++++++++++++++++++++++++++++++
> 2 files changed, 87 insertions(+)
> create mode 100644 gdb/testsuite/gdb.base/internalvar.c
> create mode 100644 gdb/testsuite/gdb.base/internalvar.exp
>
> diff --git a/gdb/testsuite/gdb.base/internalvar.c b/gdb/testsuite/gdb.base/internalvar.c
> new file mode 100644
> index 0000000..2aadc11
> --- /dev/null
> +++ b/gdb/testsuite/gdb.base/internalvar.c
> @@ -0,0 +1,45 @@
Copyright header missing.
Thanks,
Pedro Alves
next prev parent reply other threads:[~2015-07-24 11:41 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-16 18:51 [PATCH 1/5] Update comment for struct type's length field, introduce type_length_units Simon Marchi
2015-07-16 18:51 ` [PATCH 2/5] Update comments in struct value for non-8-bits architectures Simon Marchi
2015-07-24 11:27 ` Pedro Alves
2015-07-27 21:46 ` Simon Marchi
2015-07-28 10:20 ` Pedro Alves
2015-07-16 18:51 ` [PATCH 4/5] Consider addressable memory unit size in various value functions Simon Marchi
2015-07-24 11:27 ` Pedro Alves
2015-07-27 22:05 ` Simon Marchi
2015-07-28 10:29 ` Pedro Alves
2015-07-28 15:07 ` Simon Marchi
2015-07-16 18:51 ` [PATCH 3/5] Introduce get_value_arch Simon Marchi
2015-07-24 11:27 ` Pedro Alves
2015-07-27 21:47 ` Simon Marchi
2015-07-28 10:25 ` Pedro Alves
2015-07-28 14:56 ` Simon Marchi
2015-07-28 15:06 ` Simon Marchi
2015-07-16 18:51 ` [PATCH 5/5] Add new test internalvar.exp Simon Marchi
2015-07-24 11:41 ` Pedro Alves [this message]
2015-07-24 11:26 ` [PATCH 1/5] Update comment for struct type's length field, introduce type_length_units Pedro Alves
2015-07-27 21:37 ` Simon Marchi
2015-07-28 10:19 ` Pedro Alves
2015-07-28 15:04 ` Simon Marchi
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=55B22461.8090702@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@ericsson.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