From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8357 invoked by alias); 23 Mar 2015 20:27:46 -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 8345 invoked by uid 89); 23 Mar 2015 20:27:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 23 Mar 2015 20:27:44 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id C6FA28E7B8 for ; Mon, 23 Mar 2015 20:27:43 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2NKRgrF003045; Mon, 23 Mar 2015 16:27:42 -0400 Message-ID: <5510773D.4010107@redhat.com> Date: Mon, 23 Mar 2015 20:27:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Sergio Durigan Junior CC: GDB Patches Subject: Re: [PATCH 2/2] Documentation and testcase References: <1426807358-18295-1-git-send-email-sergiodj@redhat.com> <1426807358-18295-3-git-send-email-sergiodj@redhat.com> <550C7905.9090501@redhat.com> <87mw37wfd6.fsf@redhat.com> <550C9A7C.90705@redhat.com> <87wq283gmx.fsf@redhat.com> In-Reply-To: <87wq283gmx.fsf@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-03/txt/msg00752.txt.bz2 On 03/22/2015 08:45 PM, Sergio Durigan Junior wrote: > +# We do not do file-backed mappings in the test program, but it is > +# important to test this anyway. One way of performing the test is to > +# load GDB with a corefile but without a binary, and then ask for the > +# disassemble of a function (i.e., the binary's .text section). GDB > +# should fail in this case. However, it must succeed if the binary is > +# provided along with the corefile. This is what we test here. It seems like we now just miss the case of corefilter that _does_ request that the file backed regions are dumped. In that case, disassembly should work without the binary. Could you add that too, please? We can e.g., pass a boolean parameter to test_disasm to specify whether to expect that disassembly works without a program file. > + > +proc test_disasm { core address } { > + global testfile > + > + # Restarting GDB without loading the binary > + gdb_exit > + gdb_start > + > + set core_loaded [gdb_core_cmd "$core" "load core"] > + if { $core_loaded == -1 } { > + fail "loading $core" > + return > + } > + > + gdb_test "disassemble $address" "No function contains specified address." \ > + "disassemble function with corefile and without a binary" > + > + clean_restart $testfile > + > + set core_loaded [gdb_core_cmd "$core" "load core"] > + if { $core_loaded == -1 } { > + fail "loading $core" > + return > + } > + > + gdb_test "disassemble $address" "Dump of assembler code for function.*" \ > + "disassemble function with corefile and with a binary" Looks like there are duplicate test messages here, in the cases clean_restart, gdb_core_cmd, etc. fail. You can fix that with e.g.: with_test_prefix "no binary" { # Restart GDB without loading the binary. gdb_exit gdb_start set core_loaded [gdb_core_cmd "$core" "load core"] if { $core_loaded == -1 } { fail "load $core" return } gdb_test "disassemble $address" "No function contains specified address." \ "disassemble function" } with_test_prefix "with binary" { clean_restart $testfile set core_loaded [gdb_core_cmd "$core" "load core"] if { $core_loaded == -1 } { fail "load $core" return } gdb_test "disassemble $address" "No function contains specified address." \ "disassemble function" } > +# Getting the inferior's PID "Get". Period at end. > +set infpid "" > +gdb_test_multiple "info inferiors" "getting inferior pid" { > + -re "process \($decimal\).*\r\n$gdb_prompt $" { > + set infpid $expect_out(1,string) > + } > +} > + > +# Get the main function's address Period. (I saw a few other similar gerund uses in the file which read a bit odd to me, but I didn't point them all out.) This is OK with the missing test added. Thanks for the patience and for working on this. Thanks, Pedro Alves