From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 76205 invoked by alias); 6 Feb 2017 18:04:19 -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 76088 invoked by uid 89); 6 Feb 2017 18:04:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=sane, H*i:sk:693288e, H*MI:sk:693288e, H*f:sk:693288e X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 06 Feb 2017 18:04:17 +0000 Received: from svr-orw-mbx-03.mgc.mentorg.com ([147.34.90.203]) by relay1.mentorg.com with esmtp id 1caneB-0003GA-My from Luis_Gustavo@mentor.com ; Mon, 06 Feb 2017 10:04:15 -0800 Received: from [172.30.11.152] (147.34.91.1) by svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Mon, 6 Feb 2017 10:04:12 -0800 Reply-To: Luis Machado Subject: Re: [PATCH,v2] Make language setting tests more robust References: <1485962220-31071-1-git-send-email-lgustavo@codesourcery.com> <1485980466-711-1-git-send-email-lgustavo@codesourcery.com> <4423d3ac-814c-2d71-e5fd-ed27368f02e1@redhat.com> <22cf411e-ba69-723d-8289-71b636313c39@codesourcery.com> <693288e6-921d-7ff2-e81f-4aa8ccdd75a3@redhat.com> To: Pedro Alves , CC: From: Luis Machado Message-ID: <932c60a6-c132-2a93-22f2-c909edc18bc0@codesourcery.com> Date: Mon, 06 Feb 2017 18:04:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <693288e6-921d-7ff2-e81f-4aa8ccdd75a3@redhat.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: svr-orw-mbx-04.mgc.mentorg.com (147.34.90.204) To svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) X-IsSubscribed: yes X-SW-Source: 2017-02/txt/msg00130.txt.bz2 On 02/06/2017 10:50 AM, Pedro Alves wrote: > On 02/06/2017 02:54 PM, Luis Machado wrote: >> >> The story here is that i noticed 3 tests with such a problem: >> >> FAIL: gdb.compile/compile-ifunc.exp: nodebug: set language c >> FAIL: gdb.dwarf2/data-loc.exp: set language ada >> FAIL: gdb.dwarf2/dynarr-ptr.exp: set language ada >> >> And my build had a glibc with debugging symbols and sources, therefore >> GDB had set the initial language to asm before main. > > There's a comment about that in gdb.compile/compile-ifunc.exp: > > # This binary has no debug information, so force the language to C in case > # GDB happened to see real asm code when it stopped at the entry point > # when talking to a remote target, like gdbserver. This guarantees the > # feature check below will work. > gdb_test_no_output "set language c" "" > > So the question is, why did the gdb_test_no_output work back then, > and doesn't now? > I can't confirm it worked before since i haven't looked at this particular setup then. > In top.c:check_frame_language_change() > [...] > if (has_stack_frames ()) > { > enum language flang; > > flang = get_frame_language (frame); > if (!warned > && flang != language_unknown > && flang != current_language->la_language) > { > printf_filtered ("%s\n", lang_frame_mismatch_warn); > warned = 1; > } > > what does get_frame_language return? Isn't it returning > language_unknown for you? Why not? > That returns language_asm for me. Supposedly because gdb has seen asm from glibc and then sticked with it when it reached the test program's main. And the program has no debug info. >> FAIL: gdb.dwarf2/data-loc.exp: set language ada >> FAIL: gdb.dwarf2/dynarr-ptr.exp: set language ada Same as above, language_asm. Maybe gdb should've switched to language_unknown when it reached main for this/these particular cases? The logic to complain about a mismatch of language between the frame and the user selection seems sane.