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 A38773858D1E for ; Sun, 6 Feb 2022 13:39:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A38773858D1E Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-622-9mL5Y05gPPuLt6h_mX6A0w-1; Sun, 06 Feb 2022 08:39:49 -0500 X-MC-Unique: 9mL5Y05gPPuLt6h_mX6A0w-1 Received: by mail-ed1-f72.google.com with SMTP id l19-20020a056402231300b0040f2d6b4ec4so2140890eda.0 for ; Sun, 06 Feb 2022 05:39:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=lohlPLKn99XXaOWEf7QKO/XxdypEuL770mTVjCsMeBM=; b=hxt101mn/fNcuQ5tc4KMgLJGJ3HuDXx4LNOBAHZtPbMB+VcpirkBcEnyRym2I9tDGy zfOMhp9LyL/oN0kh6vuHYXMJHTpiN9RbfBLsOVxWooW8g44xolnEo+PYPQ7gKmfLeksE ccLb1rEXfwU9dY0Dl3t354zjhF7XvaKdmavoxBUruNoQ6T33whp/8+hyfB9bEw33JwEf pz4BvRm1y8wY2ym38nQsmxsqRC/AWO7MdVN8w1igk86110RrI4Xt7hQc4Md/vojhaDrW q4gDJoFjRBA1m2TIizguxzzyopalsqmHJTNoymj4xQibb34MXd7vTj2Ufv3mxQEf0Y7n zDFA== X-Gm-Message-State: AOAM533LHqFWPm7vvyXnSD3Rec4G2PJwXJSNClaz7bMP0C5KERskHvte obIG7QNOsll/M2yXpN+ypC4Nfhw4MjBmi9hy7dBB9epqNt+mQO5q+GbSVur/3Ea+KTiwksObTif /XfdLyKECy5C5hJuMCAB2hg== X-Received: by 2002:a17:906:35cd:: with SMTP id p13mr519356ejb.666.1644154788579; Sun, 06 Feb 2022 05:39:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJxStPGo3IHr6fmDgew3AlKgcFn2RvtExZFRoIBcCjj6O73ddYQKmC92zvvGE7E0ERumU6f4dw== X-Received: by 2002:a17:906:35cd:: with SMTP id p13mr519349ejb.666.1644154788409; Sun, 06 Feb 2022 05:39:48 -0800 (PST) Received: from localhost (92.40.178.36.threembb.co.uk. [92.40.178.36]) by smtp.gmail.com with ESMTPSA id j12sm234613ejc.83.2022.02.06.05.39.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Feb 2022 05:39:47 -0800 (PST) Date: Sun, 6 Feb 2022 13:39:46 +0000 From: Andrew Burgess To: "Potharla, Rupesh" Cc: "Achra, Nitika" , "Kaushik, Sharang" , "Natarajan, Kavitha" , "George, Jini Susan" , "Kumar N, Bhuvanendra" , "E, Nagajyothi" , "Parasuraman, Hariharan" , "Sharma, Alok Kumar" , "Balasubrmanian, Vignesh" , "gdb-patches@sourceware.org" Subject: Re: [PATCH] Support for Fortran's ASSUMED RANK Message-ID: <20220206133946.GB2706@redhat.com> References: <20220121190711.GM622389@redhat.com> MIME-Version: 1.0 In-Reply-To: X-Operating-System: Linux/5.8.18-100.fc31.x86_64 (x86_64) X-Uptime: 13:06:17 up 1 day, 2:03, X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, 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: Sun, 06 Feb 2022 13:39:55 -0000 * Potharla, Rupesh via Gdb-patches [2022-01-28 07:49:54 +0000]: > [AMD Official Use Only] > > Hi Andrew, > > Request to review the attached patch file and please find comments inline below ... > > > Regards, > Rupesh P > > > -----Original Message----- > > From: Andrew Burgess > > Sent: Saturday, January 22, 2022 12:37 AM > > > Compiler Version: > > > gcc (GCC) 12.0.0 20211122 (experimental) > > > > I guess this must be something that was fixed recently, I tried with the 9.3 > > compiler I have locally and the tests failed. I also tried with some random > > build from git from early last year, and that also failed. > > > > Ideally the tests wont just fail when using older tools, but instead the test will > > detect that my compiler isn't good enough and just skip the tests, so you > > might need to try with some older compilers. > > > > The complete support for assumed rank is recently added in gcc. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103315 . Made changes in the testcase for skipping the testcase run for older compilers. > > > > > > From 383c561a1e926b7b65a1d8ffb5d70a047a4d4559 Mon Sep 17 00:00:00 > > 2001 > > > From: rupesh > > > Date: Fri, 29 Oct 2021 11:32:58 +0530 > > > Subject: [PATCH] Support for Fortran's ASSUMED RANK. > > > > > > gdb/ChangeLog: > > > > > > * dwarf2/loc.c: (dwarf2_locexpr_baton_eval): Push array dimension > > onto the stack. > > > * dwarf2/loc.h: Added an additional parameter to the function > > dwarf2_evaluate_property. > > > * dwarf2/read.c: (scan_partial_symbols): Process > > DW_TAG_generic_subrange. > > > * (add_partial_symbol): Process DW_TAG_generic_subrange. > > > * (process_die): Process DW_TAG_generic_subrange. > > > * (is_type_tag_for_partial) : Check for DW_TAG_generic_subrange type. > > > * (load_partial_dies): Load DW_TAG_generic_subrange. > > > * (new_symbol): Create entry for DW_TAG_generic_subrange type. > > > * (read_type_die_1): Read DW_TAG_generic_subrange type. > > > * (set_die_type) : Add dynamic property type for DW_AT_rank. > > > * f-typeprint.c: (f_type_print_varspec_suffix): Removed > > TYPE_DATA_LOCATION. > > > * findvar.c: (follow_static_link): Passing new argument to the function > > call dwarf2_evaluate_property. > > > * gdbtypes.c: (resolve_dynamic_range): Passing new argument to the > > function call dwarf2_evaluate_property. > > > * (resolve_dynamic_array_or_string): Handle rank dynamic property by > > creating and removing types. > > > * gdbtypes.h: (DYN_PROP_RANK, TYPE_DYN_PROP, TYPE_RANK_PROP): > > New Macros > > > * gnu-v3-abi.c: Passing new argument to the function call > > dwarf2_evaluate_property. > > > * testsuite/gdb.fortran/assumedrank.exp: New Testcase > > > * testsuite/gdb.fortran/assumedrank.f90: New Testcase > > > > ChangeLog entries are no longer needed for GDB, though you are welcome > > to have content like this in the commit message if you like. That said, the > > preference in GDB is to have the commit described within the main body of > > the commit message - a ChangeLog formatted block should be in addition. > > > > You should still keep the lines under ~76ish characters though. > > Added commit message describing the main body of the commit message. And also kept lines under ~76ish. > > > > diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c index > > > 182f15e7077..60f831c2cff 100644 > > > --- a/gdb/dwarf2/loc.c > > > +++ b/gdb/dwarf2/loc.c > > > @@ -1547,7 +1547,8 @@ dwarf2_locexpr_baton_eval (const struct > > dwarf2_locexpr_baton *dlbaton, > > > const struct property_addr_info *addr_stack, > > > CORE_ADDR *valp, > > > bool push_initial_value, > > > - bool *is_reference) > > > + bool *is_reference, > > > + int rank) > > > { > > > if (dlbaton == NULL || dlbaton->size == 0) > > > return 0; > > > @@ -1559,6 +1560,10 @@ dwarf2_locexpr_baton_eval (const struct > > dwarf2_locexpr_baton *dlbaton, > > > value *result; > > > scoped_value_mark free_values; > > > > > > + /* push rank value to the stack */ > > > + if (rank) > > > + ctx.push_address((rank - 1), false); > > > + > > > > I wonder, did you consider making use of the push_initial_value mechanism? > > > I considered accommodating changes using push_initial_value > mechanism. The push_initial_value is pushing address to the stack > the requirement is to push scalar value onto the stack. So I could > not make use of this mechanism. I still think we should investigate a solution that makes use of the existing push initial value mechanism, even if we end up needing to improve that first. It feels (to me) that just adding more random arguments for things we want to push is going to make for a clunky API. Just my thoughts, maybe other maintainers will disagree. I'll take a look at this and see if I can come up with something, but, I don't know how much time I'll have to work on this over the next week. Thanks, Andrew