From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id SeD8B/o2B2vuoj0AWB0awg (envelope-from ) for ; Wed, 25 Nov 2026 14:28:58 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=F3D5rqPv; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 1CE761E023; Wed, 25 Nov 2026 14:28:58 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 50ADE1E023 for ; Wed, 25 Nov 2026 14:28:57 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E6D7540B37B5 for ; Wed, 25 Nov 2026 19:28:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E6D7540B37B5 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=F3D5rqPv Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 8CBC640B3996 for ; Wed, 25 Nov 2026 19:28:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8CBC640B3996 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8CBC640B3996 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1795634907; cv=none; b=Z8dziD6e5pSVoQvEkX1IuJN3kpGej7HVSwfPzGzCjdyW8+0L2e6fVYLxrv3yPKaRbsstS5wtvaTH3ZKY1e9W1Ct6j8H+m13kEyagpPf4kWpBDBEPzj+2pns92Wa6Z6T2Nc/L2ypv8UqsNhd7IjR82J4HgaNie9Zyegdhu0zUEu4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1795634907; c=relaxed/simple; bh=Dp4Q6gQdNyBKquyTZ8b3DPzwHLFLIasLi5Hdrnp7gis=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=G2w2wpj7C7i4IAAsd8KwsreRjxnOvDOSQg8VjaS7eQh1QpzwS70GRIzrYtbYBuQM/CWiwgy5JKV54mt7rAva8natCou3oxch6ztK1XQWWeBxw+/BF5I6RyCmdunyUli99JW2I0qQBzRj2jKzAjV+qf23lqV8kgzlTxZkKrwWQC8= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=F3D5rqPv DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8CBC640B3996 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1795634907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=llBK0eAvwUcE+zfcNvNYOKbQNTRFFqIrHUnEBK5VExI=; b=F3D5rqPviz5S8SjT5+jEpRQmQWMsmN+N7oa18SXz7cWIVGPj0lkFdq7EMSgE2G8Eik/g9H SdQtY2RDi918cbGfXOy1EGGeS/fr1rLSR/Qz+i+92fBqrEwUVFB6hJWYttVuLrKMLOOUYm xmFBZEXgeYQu/M+YeG6YYTVB+FNSJDU= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-55-2OvYDhD9NxetGvBjymRrtQ-1; Wed, 25 Nov 2026 19:28:22 +0000 X-MC-Unique: 2OvYDhD9NxetGvBjymRrtQ-1 X-Mimecast-MFC-AGG-ID: 2OvYDhD9NxetGvBjymRrtQ_1795634901 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 731EA18001DD for ; Wed, 25 Nov 2026 19:28:21 +0000 (UTC) Received: from glarsen-thinkpadp16vgen1.redhat.corp (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 20060195B3C5; Wed, 25 Nov 2026 19:28:19 +0000 (UTC) From: Guinevere Larsen To: gdb-patches@sourceware.org Cc: Guinevere Larsen Subject: [PATCH] gdb/record: remove PC member from record_full_instruction Date: Wed, 25 Nov 2026 16:28:07 -0300 Message-ID: <20261125192807.1153538-1-guinevere@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 2-IEKXPt30PN7vAC-gtBcGCXbmgbjXfC9Got5u74-ww_1795634901 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true 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~public-inbox=simark.ca@sourceware.org The recent commit "4d0a9f412df gdb/record: extract the PC to record_full_instruction" caused a regression on s390x, because the recorded register is PSWA, whereas according to gdbarch the PC is a pseudoregister. This was reported as PR record/34937. I tried to make s390 record the gdbarch version, but still got hundreds of regressions in the sigall tests. I then tried to make record ignore the PC member if the length was 0, but that caused problems in the precsave functionality, as we were writing 0 bytes but reading more than 0 as the reading GDB assumed the regnum of 0 was valid. Considering the original motivation for that patch is a micro optimization (a reg_entry is smaller than a generic entry, and the vector is smaller) and improvement for a possible future fix of PR record/18059, it doesn't seem worth it to keep this speculatively. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34937 --- gdb/record-full.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/gdb/record-full.c b/gdb/record-full.c index 7b1d64069c7..228c25cf1cd 100644 --- a/gdb/record-full.c +++ b/gdb/record-full.c @@ -418,7 +418,6 @@ class record_full_entry this one; * sigval: Whether the inferior received a signal while the following instruction was being recorded; - * pc: The Program Counter at the start of the instruction; * effects: A list of record_full_entry structures, each of which describing one effect that the instruction has on the inferior. @@ -433,7 +432,6 @@ struct record_full_instruction uint32_t insn_num; std::optional sigval; std::vector effects; - record_full_reg_entry pc; /* Execute the full instruction. As a side effect, set record_full_stop_reason. */ @@ -755,10 +753,7 @@ record_full_arch_list_add_reg (struct regcache *regcache, int regnum) regcache->cooked_read (regnum, rec.get_loc ()); - if (regnum == gdbarch_pc_regnum (regcache->arch ())) - record_full_incomplete_instruction.pc = std::move (rec.reg ()); - else - record_full_arch_list_add (std::move (rec)); + record_full_arch_list_add (std::move (rec)); return 0; } @@ -914,7 +909,6 @@ static enum target_stop_reason record_full_stop_reason void record_full_instruction::exec_insn (regcache *regcache) { - pc.execute (regcache); for (auto &entry : effects) if (entry.execute (regcache)) record_full_stop_reason = TARGET_STOPPED_BY_WATCHPOINT; @@ -2413,9 +2407,6 @@ record_full_instruction::from_bfd (bfd *cbfd, asection *osec, int *bfd_offset) if (sigval != GDB_SIGNAL_0) record_full_incomplete_instruction.sigval = (gdb_signal) sigval; - record_full_incomplete_instruction.pc - = record_full_reg_entry::from_bfd (cbfd, osec, bfd_offset); - eff_count = netorder32 (eff_count); /* This deals with all the side effects. */ @@ -2627,8 +2618,6 @@ record_full_instruction::to_bfd (gdb_bfd_ref_ptr &obfd, asection *osec, bfdcore_write (obfd.get (), osec, &insn_num, sizeof (uint32_t), bfd_offset); - this->pc.to_bfd (obfd, osec, bfd_offset); - for (auto &entry : this->effects) { entry.to_bfd (obfd, osec, bfd_offset, gdbarch); @@ -2676,7 +2665,6 @@ record_full_base_target::save_record (const char *recfilename) { /* Number of effects of an instruction. */ save_size += sizeof (uint32_t) + sizeof (uint8_t) + sizeof (uint32_t); - save_size += 4 + record_full_log[i].pc.len; for (auto &entry : record_full_log[i].effects) switch (entry.type ()) { @@ -2830,12 +2818,6 @@ maintenance_print_record_instruction (const char *args, int from_tty) } } } - type *regtype = gdbarch_register_type (arch, to_print->pc.num); - value *val = value_from_contents (regtype, to_print->pc.get_loc ()); - gdb_printf ("Register %s changed: ", - gdbarch_register_name (arch, to_print->pc.num)); - value_print (val, gdb_stdout, opts); - gdb_printf ("\n"); } INIT_GDB_FILE (record_full) base-commit: 9e9d08ed5bc2237478299335351954dc50be5ffa -- 2.56.1