From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 91471 invoked by alias); 13 Oct 2016 13:41:22 -0000 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 Received: (qmail 91459 invoked by uid 89); 13 Oct 2016 13:41:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=typeof, vla, 4856, 485,6 X-HELO: mail-pa0-f65.google.com Received: from mail-pa0-f65.google.com (HELO mail-pa0-f65.google.com) (209.85.220.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 13 Oct 2016 13:41:11 +0000 Received: by mail-pa0-f65.google.com with SMTP id os4so755383pac.3 for ; Thu, 13 Oct 2016 06:41:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=LrGeaL9ioMdTS361mSxgebfTrhkMKQD9Df9ROuoVEqg=; b=LP5onxJQDSJbw6F5W71BRlbWD5VK9ZTsfVzCYNNPzO72LKFugSdVZ8rjMtAWXZlHPs nhXi3s6X/8EUMLtOczsXGVE6KfAce5fPrhvzz/7VzwJp7FeFg0JPOnT70LHAUhX6gMM3 MW6yk7Wfv57ZmIYD1vDkHccKliReruj/r17sGVzkIWNrMMGByqnWxe2o0AxBj85BuSPk A4k9ZA8FYwio0jr+28B/sDiRjPTdIVFB/B7pbBwvFwUDPX9G88/Wvnx7yExG8Ft0N/3O 90eEut2d0kejOzuGBLJJj39VkoaTGoVjiqVvmdqkoAqZYpT908mIJx1NNr1STB2HGRUV qDpQ== X-Gm-Message-State: AA6/9RmXCA2ebps1HNXSofdIhpYGZEu9IUkmzn5T4AZN9KnZW0MXVYKZskzMan18/AnTIg== X-Received: by 10.67.16.46 with SMTP id ft14mr8613773pad.173.1476366069781; Thu, 13 Oct 2016 06:41:09 -0700 (PDT) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id zh13sm20020739pab.4.2016.10.13.06.41.07 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 13 Oct 2016 06:41:09 -0700 (PDT) From: Yao Qi To: Bernhard Heckel Cc: Yao Qi , brobecker@adacore.com, gdb-patches@sourceware.org Subject: Re: [PATCH V4 3/6] Typeprint: Resolve any dynamic target type of a pointer. References: <1473230295-809-1-git-send-email-bernhard.heckel@intel.com> <1473230295-809-4-git-send-email-bernhard.heckel@intel.com> <861szvayzg.fsf@gmail.com> <57F4DE0E.2030505@intel.com> Date: Thu, 13 Oct 2016 13:41:00 -0000 In-Reply-To: <57F4DE0E.2030505@intel.com> (Bernhard Heckel's message of "Wed, 5 Oct 2016 13:03:42 +0200") Message-ID: <86shs08iz3.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-10/txt/msg00357.txt.bz2 Bernhard Heckel writes: >>> +extern "C" { >>> +#include >>> +} >>> + >> Why do you include stddef.h? > definition of NULL > + typeof (vla) *ptr =3D NULL; > It is c++, so we can include for NULL. >>> diff --git a/gdb/typeprint.c b/gdb/typeprint.c >>> index e77513e..e3d84c7 100644 >>> --- a/gdb/typeprint.c >>> +++ b/gdb/typeprint.c >>> @@ -485,6 +485,25 @@ whatis_exp (char *exp, int show) >>> printf_filtered (" */\n"); >>> } >>> + /* Resolve any dynamic target type, as we might print >>> + additional information about the target. >>> + For example, in Fortran and C we are printing the dimension of the >>> + dynamic array the pointer is pointing to. */ >>> + if (TYPE_CODE (type) =3D=3D TYPE_CODE_PTR >>> + && is_dynamic_type (type) =3D=3D 1) >> is_dynamic_type returns bool-like value, so don't check it with 1. >> Looks we need to check is_dynamic_type (TYPE_TARGET_TYPE (type)), no? > is_dynamic_type takes care of target types for pointer and reference type= s. > So, we can keep it. OK, no problem. --=20 Yao (=E9=BD=90=E5=B0=A7)