From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 5C5733858C3A for ; Thu, 26 Jan 2023 16:21:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5C5733858C3A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 9003021E7E for ; Thu, 26 Jan 2023 16:21:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1674750085; 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=yIUjpyBOS9Npd7UF3fwOCmVOC9Ps/QBK3bj1aHdtjzo=; b=yOd7xu2ovgVckHlJ0+qkSi4ouhSAZ+L2rK883sFj0e1AEwpN1DfPpgK5NEq/3Ei+dWQI4/ yVwkGxFp7wEOj4bOEZfrX4FTB+SVld6v7TxgzfljYeqNbzm0JNICMV4iwikat3zZ7ZFvN6 4Ti0ypzzC7IA8CNr7SOqnYFMkIy84uc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1674750085; 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=yIUjpyBOS9Npd7UF3fwOCmVOC9Ps/QBK3bj1aHdtjzo=; b=l13ygcmXDUKrTs/g2A4QfZ4sKhrJF7+J/7kf5rZLRQXX2+8BQ+rHCYuC3l2+UnqNq4B0eQ vUkb49S1nN4JYNBA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 81B5913A09 for ; Thu, 26 Jan 2023 16:21:25 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id S6VPHoWo0mPQQQAAMHmgww (envelope-from ) for ; Thu, 26 Jan 2023 16:21:25 +0000 Message-ID: Date: Thu, 26 Jan 2023 17:21:25 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH] [gdb/testsuite] Add gdb.base/unwind-on-each-insn-{amd64, i386}.exp Content-Language: en-US To: gdb-patches@sourceware.org References: <20230125200910.29700-1-tdevries@suse.de> From: Tom de Vries In-Reply-To: <20230125200910.29700-1-tdevries@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 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.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 1/25/23 21:09, Tom de Vries via Gdb-patches wrote: > The gcc 4.4.x (and earlier) compilers had the problem that the unwind info in > the epilogue was inaccurate. > > In order to work around this in gdb, epilogue unwinders were added with a > higher priority than the dwarf unwinders in the amd64 and i386 targets: > - amd64_epilogue_frame_unwind, and > - i386_epilogue_frame_unwind. > > Subsequently, the epilogue unwind info problem got fixed in gcc 4.5.0. > > However, the epilogue unwinders prevented gdb from taking advantage of the > fixed epilogue unwind info, so the scope of the epilogue unwinders was > limited, bailing out for gcc >= 4.5.0. > > There was no regression test added for this preference scheme, so if we now > declare epilogue unwind info from all gcc versions as trusted, no test will > start failing. > > Fix this by adding an amd64 and i386 regression test for this. > > I have no gcc 4.4.x lying around, so I fabricated the assembly files by: > - commenting out some .cfi directives to break the epilogue unwind info, and > - hand-editing the producer info to 4.4.7 to activate the fix. > > Tested on x86_64-linux, target boards unix/{-m64,-m32}. > --- > .../gdb.base/unwind-on-each-insn-amd64.exp | 42 +++ > .../gdb.base/unwind-on-each-insn-amd64.s | 263 ++++++++++++++++++ > .../gdb.base/unwind-on-each-insn-i386.exp | 39 +++ > .../gdb.base/unwind-on-each-insn-i386.s | 262 +++++++++++++++++ > .../gdb.base/unwind-on-each-insn.exp | 160 +---------- > .../gdb.base/unwind-on-each-insn.exp.tcl | 180 ++++++++++++ > 6 files changed, 792 insertions(+), 154 deletions(-) > create mode 100644 gdb/testsuite/gdb.base/unwind-on-each-insn-amd64.exp > create mode 100644 gdb/testsuite/gdb.base/unwind-on-each-insn-amd64.s > create mode 100644 gdb/testsuite/gdb.base/unwind-on-each-insn-i386.exp > create mode 100644 gdb/testsuite/gdb.base/unwind-on-each-insn-i386.s > create mode 100644 gdb/testsuite/gdb.base/unwind-on-each-insn.exp.tcl I've fixed some nits and pushed this. I did wonder about eliminating commonality between unwind-on-each-insn-i386.exp and unwind-on-each-insn-amd64.exp, but decided it was not worth the trouble. Thanks, - Tom