From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10810 invoked by alias); 24 Jan 2011 16:56:37 -0000 Received: (qmail 10503 invoked by uid 22791); 24 Jan 2011 16:56:36 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 24 Jan 2011 16:56:27 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 6FB562BAC32; Mon, 24 Jan 2011 11:56:25 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id m2my4NA9xLhA; Mon, 24 Jan 2011 11:56:25 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 5B75D2BABFC; Mon, 24 Jan 2011 11:56:25 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id E08541459AD; Mon, 24 Jan 2011 11:56:24 -0500 (EST) Date: Mon, 24 Jan 2011 17:37:00 -0000 From: Joel Brobecker To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [RFA v2] valprint.c / *-valprint.c: Don't lose `embedded_offset' Message-ID: <20110124165624.GA2413@adacore.com> References: <201101241322.42902.pedro@codesourcery.com> <201101241324.04771.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="qDbXVdCdHGoSgWSk" Content-Disposition: inline In-Reply-To: <201101241324.04771.pedro@codesourcery.com> User-Agent: Mutt/1.5.20 (2009-06-14) 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/msg00460.txt.bz2 --qDbXVdCdHGoSgWSk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 561 > > Joel, there are Ada changes in the patch, are those okay? Hi Pedro. The changes look sane to me. There was only one place where the offset was missing, affecting packed records. Patch attached. I wish we could allow everyone to get a clean run in gdb.ada, it really sucks :-(. I tried to speed things up a bit on the compiler side with the descriptive-type stuff, but it's very very hard to get feedback from maintainers who have the power to approve or make suggestions... I need to check with Olivier, but he might have given up on it :-(. -- Joel --qDbXVdCdHGoSgWSk Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="val-offset.diff" Content-length: 793 diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c index 1255b00..2b5aa44 100644 --- a/gdb/ada-valprint.c +++ b/gdb/ada-valprint.c @@ -1132,11 +1132,11 @@ print_field_values (struct type *type, const gdb_byte *valaddr, struct value_print_options opts; adjust_type_signedness (TYPE_FIELD_TYPE (type, i)); - v = ada_value_primitive_packed_val (NULL, valaddr, - bit_pos / HOST_CHAR_BIT, - bit_pos % HOST_CHAR_BIT, - bit_size, - TYPE_FIELD_TYPE (type, i)); + v = ada_value_primitive_packed_val + (NULL, valaddr, + offset + bit_pos / HOST_CHAR_BIT, + bit_pos % HOST_CHAR_BIT, + bit_size, TYPE_FIELD_TYPE (type, i)); opts = *options; opts.deref_ref = 0; val_print (TYPE_FIELD_TYPE (type, i), --qDbXVdCdHGoSgWSk--