From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 768 invoked by alias); 20 Aug 2013 17:39:39 -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 743 invoked by uid 89); 20 Aug 2013 17:39:39 -0000 X-Spam-SWARE-Status: No, score=-7.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 20 Aug 2013 17:39:38 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r7KHda7j004330 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 20 Aug 2013 13:39:36 -0400 Received: from barimba (ovpn-113-142.phx2.redhat.com [10.3.113.142]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r7KHdXUJ026841 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 20 Aug 2013 13:39:34 -0400 From: Tom Tromey To: Yao Qi Cc: Subject: Re: [PATCH 1/2] Test case for entry values. References: <1376379586-24150-1-git-send-email-yao@codesourcery.com> <1376379586-24150-2-git-send-email-yao@codesourcery.com> Date: Tue, 20 Aug 2013 17:39:00 -0000 In-Reply-To: <1376379586-24150-2-git-send-email-yao@codesourcery.com> (Yao Qi's message of "Tue, 13 Aug 2013 15:39:45 +0800") Message-ID: <87wqnggt2i.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2013-08/txt/msg00552.txt.bz2 >>>>> "Yao" == Yao Qi writes: Yao> This is a test case for "entry-values" in an arch-independent way. The Yao> first part of entry-values.exp is to calculate the length of functions Yao> and the offset of instruction call in function bar. Then, this test Yao> uses Dwarf Assembler to emit some DIEs for "entry-values". Thanks Yao. This is cool. Yao> +# Start GDB and load object file, compute the function length and Yao> +# the offset of branch instruction in function. They are needed Yao> +# in the Dwarf Assembler below. Nice technique! I'll have to use that. Yao> +# Calculate the offset of the last instruction from the beginning. Yao> +set test "disassemble foo" Yao> +gdb_test_multiple $test $test { Yao> + -re ".*$hex <\\+($decimal)>:\[^\r\n\]+\r\nEnd of assembler dump\.\r\n$gdb_prompt $" { Yao> + set foo_length $expect_out(1,string) Yao> + pass $test Yao> + } Yao> + -re ".*$gdb_prompt $" { Yao> + fail $test Yao> + } Yao> +} If this test fails then later on foo_length won't be set. This will yield a Tcl error in the test suite. It's probably better to just bail out here. I think this applies elsewhere too. Yao> + cu {addr_size 4} { Will it still work on x86-64? Tom