From patchwork Sun Mar 17 09:29:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 87281 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 218DA3858436 for ; Sun, 17 Mar 2024 09:29:35 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id 35C093858432 for ; Sun, 17 Mar 2024 09:28:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 35C093858432 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 35C093858432 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710667720; cv=none; b=FH/4cJBIVOLdQ0lW66cKSY1QzVx/GRatzWMe0yrRKyrsvV8mxKXNbTM4QZ85X78urznYfXl62INCCmn8nWnzAAZm/X8u5LDUb4tFvERrjlzH1inSUaJqnHYfIElOnUkBPkeQrXxJmUiSdT2C3sm4sST16QQwGIoDM2WXEGvgerw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710667720; c=relaxed/simple; bh=IwG56yFi58bSOZV8O1k2Q1GmmEknp2J7GWj8UqWR96M=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-Id:MIME-Version; b=pheBS1JUAdL5ftR1DGM4I0JL2OhEiqarnDg6WnwDRulAkuQQLXavN2EdGLREEqUoH6kEFuLRgD9tUEG3WuOX4SSwdc++8EzkeKSImEgBGbHW0DbvqkcCfV6Qfd+T3k6yGSFWhHpmv7L62QALkyC86WLkvOwy9QQVTWjroMlM68s= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 9FE8020930 for ; Sun, 17 Mar 2024 09:28:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1710667716; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=oLe4ajdzWkUkdEBjPmiMg04QOd+vhGnCcjAdHSl4si8=; b=AAzYtPFzLddjJPvAuNwnK6aqNbZ8IhZOUwBNljCHE61p7eOUeqKp0wkzLKrIwEPUKvFdld JU2zXdGJMnMkJ8QSmwUG1bZqfURqp61hjxV4I6z0NP9TgQInSGwq3KaqtvfinmTxMxzBmW 6o5+4kFHuG2qtrbsfGenr28uuqvxLck= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1710667716; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=oLe4ajdzWkUkdEBjPmiMg04QOd+vhGnCcjAdHSl4si8=; b=C0zjq6UjptgmPTfV+LmDeoUgYbkXfnXmnA1WOwZS+3acUs65wU95zQRvo6sl9nRiT9j3fE 067iQoGH7WIsAgAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1710667716; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=oLe4ajdzWkUkdEBjPmiMg04QOd+vhGnCcjAdHSl4si8=; b=AAzYtPFzLddjJPvAuNwnK6aqNbZ8IhZOUwBNljCHE61p7eOUeqKp0wkzLKrIwEPUKvFdld JU2zXdGJMnMkJ8QSmwUG1bZqfURqp61hjxV4I6z0NP9TgQInSGwq3KaqtvfinmTxMxzBmW 6o5+4kFHuG2qtrbsfGenr28uuqvxLck= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1710667716; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=oLe4ajdzWkUkdEBjPmiMg04QOd+vhGnCcjAdHSl4si8=; b=C0zjq6UjptgmPTfV+LmDeoUgYbkXfnXmnA1WOwZS+3acUs65wU95zQRvo6sl9nRiT9j3fE 067iQoGH7WIsAgAA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 86A2413690 for ; Sun, 17 Mar 2024 09:28:36 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id NJ38HsS39mXKVAAAD6G6ig (envelope-from ) for ; Sun, 17 Mar 2024 09:28:36 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [PATCH] [gdb/testsuite] Fix gdb.base/list-no-debug.exp on debian Date: Sun, 17 Mar 2024 10:29:37 +0100 Message-Id: <20240317092937.969-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-Spam-Score: 0.70 X-Spamd-Result: default: False [0.70 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; R_MISSING_CHARSET(2.50)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; BROKEN_CONTENT_TYPE(1.50)[]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MID_CONTAINS_FROM(1.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[gnu.org:url]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%] X-Spam-Level: Authentication-Results: smtp-out2.suse.de; none X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org From: linux On debian 12, aarch64-linux I run into: ... (gdb) list .^M No symbol table is loaded. Use the "file" command.^M (gdb) FAIL: gdb.base/list-nodebug.exp: first 'list .' ... The test-case expects some debug info, but none for main. Instead, there's no debug info at all. Fix this by adding another source file to the test-case, and compiling it with debug info. Tested on aarch64-linux. PR testsuite/31290 Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31290 --- gdb/testsuite/gdb.base/list-nodebug-2.c | 24 ++++++++++++++++++++++++ gdb/testsuite/gdb.base/list-nodebug.c | 7 +++++-- gdb/testsuite/gdb.base/list-nodebug.exp | 10 +++++++--- 3 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 gdb/testsuite/gdb.base/list-nodebug-2.c base-commit: 04d7f8a5bc3a2b4be65583b10ef100bc567faca1 diff --git a/gdb/testsuite/gdb.base/list-nodebug-2.c b/gdb/testsuite/gdb.base/list-nodebug-2.c new file mode 100644 index 00000000000..861e6149071 --- /dev/null +++ b/gdb/testsuite/gdb.base/list-nodebug-2.c @@ -0,0 +1,24 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2024 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +extern int foo (void); + +int +foo (void) +{ + return 0; +} diff --git a/gdb/testsuite/gdb.base/list-nodebug.c b/gdb/testsuite/gdb.base/list-nodebug.c index 078517c011e..d4ae6787310 100644 --- a/gdb/testsuite/gdb.base/list-nodebug.c +++ b/gdb/testsuite/gdb.base/list-nodebug.c @@ -15,7 +15,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -int main () +extern int foo (void); + +int +main (void) { - return 0; + return foo (); } diff --git a/gdb/testsuite/gdb.base/list-nodebug.exp b/gdb/testsuite/gdb.base/list-nodebug.exp index 08de05423af..274e7de0391 100644 --- a/gdb/testsuite/gdb.base/list-nodebug.exp +++ b/gdb/testsuite/gdb.base/list-nodebug.exp @@ -16,13 +16,17 @@ # Test that using the command "list" in a file with no debug information # will not crash GDB and will give reasonable output. -standard_testfile .c +standard_testfile .c -2.c -if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \ - {nodebug}]} { +if {[build_executable_from_specs "failed to prepare" \ + $testfile {} \ + $srcfile {nodebug} \ + $srcfile2 {debug}]} { return -1 } +clean_restart $testfile + if {![runto_main]} { untested "couldn't run to main" return