From patchwork Sun Dec 8 18:29:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 36635 Received: (qmail 35418 invoked by alias); 8 Dec 2019 18:51:46 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 35409 invoked by uid 89); 8 Dec 2019 18:51:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1533 X-HELO: gateway30.websitewelcome.com Received: from gateway30.websitewelcome.com (HELO gateway30.websitewelcome.com) (192.185.151.58) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 08 Dec 2019 18:51:44 +0000 Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway30.websitewelcome.com (Postfix) with ESMTP id 3264434E3 for ; Sun, 8 Dec 2019 12:30:13 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id e1JtiMgluHunhe1Jtiex6j; Sun, 08 Dec 2019 12:30:13 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=nMoy0TvHm0VZA/Fs+Mywe0Gns3guYfSOgNdIeup5irQ=; b=F0pUeaUChg8ji/yj6tEtPYGbi7 lUej5QdbHSzFzr2xBFrwzmL8Mcqgq7MHuwDTBVM+ppk6WJMqjFNI546QnGMgVRoaiYkmemu5tB+fY 3QnGpkXh4ZXwXspGa/lrRHdnH; Received: from 75-166-123-50.hlrn.qwest.net ([75.166.123.50]:53632 helo=bapiya.Home) by box5379.bluehost.com with esmtpa (Exim 4.92) (envelope-from ) id 1ie1Jt-0045O4-0L; Sun, 08 Dec 2019 11:30:13 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 53/55] Change print_field_values to use value-based API Date: Sun, 8 Dec 2019 11:29:56 -0700 Message-Id: <20191208182958.10181-54-tom@tromey.com> In-Reply-To: <20191208182958.10181-1-tom@tromey.com> References: <20191208182958.10181-1-tom@tromey.com> This converts print_field_values to use the value-based API, by having it call common_val_print rather than val_print. gdb/ChangeLog 2019-12-08 Tom Tromey * ada-valprint.c (print_field_values): Call common_val_print. Change-Id: I915def5ff4c304bafdf519356482da8cbc459fa6 --- gdb/ChangeLog | 4 ++++ gdb/ada-valprint.c | 14 +++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c index c83782a0760..6f69b633bd8 100644 --- a/gdb/ada-valprint.c +++ b/gdb/ada-valprint.c @@ -683,10 +683,7 @@ print_field_values (struct type *type, const gdb_byte *valaddr, bit_size, TYPE_FIELD_TYPE (type, i)); opts = *options; opts.deref_ref = 0; - val_print (TYPE_FIELD_TYPE (type, i), - value_embedded_offset (v), 0, - stream, recurse + 1, v, - &opts, language); + common_val_print (v, stream, recurse + 1, &opts, language); } } else @@ -694,9 +691,12 @@ print_field_values (struct type *type, const gdb_byte *valaddr, struct value_print_options opts = *options; opts.deref_ref = 0; - val_print (TYPE_FIELD_TYPE (type, i), - (offset + TYPE_FIELD_BITPOS (type, i) / HOST_CHAR_BIT), - 0, stream, recurse + 1, val, &opts, language); + + LONGEST local_off = (offset + TYPE_FIELD_BITPOS (type, i) + / HOST_CHAR_BIT); + struct value *v = value_from_contents (TYPE_FIELD_TYPE (type, i), + valaddr + local_off); + common_val_print (v, stream, recurse + 1, &opts, language); } annotate_field_end (); }