From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id R4RsF8gWV2IJFAAAWB0awg (envelope-from ) for ; Wed, 13 Apr 2022 14:30:32 -0400 Received: by simark.ca (Postfix, from userid 112) id 4EEB81F327; Wed, 13 Apr 2022 14:30:32 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id D66DB1ED17 for ; Wed, 13 Apr 2022 14:30:31 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4A6743857344 for ; Wed, 13 Apr 2022 18:30:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4A6743857344 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1649874631; bh=cu1qH5BBYiZjuk5+M1rC+0peN9crl/TuQWKsEzi1DOo=; h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=AGofb7AUbiTK7IaxajDVbEL+q0D9Gt6Qi0i5z4UEum4PTKyiQz58yQOOqytnQQT72 jeTC/B6CfU3y9Aj6814aFHKBZN7gNX61Wm+EI2/Afy43bo38+9H9qRR0ejLaVNePh0 8WcmPsHXNtKZI6lYzbxoo4BI9SCPOdKloQXVPU08= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 020DC385801B for ; Wed, 13 Apr 2022 18:28:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 020DC385801B Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-114-e_2mnkCuOG2kNI0eP9O9-w-1; Wed, 13 Apr 2022 14:27:56 -0400 X-MC-Unique: e_2mnkCuOG2kNI0eP9O9-w-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 070EF811E7A; Wed, 13 Apr 2022 18:27:56 +0000 (UTC) Received: from f35-zws-1 (unknown [10.2.16.249]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7666F145BEE0; Wed, 13 Apr 2022 18:27:55 +0000 (UTC) Date: Wed, 13 Apr 2022 11:27:53 -0700 To: "Potharla, Rupesh via Gdb-patches" Subject: Re: GDB/Fortran: Support for Assumed Rank Zero. Message-ID: <20220413112753.4c6f1128@f35-zws-1> In-Reply-To: References: Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Kevin Buettner via Gdb-patches Reply-To: Kevin Buettner Cc: "George, Jini Susan" , "Parasuraman, Hariharan" , "Sharma, Alok Kumar" , "Potharla, Rupesh" Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi Rupesh, Thanks for working on this problem. I found a couple of nits; see below. On Wed, 13 Apr 2022 09:55:01 +0000 "Potharla, Rupesh via Gdb-patches" wrote: > diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c > index 49ecb199b07..c2d142ac3cc 100644 > --- a/gdb/gdbtypes.c > +++ b/gdb/gdbtypes.c > @@ -2398,10 +2398,12 @@ resolve_dynamic_array_or_string (struct type *type, > > if (rank == 0) > { > - /* The dynamic property list juggling below was from the original > - patch. I don't understand what this is all about, so I've > - commented it out for now and added the following error. */ > - error (_("failed to resolve dynamic array rank")); > + /* Rank is zero, if a variable is passed as an argument to a > + function. GDB considers the variable as an array so discard > + the array type and return the target type which is of variable. */ > + TYPE_DYN_PROP(TYPE_TARGET_TYPE(type)) = TYPE_DYN_PROP(type); > + type = TYPE_TARGET_TYPE(type); > + return type; > } > else if (type->code () == TYPE_CODE_STRING && rank != 1) > { > GDB's coding standard requires that things like TYPE_TARGET_TYPE(type) be written with a space before the left paren, i.e. TYPE_TARGET_TYPE (type). See: https://sourceware.org/gdb/wiki/Internals%20GDB-C-Coding-Standards Also, regarding TYPE_DYN_PROP, it appears to me that this macro is no longer being used. I've noticed that other code in gdbtypes.c is referencing the dyn_prop_list field directly. Kevin