From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id CAC3D3858C52 for ; Thu, 19 Jan 2023 10:46:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CAC3D3858C52 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-out2.suse.de (Postfix) with ESMTPS id 11AA75CC60; Thu, 19 Jan 2023 10:46:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1674125179; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=GjTR0Vw1dsRXbf4nPWuXkpvN00W7NGcjRD7SRP6XfUo=; b=fqTs6b/e8BgytceRys4aRnb8gGfpoKshdqxvBgnBwMwQNkkhoEM45GMpeSSOJsH31dTEKb YBGwvGjcwUsoeZFdRDla3Ph0dzzo4eQPtuKGRVF6A1mHKCXqmt+SjR3nOme/032JKnkosh lUbf6iu6s1i2hZPYoqu/LFAk3ZI/mqU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1674125179; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=GjTR0Vw1dsRXbf4nPWuXkpvN00W7NGcjRD7SRP6XfUo=; b=XZvSPzTJ7uONQ8ZyVozy6k5SJ1cxWb8ly509rjAEbkTCFBFJ41JywBJnqmxcOPBOHcO74v dcOWRcOzvH/zP2Dw== 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 E467D139ED; Thu, 19 Jan 2023 10:46:18 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id djaaNnofyWOMJwAAMHmgww (envelope-from ); Thu, 19 Jan 2023 10:46:18 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Cc: Bruno Larsen , Andrew Burgess , Luis Machado Subject: [PATCH 0/4] [gdb] Test-case gdb.base/unwind-on-each-insn.exp improvements Date: Thu, 19 Jan 2023 11:46:14 +0100 Message-Id: <20230119104618.15503-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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: While analyzing PR record/29721 "[gdb, record, aarch64] FAIL: gdb.reverse/solib-precsave.exp: reverse-next third shr1", I came to realize that I was a looking at the aarch64 variant of x86_64 PR record/16678 (as indeed suggested by Bruno in the PR). The test-case gdb.base/unwind-on-each-insn.exp was added in the commit to fix PR record/16678, to detect similar problems on other architectures, but it passes on aarch64 and doesn't detect record/29721, because the function that is checked is too simple on aarch64: ... 00000000004005fc : 4005fc: d503201f nop 400600: d65f03c0 ret ... This series first simplifies, and then improves test-case gdb.base/unwind-on-each-insn.exp to detect PR record/16678, or more precisely, the two spinoff PRs I filed that have reproducers that do not involve reverse execution: - PR30010 - [gdb/tdep, aarch64] Incorrect frame address for last insn (non-leaf case) - PR30011 - [gdb/tdep, aarch64] Incorrect frame address for last insn (leaf case) In short, we have following patches: - [gdb/testsuite] Simplify gdb.base/unwind-on-each-insn.exp Remove unnecessary and fragile complication of analyzing disassembly. - [gdb/testsuite] Improve gdb.base/unwind-on-each-insn.exp Detect PR30011. - [gdb/tdep, aarch64] Fix frame address of last insn in leaf function Fix for PR30011. - [gdb/testsuite] Analyze non-leaf fn in gdb.base/unwind-on-each-insn.exp Detect PR30010. Improving the test-case also detected a problem on powerpc64le, filed as PR tdep/30021 - "[gdb/tdep, powerpc64le] previous frame inner to this frame (corrupt stack?)". Due to unavailability I haven't tested the last patch on powerpc64le-linux. While doing this investigation I also ran into PR tdep/30019 - "[gdb/tdep, i386] frame address at first insn in main is zero", but the test-case doesn't trigger this. I've not tried adding this. Finally, I'm considering moving the test-case to gdb.arch, but I haven't included a patch for this. Tom de Vries (4): [gdb/testsuite] Simplify gdb.base/unwind-on-each-insn.exp [gdb/testsuite] Improve gdb.base/unwind-on-each-insn.exp [gdb/tdep, aarch64] Fix frame address of last insn in leaf function [gdb/testsuite] Analyze non-leaf fn in gdb.base/unwind-on-each-insn.exp gdb/aarch64-tdep.c | 6 +- .../gdb.base/unwind-on-each-insn-foo.c | 8 +- gdb/testsuite/gdb.base/unwind-on-each-insn.c | 6 +- .../gdb.base/unwind-on-each-insn.exp | 167 ++++++++---------- 4 files changed, 89 insertions(+), 98 deletions(-) base-commit: b8d21eb0cd10d6127e77cc437d82e949adb0c454 -- 2.35.3