From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from barracuda.ebox.ca (barracuda.ebox.ca [96.127.255.19]) by sourceware.org (Postfix) with ESMTPS id C305A3857416 for ; Tue, 22 Jun 2021 17:24:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C305A3857416 X-ASG-Debug-ID: 1624382688-0c856e67e2169f350001-fS2M51 Received: from smtp.ebox.ca (smtp.ebox.ca [96.127.255.82]) by barracuda.ebox.ca with ESMTP id n1f5z89KMaDezGDX (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 Jun 2021 13:24:48 -0400 (EDT) X-Barracuda-Envelope-From: simon.marchi@efficios.com X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from epycamd.internal.efficios.com (192-222-181-218.qc.cable.ebox.net [192.222.181.218]) by smtp.ebox.ca (Postfix) with ESMTP id E84F2441B21; Tue, 22 Jun 2021 13:24:47 -0400 (EDT) From: Simon Marchi X-Barracuda-RBL-IP: 192.222.181.218 X-Barracuda-Effective-Source-IP: 192-222-181-218.qc.cable.ebox.net[192.222.181.218] X-Barracuda-Apparent-Source-IP: 192.222.181.218 To: gdb-patches@sourceware.org Cc: Tom de Vries , Simon Marchi Subject: [RFC PATCH] gdb/testsuite: fix gdb.base/info-types*.exp when no libc debug info Date: Tue, 22 Jun 2021 13:24:47 -0400 X-ASG-Orig-Subj: [RFC PATCH] gdb/testsuite: fix gdb.base/info-types*.exp when no libc debug info Message-Id: <20210622172447.1862794-1-simon.marchi@efficios.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: smtp.ebox.ca[96.127.255.82] X-Barracuda-Start-Time: 1624382688 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at ebox.ca X-Barracuda-Scan-Msg-Size: 3468 X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.90826 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Spam-Status: No, score=-22.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_SOFTFAIL, 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: Tue, 22 Jun 2021 17:24:50 -0000 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. gdb/testsuite/ChangeLog: * gdb.base/info-types.exp.tcl (run_test): Remove empty line at end of expected regexps. Change-Id: I078127e271e2eb628b4805129bdb6f3f9c795629 --- gdb/testsuite/gdb.base/info-types.exp.tcl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gdb/testsuite/gdb.base/info-types.exp.tcl b/gdb/testsuite/gdb.base/info-types.exp.tcl index c820adc4ac1..a24899c243d 100644 --- a/gdb/testsuite/gdb.base/info-types.exp.tcl +++ b/gdb/testsuite/gdb.base/info-types.exp.tcl @@ -75,8 +75,7 @@ proc run_test { lang } { "19:\[\t \]+typedef float nested_float_t;" \ "18:\[\t \]+typedef int nested_int_t;" \ "62:\[\t \]+typedef union_t nested_union_t;" \ - "--optional" "\[\t \]+unsigned int" \ - ""] + "--optional" "\[\t \]+unsigned int"] } else { set output_lines \ [list \ @@ -106,8 +105,7 @@ proc run_test { lang } { "18:\[\t \]+typedef int nested_int_t;" \ "62:\[\t \]+typedef union union_t nested_union_t;" \ "56:\[\t \]+union union_t;" \ - "--optional" "\[\t \]+unsigned int" \ - ""] + "--optional" "\[\t \]+unsigned int"] } gdb_test_lines "info types" "" $output_lines -- 2.31.1