From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id 1CC6A3882166 for ; Thu, 13 Jun 2024 15:40:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1CC6A3882166 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 1CC6A3882166 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=1718293204; cv=none; b=KmOmcnvfa3MrkiNaHHFBMPDyWTxr7krTSH47R+/pzCkapsHWVGnKiDZiEyPlyPK/0lS76eRzMl6eZSRh/Yzn62N1MsnbV46jge2XqJvvn9A8hhF+4X5SQhRaPUG7TaDCcm6b7vxWrSMnMfWhHKKK0/e8YUzdbUE7Y0L7qrQNgqQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718293204; c=relaxed/simple; bh=v6JssXB12bLv/Lje8snW+mXfodROpx7rtsRN4Wfdxfs=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:From:To; b=b64JKFMsN6vnIfYpAS+xbW1mJquNjkjO189cyDjOD7Jrs2GxS7JOKXteK8TZCqTVr5kV0xxKmil9Z+QWGrmpA9vvk2gg9+UmMf3m2py36xWJaPzy8JqO9UznFB/SBixR4g8lblVbWZPiAoEfpVafmqNpFSYJ/1fdVmXGENtcYME= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (unknown [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 1E59A5D52B for ; Thu, 13 Jun 2024 15:40:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718293200; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oXMsouZNvYP6uVVmWJ6Lt6w6zznFT8k0c393jgsHHxM=; b=QWg/t+eRnqI09Qtzf9F/VnlwsobDBnofxj+euUONih7GRQfUKuTtlMuFHUjCCS6wXm5CFh KtjCEMJH1qgDk1vumI9eHFmxx/SiEZi+343Q+KUDLpp4nYkMfwAi+Ms/QGLYIuThrjQCon IclV/B6cxCg9AKsliyjkiOYGFMIcoCM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718293200; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oXMsouZNvYP6uVVmWJ6Lt6w6zznFT8k0c393jgsHHxM=; b=OHgFe8LCZ/cP0KVuBiHBmMBJSGQlyg8iKBWVP6wL/hdWYJ6pW9ZFthlkhkG2LaaUrmt+Lv witXfxfbqQdAqWCQ== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718293200; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oXMsouZNvYP6uVVmWJ6Lt6w6zznFT8k0c393jgsHHxM=; b=QWg/t+eRnqI09Qtzf9F/VnlwsobDBnofxj+euUONih7GRQfUKuTtlMuFHUjCCS6wXm5CFh KtjCEMJH1qgDk1vumI9eHFmxx/SiEZi+343Q+KUDLpp4nYkMfwAi+Ms/QGLYIuThrjQCon IclV/B6cxCg9AKsliyjkiOYGFMIcoCM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718293200; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oXMsouZNvYP6uVVmWJ6Lt6w6zznFT8k0c393jgsHHxM=; b=OHgFe8LCZ/cP0KVuBiHBmMBJSGQlyg8iKBWVP6wL/hdWYJ6pW9ZFthlkhkG2LaaUrmt+Lv witXfxfbqQdAqWCQ== 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 0986D13A87 for ; Thu, 13 Jun 2024 15:40:00 +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 BcvIANASa2agZQAAD6G6ig (envelope-from ) for ; Thu, 13 Jun 2024 15:40:00 +0000 Message-ID: <44fac677-58a3-4bd6-956f-a20615652cdf@suse.de> Date: Thu, 13 Jun 2024 17:40:43 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 01/11] [gdb/testsuite] Add gdb.base/fission-macro.exp From: Tom de Vries To: gdb-patches@sourceware.org References: <20240521154415.9543-1-tdevries@suse.de> Content-Language: en-US In-Reply-To: <20240521154415.9543-1-tdevries@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -4.29 X-Spam-Level: X-Spamd-Result: default: False [-4.29 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; XM_UA_NO_VERSION(0.01)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo] X-Spam-Status: No, score=-12.4 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 List-Id: On 5/21/24 17:44, Tom de Vries wrote: > Starting with gcc commit 80048aa13a6 ("debug/111409 - don't generate COMDAT > macro sections for split DWARF"), available from release gcc 14.1 onwards, gcc > produces a usable dwarf-5 32-bit .debug_macro.dwo section. > > Add a test-case excercising this. > I went ahead and pushed this patch, since it only adds a test-case. Thanks, - Tom > Tested on x86_64-linux. > > Tested test-case using a current gcc trunk build, and gcc 14. > --- > gdb/testsuite/gdb.base/fission-macro-2.c | 27 +++++++++ > gdb/testsuite/gdb.base/fission-macro.c | 27 +++++++++ > gdb/testsuite/gdb.base/fission-macro.exp | 75 ++++++++++++++++++++++++ > 3 files changed, 129 insertions(+) > create mode 100644 gdb/testsuite/gdb.base/fission-macro-2.c > create mode 100644 gdb/testsuite/gdb.base/fission-macro.c > create mode 100644 gdb/testsuite/gdb.base/fission-macro.exp > > diff --git a/gdb/testsuite/gdb.base/fission-macro-2.c b/gdb/testsuite/gdb.base/fission-macro-2.c > new file mode 100644 > index 00000000000..fb088c8bfaf > --- /dev/null > +++ b/gdb/testsuite/gdb.base/fission-macro-2.c > @@ -0,0 +1,27 @@ > +/* 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 . */ > + > +#define THIRD 3 > +#define FOURTH 4 > + > +extern int foo (void); > + > +int > +foo (void) > +{ > + return 0; > +} > diff --git a/gdb/testsuite/gdb.base/fission-macro.c b/gdb/testsuite/gdb.base/fission-macro.c > new file mode 100644 > index 00000000000..9c8cbece5c5 > --- /dev/null > +++ b/gdb/testsuite/gdb.base/fission-macro.c > @@ -0,0 +1,27 @@ > +/* 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 . */ > + > +#define FIRST 1 > +#define SECOND 2 > + > +extern int foo (void); > + > +int > +main (void) > +{ > + return foo (); > +} > diff --git a/gdb/testsuite/gdb.base/fission-macro.exp b/gdb/testsuite/gdb.base/fission-macro.exp > new file mode 100644 > index 00000000000..705e3dd0c4b > --- /dev/null > +++ b/gdb/testsuite/gdb.base/fission-macro.exp > @@ -0,0 +1,75 @@ > +# 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 . */ > + > +# Gcc 14 is the first release containing the fix for PR debug/111409. > +require {expr [gcc_major_version] >= 14} > + > +standard_testfile .c -2.c > + > +proc do_tests { dwarf_version dwarf_bits strict_dwarf } { > + set opts {} > + lappend opts debug > + lappend opts quiet > + lappend opts additional_flags=-gsplit-dwarf > + lappend opts macros > + > + if { $dwarf_bits == 64 } { > + lappend opts additional_flags=-gdwarf64 > + } > + > + if { $strict_dwarf } { > + lappend opts additional_flags=-gstrict-dwarf > + } > + > + lappend opts additional_flags=-gdwarf-$dwarf_version > + > + set id v$dwarf_version-b$dwarf_bits-s$strict_dwarf > + > + set srcfiles [list $::srcfile $::srcfile2] > + if { [build_executable "failed to prepare" $::testfile-$id $srcfiles $opts] } { > + return -1 > + } > + > + clean_restart > + > + gdb_load_no_complaints $::binfile-$id > + > + if {![runto_main]} { > + return 0 > + } > + > + gdb_test "p FIRST" " = 1" > + gdb_test "p SECOND" " = 2" > + > + gdb_test "info macro FIRST" "#define FIRST 1" > + gdb_test "info macro SECOND" "#define SECOND 2" > + > + gdb_breakpoint foo > + gdb_continue_to_breakpoint "foo" > + > + gdb_test "p THIRD" " = 3" > + gdb_test "p FOURTH" " = 4" > + > + gdb_test "info macro THIRD" "#define THIRD 3" > + gdb_test "info macro FOURTH" "#define FOURTH 4" > +} > + > +foreach_with_prefix dwarf_version {5} { > + foreach_with_prefix dwarf_bits {32} { > + foreach_with_prefix strict_dwarf {0 1} { > + do_tests $dwarf_version $dwarf_bits $strict_dwarf > + } > + } > +} > > base-commit: 05887e360ad3db3265e3dc2f7a845660d1d3c02f