From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 372713855037 for ; Wed, 23 Jun 2021 12:37:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 372713855037 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 486B61FD65; Wed, 23 Jun 2021 12:37:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1624451828; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uj3xzB63ZmM8jwgd9oxhJunuNilUAFiDzAYb4+6OTbA=; b=voNbs8ddzywFEAvZszI5jQ5aBtga3esILQ2QWDR2l+whuYia2wIGVhjBhswkmCfA5h1qk0 /8ykKHXaipPAPO1CGpJkJ5KdZxdmdOkmmnH+tPMRCRc29kC50JSjVKl9P5FtbU2CCKfaCI 1dPLQUqh23NB5gRwwXNKraku0QZCV84= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1624451828; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uj3xzB63ZmM8jwgd9oxhJunuNilUAFiDzAYb4+6OTbA=; b=R7YhpiqjAj/fX8+8QMJZiAloJ/XmyOHKsdPPQum+1M0UHi792V6r3BQ8i0eBZ8fLwAeqBl oeO7ScEfZ0C8euBQ== Received: from imap3-int (imap-alt.suse-dmz.suse.de [192.168.254.47]) by imap.suse.de (Postfix) with ESMTP id 213C811A97; Wed, 23 Jun 2021 12:37:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1624451828; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uj3xzB63ZmM8jwgd9oxhJunuNilUAFiDzAYb4+6OTbA=; b=voNbs8ddzywFEAvZszI5jQ5aBtga3esILQ2QWDR2l+whuYia2wIGVhjBhswkmCfA5h1qk0 /8ykKHXaipPAPO1CGpJkJ5KdZxdmdOkmmnH+tPMRCRc29kC50JSjVKl9P5FtbU2CCKfaCI 1dPLQUqh23NB5gRwwXNKraku0QZCV84= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1624451828; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uj3xzB63ZmM8jwgd9oxhJunuNilUAFiDzAYb4+6OTbA=; b=R7YhpiqjAj/fX8+8QMJZiAloJ/XmyOHKsdPPQum+1M0UHi792V6r3BQ8i0eBZ8fLwAeqBl oeO7ScEfZ0C8euBQ== Received: from director2.suse.de ([192.168.254.72]) by imap3-int with ESMTPSA id 7jyRBvQq02B4IQAALh3uQQ (envelope-from ); Wed, 23 Jun 2021 12:37:08 +0000 Subject: Re: [RFC PATCH] gdb/testsuite: fix gdb.base/info-types*.exp when no libc debug info To: Andrew Burgess Cc: Simon Marchi , gdb-patches@sourceware.org References: <20210622172447.1862794-1-simon.marchi@efficios.com> <20210622215253.GJ2568@embecosm.com> <20210623122131.GL2568@embecosm.com> From: Tom de Vries Message-ID: <88f9bf22-6841-4580-351e-79e88ee97704@suse.de> Date: Wed, 23 Jun 2021 14:37:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <20210623122131.GL2568@embecosm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2021 12:37:11 -0000 On 6/23/21 2:21 PM, Andrew Burgess wrote: > * Tom de Vries [2021-06-23 14:04:54 +0200]: > >> On 6/22/21 11:52 PM, Andrew Burgess wrote: >>> * Simon Marchi via Gdb-patches [2021-06-22 13:24:47 -0400]: >>> >>>> On Ubuntu 20.04, when the debug info package for libc is not installed, >>>> I get: >>>> >>>> FAIL: gdb.base/info-types-c++.exp: info types >>>> FAIL: gdb.base/info-types-c.exp: info types >>>> >>>> The reason is that the output of info types is exactly: >>>> >>>> (gdb) info types >>>> All defined types: >>>> >>>> File /home/smarchi/src/binutils-gdb/gdb/testsuite/gdb.base/info-types.c: >>>> 52: typedef enum {...} anon_enum_t; >>>> 45: typedef struct {...} anon_struct_t; >>>> 68: typedef union {...} anon_union_t; >>>> 28: typedef struct baz_t baz; >>>> 31: typedef struct baz_t * baz_ptr; >>>> 21: struct baz_t; >>>> double >>>> 33: enum enum_t; >>>> float >>>> int >>>> 38: typedef enum enum_t my_enum_t; >>>> 17: typedef float my_float_t; >>>> 16: typedef int my_int_t; >>>> 54: typedef enum {...} nested_anon_enum_t; >>>> 47: typedef struct {...} nested_anon_struct_t; >>>> 70: typedef union {...} nested_anon_union_t; >>>> 30: typedef struct baz_t nested_baz; >>>> 29: typedef struct baz_t nested_baz_t; >>>> 39: typedef enum enum_t nested_enum_t; >>>> 19: typedef float nested_float_t; >>>> 18: typedef int nested_int_t; >>>> 62: typedef union union_t nested_union_t; >>>> 56: union union_t; >>>> unsigned int >>>> (gdb) >>>> >>>> The lines we expect in the test contain an empty line at the end: >>>> >>>> ... >>>> "18:\[\t \]+typedef int nested_int_t;" \ >>>> "62:\[\t \]+typedef union_t nested_union_t;" \ >>>> "--optional" "\[\t \]+unsigned int" \ >>>> ""] >>>> >>>> This is written with the supposition that other files will be listed, so >>>> an empty line will be included to separate the symbols from this file >>>> from the next one. This empty line is not included when info-types.c is >>>> the only file listed. >>>> >>>> This patch fixes the issue by not requiring an empty line. I don't >>>> think it's a very good solution, however: the empty line ensures that >>>> there is no additional unexpected items after "unsigned int". >>>> >>>> I don't think that making the empty line optional (with --optional) >>>> would achieve anything, since the lines would still match if there was >>>> some unexpected output. >>>> >>>> So, I'll think about it a bit more, but any suggestions are appreciated. >>> >>> What about the patch below? Instead of using the builtin >>> gdb_test_lines, I grab the type lines (but just for $srcfile) using >>> gdb_test_multiple, then manually check for each type in turn. >>> >>> We no longer care about the order of the types in the output, but I >>> think that is fine, the order was always pretty random anyway. >>> >> >> I'm curious, could you elaborate on this? In what situations did you >> see a different order? >> >> [ Not that I much mind not matching in order, it doesn't look terribly >> important to me. ] > > I didn't, see my follow up email. > Ah, I see. >> >> Anyway, I have a minor concern about this patch: that it is a local, >> specific solution. Ideally we specify some matching data that is >> specific to the test-case, and pass it to a lib/gdb.exp proc, which is >> generic enough to handle similar cases. > > I'm happy with your approach. Ack, thanks for the review. > I'd already posted my follow up before > your email arrived my end. Yeah, I was not CC-ed in your replies, so I didn't notice them in time, sorry. Perhaps you replied-to-list, or the mailing list tried to be clever about dropping CCs to people already on the list (which I find annoying, but apparently that's feature, not a bug). Thanks, - Tom