From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19564 invoked by alias); 24 Jan 2011 19:46:33 -0000 Received: (qmail 19545 invoked by uid 22791); 24 Jan 2011 19:46:32 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,TW_XA,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 24 Jan 2011 19:46:28 +0000 Received: (qmail 16409 invoked from network); 24 Jan 2011 19:46:26 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 24 Jan 2011 19:46:26 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [RFA v2] valprint.c / *-valprint.c: Don't lose `embedded_offset' Date: Mon, 24 Jan 2011 19:47:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-24-generic; KDE/4.5.1; x86_64; ; ) Cc: Joel Brobecker References: <201101241322.42902.pedro@codesourcery.com> In-Reply-To: <201101241322.42902.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201101241946.24681.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-01/txt/msg00465.txt.bz2 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 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 }} while we should print: (gdb) p/x some_struct $2 = {a = 0x12345678, b = 0x87654321, array = {0xaa }} Sorry for the spam. I'm done now. :-) -- Pedro Alves