From patchwork Thu Aug 27 04:57:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Machado X-Patchwork-Id: 8473 Received: (qmail 59887 invoked by alias); 27 Aug 2015 04:57:10 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 59869 invoked by uid 89); 27 Aug 2015 04:57:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 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; Thu, 27 Aug 2015 04:57:07 +0000 Received: from svr-orw-fem-06.mgc.mentorg.com ([147.34.97.120]) by relay1.mentorg.com with esmtp id 1ZUpFH-0000RG-US from Luis_Gustavo@mentor.com ; Wed, 26 Aug 2015 21:57:03 -0700 Received: from [172.30.12.37] (147.34.91.1) by SVR-ORW-FEM-06.mgc.mentorg.com (147.34.97.120) with Microsoft SMTP Server id 14.3.224.2; Wed, 26 Aug 2015 21:57:03 -0700 Message-ID: <55DE989C.7030402@codesourcery.com> Date: Thu, 27 Aug 2015 01:57:00 -0300 From: Luis Machado Reply-To: Luis Machado User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: Pedro Alves , Subject: Re: [PATCH] Guard compile tests from running when unsupported + harden feature support check References: <1439988825-19754-1-git-send-email-lgustavo@codesourcery.com> <55D48179.2030000@redhat.com> <55D485D1.8040802@codesourcery.com> <55D48891.7050808@redhat.com> In-Reply-To: <55D48891.7050808@redhat.com> X-IsSubscribed: yes On 08/19/2015 10:45 AM, Pedro Alves wrote: > On 08/19/2015 02:34 PM, Luis Machado wrote: > > This binary has no debug info (by test design), so we should just > make the test do "set language c" (with a comment). > Here's what i pushed for this one. I see no further gdb.compile failures. commit 8ce74153537add5e364865518a72194ab58b3dbc Author: Luis Machado Date: Thu Aug 27 01:49:05 2015 -0300 Force language to C in gdb.compile/compile-ifunc.exp Due to the lack of debug information in the binary, GDB is unable to figure out what language is being used. This may be a problem when doing remote debugging and the binary stops at the entry point containing asm code. In this case GDB will switch to asm as current language and will not switch back to C when it reaches main, which in turn causes the compile feature check to malfunction. This is solved by forcing the language to C after reaching main. gdb/testsuite/ChangeLog: 2015-08-26 Luis Machado * gdb.compile/compile-ifunc.exp (with_test_prefix): Force language to C. diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 5bba9d7..7b271e2 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-08-26 Luis Machado + + * gdb.compile/compile-ifunc.exp (with_test_prefix): Force language + to C. + 2015-08-26 Patrick Palka * gdb.base/run-after-attach.exp: New test file. diff --git a/gdb/testsuite/gdb.compile/compile-ifunc.exp b/gdb/testsuite/gdb.compile/compile-ifunc.exp index 026c62f..3a96552 100644 --- a/gdb/testsuite/gdb.compile/compile-ifunc.exp +++ b/gdb/testsuite/gdb.compile/compile-ifunc.exp @@ -25,6 +25,12 @@ with_test_prefix "nodebug" { return -1 } + # 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" "" + if {[skip_compile_feature_tests]} { untested "compile command not supported (could not find libcc1 shared library?)" return -1