From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 33272 invoked by alias); 7 Sep 2018 22:23:30 -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 33258 invoked by uid 89); 7 Sep 2018 22:23:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-6.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_1,KAM_STOCKGEN,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=xy, bracing, Logical, Hx-languages-length:2562 X-HELO: gateway20.websitewelcome.com Received: from gateway20.websitewelcome.com (HELO gateway20.websitewelcome.com) (192.185.49.40) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 07 Sep 2018 22:23:27 +0000 Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 3EF43400C5255 for ; Fri, 7 Sep 2018 17:23:26 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id yP9yf7VTJkBj6yP9yfJWll; Fri, 07 Sep 2018 17:23:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=npkSNT7jAxV2L1LN3231+BSjLHTQckgDcZKfuu+gGjM=; b=jtsg6f+Zi11eJmV6ObLmISM37f wlVTqNSE2cr/CIcmLg2SGAb5ssoQwmR4UCuV3zxRgBgBJAfF0nf8kpvIzh1p6HLwSMDGumGLmEDKG qwrEyE3MOMUIgAxxsC24Nv4Z8; Received: from 75-166-85-72.hlrn.qwest.net ([75.166.85.72]:51536 helo=pokyo) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1fyP9y-001wjr-0e; Fri, 07 Sep 2018 17:23:26 -0500 From: Tom Tromey To: Richard Bunt Cc: gdb-patches@sourceware.org, nd@arm.com Subject: Re: [PATCH v2] Logical short circuiting with argument lists References: <79494820-f795-ad3c-8546-0ad288cd05b0@arm.com> Date: Fri, 07 Sep 2018 22:23:00 -0000 In-Reply-To: <79494820-f795-ad3c-8546-0ad288cd05b0@arm.com> (Richard Bunt's message of "Thu, 16 Aug 2018 17:02:48 +0100") Message-ID: <87mustueua.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2018-09/txt/msg00137.txt.bz2 >>>>> "Richard" == Richard Bunt writes: Thank you for the patch. Richard> koenig.exp was updated to include a testcase which exercises the Richard> modified skip logic in OP_VAR_VALUE, as it falls through from Richard> OP_ADL_FUNC. Nice, thanks. Richard> +void Richard> +skip_undetermined_arglist (int nargs, struct expression *exp, int *pos, Richard> + enum noside noside) This needs an introductory comment. Richard> @@ -1283,15 +1294,20 @@ evaluate_subexp_standard (struct type *expect_type, Richard> case OP_ADL_FUNC: Richard> case OP_VAR_VALUE: Richard> (*pos) += 3; Richard> - if (noside == EVAL_SKIP) Richard> - return eval_skip_value (exp); Richard> - Richard> { Richard> symbol *var = exp->elts[pc + 2].symbol; Richard> if (TYPE_CODE (SYMBOL_TYPE (var)) == TYPE_CODE_ERROR) Richard> error_unknown_type (SYMBOL_PRINT_NAME (var)); With this change I think it would read more nicely if you sunk the "(*pos) += 3;" into the block. I wonder if we really want this to error in the case where the symbol isn't found. But I suppose it is necessary for your patch to work. I tend to think it is fine; I couldn't think of a plausible, non-pathological way that I would want to use the non-erroring behavior. Though, another option is to do this in a fortran-specific way. Richard> +if ![runto [gdb_get_line_number "post_truth_table_init"] ] then { I usually brace the conditions and cuddle the brackets, so if {!runto [gdb...]]} then { The bracing is super Tcl nerdery. Richard> +# Vary conditional and input over the standard truth table. Richard> +# Test that the debugger can evaluate expressions of the form Richard> +# a(x,y) .OR./.AND. a(a,b) correctly. Richard> +foreach_with_prefix truth_table_index {1 2 3 4} { Richard> + gdb_test "p truth_table($truth_table_index, 1) \ Richard> + .OR. truth_table($truth_table_index, 2)" \ I think it's better to just have a longer line here than to split a string in the middle. Richard> + set argument_list "$argument_list .TRUE.," You can write this as append argument_list " .TRUE.," Richard> + gdb_test "p .TRUE. .OR. binary_string($range1) .OR. truth_table($range2, 1)" \ For some of the tests -- I'm afraid I didn't enumerate them -- you will need to supply a different (and unique) test name to gdb_test, because there is a rule against tests having parenthesized text at the end of their name: https://sourceware.org/gdb/wiki/GDBTestcaseCookbook#Do_not_use_.22tail_parentheses.22_on_test_messages Tom