From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9334 invoked by alias); 26 Dec 2018 04:56:51 -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 9322 invoked by uid 89); 26 Dec 2018 04:56:50 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,RCVD_IN_DNSWL_NONE,SPF_PASS,TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 spammy=google, menu, careful, Also X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 26 Dec 2018 04:56:40 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 22076117281; Tue, 25 Dec 2018 23:56:39 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id lwY1PWC1GsST; Tue, 25 Dec 2018 23:56:39 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 9A3B411727E; Tue, 25 Dec 2018 23:56:38 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id AE45186754; Wed, 26 Dec 2018 08:56:30 +0400 (+04) Date: Wed, 26 Dec 2018 04:56:00 -0000 From: Joel Brobecker To: Philippe Waroquiers Cc: gdb-patches@sourceware.org Subject: Re: [RFA] Fix some gdb.ada tests failures due to naming conflict. Message-ID: <20181226045630.GB21851@adacore.com> References: <20181224141509.11807-1-philippe.waroquiers@skynet.be> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181224141509.11807-1-philippe.waroquiers@skynet.be> User-Agent: Mutt/1.9.4 (2018-02-28) X-SW-Source: 2018-12/txt/msg00321.txt.bz2 > Fix these by using names that have more chances to be unique. Thanks for doing that, Philippe. I believe this is because you are using a version of the compiler where the entire runtime has debugging information, which is not AdaCore's normal mode. Would you mind terribly splitting this commit into a series of coomits, with one commit per tescase? If you are unsure how to do that with git, take a look at git reset (and prob. google as well ;-)). > > packed_array_assign.exp > ----------------------- > The test gdb.ada/packed_array_assign fails due to conflict between component 'w' > and system.dim.mks.w: > > (gdb) print pra := ((x => 2, y => 0, w => 17), pr, (x => 7, y => 1, w => 23)) > Unknown component name: system.dim.mks.w. > (gdb) FAIL: gdb.ada/packed_array_assign.exp: print pra := ((x => 2, y => 0, w => 17), pr, (x => 7, y => 1, w => 23)) > > Also, the test expected (wrongly as far as I can see) to have the > components printed in the order (w, x, y), while the code defines them > in the order (x, y, w), and the compiler (GNATMAKE 6.3.0, > gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516) respects this order: > for Packed_Rec use record > Packed_Array_Assign_X at 0 range 0 .. 2; > Packed_Array_Assign_Y at 0 range 3 .. 5; > Packed_Array_Assign_W at 0 range 6 .. 37; > end record; > > So, update to test the new (more unique) names in the source order. We have to te be careful about the component order. AdaCore implemented a change last year where components can be automatically re-ordered if it makes the code more efficient. One way we can handle this is by accepting both orders. However, looking at the record, and the purpuse of the testcase, I think we achieve the same goals by just reordering the fields in Packed_Rec. That way, the component order chosen by the compiler remains the same regardless of the compiler. > rename_subscript_param.exp > -------------------------- > The test rename_subscript_param.exp fails due to conflict between boolean 'b' > and some 'b' in atnat.h. > > (gdb) print b > Multiple matches for b > [0] cancel > [1] b at ../sysdeps/ieee754/dbl-64/atnat.h:106 > [2] b at ../sysdeps/ieee754/dbl-64/atnat.h:106 > [3] b at ../sysdeps/ieee754/dbl-64/atnat.h:106 > > FAIL: gdb.ada/rename_subscript_param.exp: print b before changing its value (timeout) > > Fix by renaming 'b' to 'rename_subscript_param_b. > Also, change 'before' to 'after' in the gdb_test message that prints > the value after changing it. > The test however still fails for me, probably because the Debian stable > Ada compiler is too old, and does not properly generate debug info for > this renaming: > (gdb) print rename_subscript_param_b > No definition of "rename_subscript_param_b" in current context. > (gdb) FAIL: gdb.ada/rename_subscript_param.exp: print rename_subscript_param_b before changing its value This renaming is unnecessary. What is probably happening as you guessed is that the compiler failed to generate the renaming. As a result, GDB failed to find "B" in the current scope. That's when it started searching in the static then global scope. The wider search does not happen if some symbols were found in the current scope, so the ambiguity you are seeing is only because of the inability to find "B". You can still rename "B" if you would like, but the only advantage I can see for doing that is that you get the second error message (no definition of...) instead of the multiple choice menu in situations like yours where the compiler failed to generate the necessary debug info. > 2018-12-24 Philippe Waroquiers > > * gdb.ada/assign_arr/target_wrapper.ads (Input): Rename to > Assign_Arr_Input. > main_p324_051.adb: Update accordingly. It is already written up, and it is fine as is, so no need to waste more time on more Changelog writing; but for the future, you can saveyourself a bit of time by saying... * gdb.ada/assign_arr/target_wrapper.ads (Input): Rename to Assign_Arr_Input. All users updated. ... and that's it! > gdb.ada/assign_arr.exp: Likewise. > * gdb.ada/fun_renaming/pack.ads (Next): Rename to Fun_Rename_Test_Next. > (Renamed_Next): Rename to Renamed_Fun_Rename_Test_Next. > gdb.ada/fun_renaming/pack.adb (Next): Rename to Fun_Rename_Test_Next. > gdb.ada/fun_renaming/fun_renaming.adb (N): Rename to Fun_Rename_Test_N. > gdb.ada/fun_renaming.exp: Update accordingly. > * gdb.ada/packed_array_assign/aggregates.ads (Packed_Rec): > Rename components to Packed_Array_Assign_[X|Y|W]. > gdb.ada/packed_array_assign.exp: Update accordingly. Use source > order for checking the component order. > * gdb.ada/rename_subscript_param/pkg.adb (B): Rename to > Rename_Subscript_Param_B. > * gdb.ada/rename_subscript_param.exp: Update accordingly. -- Joel