From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id oXA4L9dMB2pflz0AWB0awg (envelope-from ) for ; Fri, 15 May 2026 12:41:59 -0400 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=Yo1ePZtg; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id BC4031E0B1; Fri, 15 May 2026 12:41:59 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.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,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.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 2D2481E067 for ; Fri, 15 May 2026 12:41:59 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D747E40A00E9 for ; Fri, 15 May 2026 16:41:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D747E40A00E9 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=Yo1ePZtg 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 3BCF940A00FF for ; Fri, 15 May 2026 16:39:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3BCF940A00FF 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 3BCF940A00FF 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=1778863148; cv=none; b=bvryd3bO7q6/MEsal6e4yT21pyddyQkMi1GGeTEUhAQH+sQXYxgMWhu9hS9elkrAu7zfdMmJAybMGv19D4ry1SWpQf/ObyU1vvUByQszTnUZGmJxuLGVAgQLEDVBKdx4KN5EwFeA687W30ZDRjLNj82KA0w+P8pcDsQIi+KqlkM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1778863148; c=relaxed/simple; bh=F/S7H76gMmvgmgbSh/TyhKoWHS8iy4yDmqYTjOqrvnY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=kK40YCy7Uq1nMQcerDHhKKdN9qtidDwzvFvcEgw2yka7atrszINAv8Czr1Cyj9jsrvZkK2VqJngzHMa4F3zbljlblNOCKkOfK6o3Gqs6HJtsdlW88y7cGV4RXF/vn7D21KZUVE66OtMjT+C2xIU7anWahUC+ZKmb8QHnDPfke0w= 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=Yo1ePZtg DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3BCF940A00FF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1778863147; 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: in-reply-to:in-reply-to:references:references; bh=zmiCi0zg0FL9mtcPHWa6WwGP9bzNhDlR/B2PBGhdCZY=; b=Yo1ePZtgfpkDtMjwqzuUt2ggQqOSTeTLNRlzhYVwtUT0OndUYysH4/tlFgAKcekyyCEbQI /Sk5BSND/lJlBYF0BkYT0GV/TAf3ZfZuHDe7SRozKNSmxa3jRUTBpygq4LlSGkfkdIgb39 fZ9283mfLxyA34vVOEFrJ2CqpQJdS/4= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-327-vBC5gWQEO-aWi7hBcLAv_A-1; Fri, 15 May 2026 12:39:04 -0400 X-MC-Unique: vBC5gWQEO-aWi7hBcLAv_A-1 X-Mimecast-MFC-AGG-ID: vBC5gWQEO-aWi7hBcLAv_A_1778863143 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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 651CE19560AA; Fri, 15 May 2026 16:39:03 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.96.134.23]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 36C8C1955F2D; Fri, 15 May 2026 16:39:00 +0000 (UTC) From: Guinevere Larsen To: gdb-patches@sourceware.org Cc: Guinevere Larsen , Thiago Jung Bauermann , Eli Zaretskii Subject: [PATCH v3 5/6] gdb/record: Define new version of the record-save section Date: Fri, 15 May 2026 13:37:02 -0300 Message-ID: <20260515163706.3355686-6-guinevere@redhat.com> In-Reply-To: <20260515163706.3355686-1-guinevere@redhat.com> References: <20260515163706.3355686-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: t_J4oJbakujAFnRrpaybVnyPOMRvlbVLdRIkvR0evpA_1778863143 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 With the changes to the internal representation of the history, we can no longer support the previous record save format. This commit makes it official, documenting the new format and changing the magic number. Reviewed-by: Thiago Jung Bauermann Reviewed-By: Eli Zaretskii --- gdb/NEWS | 4 ++++ gdb/record-full.c | 35 +++++++++++++++++++++++++++++++---- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/gdb/NEWS b/gdb/NEWS index 48a80856aa1..c06e83bb1ba 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -51,6 +51,10 @@ * Support for the binary file format dbx has been removed. +* The format for a saved execution record, created when the command + 'record save' is used, has been updated, and previous formats are + no longer supported. + * When connected to an extended-remote target GDB can now automatically set the 'remote exec-file' in some cases. GDB will auto set the remote exec-file only if the remote wasn't started with diff --git a/gdb/record-full.c b/gdb/record-full.c index 17696e07c0d..055d2c66346 100644 --- a/gdb/record-full.c +++ b/gdb/record-full.c @@ -79,7 +79,8 @@ ((record_full_next_insn != record_full_list.size ()) \ || ::execution_direction == EXEC_REVERSE) -#define RECORD_FULL_FILE_MAGIC netorder32(0x20091016) +#define RECORD_FULL_FILE_MAGIC_OLD netorder32(0x20091016) +#define RECORD_FULL_FILE_MAGIC netorder32(0x20260415) /* These are the core structs of the process record functionality. @@ -2205,6 +2206,27 @@ record_full_core_target::has_execution (inferior *inf) 8 bytes: memory address (network byte order). n bytes: memory value (n == memory length). + Version 3 (all numbers are in network order). + 4 bytes: Magic number (0x20260415). + NOTE: be sure to change whenever this file format changes! + + Records: + record_full_instruction: + 1 byte: signal. + 4 bytes: number of reg and mem entries for this instruction. + 4 bytes: instruction sequence number. + 4 bytes: PC register ID. + N bytes: PC address of instruction (N == size of PC). + Effects: + record_full_reg: + 1 byte: record_type (record_full_reg, see enum record_full_type). + 4 bytes: Register ID. + n bytes: register value (n == actual register size). + record_full_mem: + 1 byte: record_type (record_full_mem, see enum record_full_type). + 4 bytes: memory length. + 8 bytes: memory address. + n bytes: memory value (n = memory length). */ /* bfdcore_read -- read bytes from a core file section. */ @@ -2400,9 +2422,14 @@ record_full_restore (struct bfd &cbfd) /* Check the magic code. */ bfdcore_read (&cbfd, osec, &magic, sizeof (magic), &bfd_offset); if (magic != RECORD_FULL_FILE_MAGIC) - error (_("Version mismatch or file format error in core file %ps."), - styled_string (file_name_style.style (), - bfd_get_filename (&cbfd))); + { + if (magic == RECORD_FULL_FILE_MAGIC_OLD) + error (_("This old recording format is no longer supported.")); + else + error (_("Version mismatch or file format error in core file %ps."), + styled_string (file_name_style.style (), + bfd_get_filename (&cbfd))); + } if (record_debug) gdb_printf (gdb_stdlog, " Reading 4-byte magic cookie " -- 2.54.0