From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Joel Brobecker <brobecker@adacore.com>
Subject: Re: [RFA v2] valprint.c / *-valprint.c: Don't lose `embedded_offset'
Date: Mon, 24 Jan 2011 19:47:00 -0000 [thread overview]
Message-ID: <201101241946.24681.pedro@codesourcery.com> (raw)
In-Reply-To: <201101241322.42902.pedro@codesourcery.com>
On Monday 24 January 2011 13:22:42, Pedro Alves wrote:
> Compared to the previous patch, this fixes a bug in
> array repeat repetition handling, and adds a testcase
> to cover it.
For the archive's and future hackers doing code archaeology 's benefit,
here's the description of the problem I had tripped on:
The original patch at
<http://sourceware.org/ml/gdb-patches/2010-10/msg00108.html>
missed references to `valaddr' in val_print_array_elements that
should have been updated to take embedded_offset into account.
(I completely missed them because I'd been working with a patch
on top that replaces the memcmp check in val_print_array_elements
with some other function, and _that_ was taking the embedded_offset
into account.)
Surprisingly or not, the testsuite did not catch this, so
I've adding the new test that fails without the fix.
With the new test, and old patch, we'd print this:
(gdb) p /x some_struct
$2 = {a = 0x12345678, b = 0x87654321, array = {0xaa, 0xaa, 0xaa, 0xaa, 0xaa,
0xaa, 0xaa, 0xaa, 0xaa <repeats 12 times>}}
while we should print:
(gdb) p/x some_struct
$2 = {a = 0x12345678, b = 0x87654321, array = {0xaa <repeats 20 times>}}
Sorry for the spam. I'm done now. :-)
--
Pedro Alves
next prev parent reply other threads:[~2011-01-24 19:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-24 13:24 Pedro Alves
2011-01-24 16:56 ` Pedro Alves
2011-01-24 17:37 ` Joel Brobecker
2011-01-24 19:39 ` Pedro Alves
2011-01-24 19:46 ` Pedro Alves
2011-01-24 21:06 ` Joel Brobecker
2011-01-24 19:47 ` Pedro Alves [this message]
2011-01-28 11:35 ` 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=201101241946.24681.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