From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 From: Kevin Buettner To: "Potharla, Rupesh via Gdb-patches" Cc: "Potharla, Rupesh" , "George, Jini Susan" , "Parasuraman, Hariharan" , "Sharma, Alok Kumar" 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-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-List-Received-Date: Wed, 13 Apr 2022 18:28:02 -0000 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