From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id SzemJOTc6Gmi1jMAWB0awg (envelope-from ) for ; Wed, 22 Apr 2026 10:36:20 -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=M/j3/hrX; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 85CC31E067; Wed, 22 Apr 2026 10:36:20 -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 0745B1E067 for ; Wed, 22 Apr 2026 10:36:19 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 7E53B4BB58F2 for ; Wed, 22 Apr 2026 14:36:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7E53B4BB58F2 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=M/j3/hrX Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 1E45C4BAD17A for ; Wed, 22 Apr 2026 14:35:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1E45C4BAD17A 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 1E45C4BAD17A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776868553; cv=none; b=IBEqME7JWSMjV52fY2bo92TgtNusDWjJB/mU1AsZJIeaqiSIb+j6jDrYG6PEAbElA4FwEs03Htv6yHN66DPcwdbz1ZPH7pFbgGFHIfc6yFJ4WvRt2x5rKyjSmA1H2uRaO3JIrtxUEBmhuwY+ryER6cfaUl8UQ3y51bvTxViEjJ4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776868553; c=relaxed/simple; bh=6BLtjaBNnALoKbUg8rpdzY6r1dfIgyw1U7fOwZ5/02A=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=fPLxcdGi4DA6cfzPmqkMVY44yjP5eJkumPYRIsgbqZ2n8/CPNht0rhZXm3tn3DTdOvfcs94GwnDQTlKUDQOBKB5HjNZI4a6owHprG3s0CDOOvfjZ1p0h5X/WEzXK2ITCfFbqb8mRs1ZY3Jys5Qgh9NXj2ck9PTOVo2wf/KwNbIk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1E45C4BAD17A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1776868552; 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=lii28lW5m99pofyjS9nR4h3DGTnsnXBA8LkY5nU0REo=; b=M/j3/hrX7s9PH3qf+EZc0sqL/H0wQtgIp0n3o1LvQEzBAVn66F1OGBUdrSOmnKJKzXMkay MFZSFzmBUBZRJycdiowtQ4zXdxUNSsQ2h9Mw96aUhfsUdCmvA6Hr60BrzffruNzQTDHARv D3vzaFWq25wZEYSp77fFeUBvd7h/hmU= Received: from mail-ua1-f71.google.com (mail-ua1-f71.google.com [209.85.222.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-518-wQwcvaiaOGGr0a7pmHQwYQ-1; Wed, 22 Apr 2026 10:35:43 -0400 X-MC-Unique: wQwcvaiaOGGr0a7pmHQwYQ-1 X-Mimecast-MFC-AGG-ID: wQwcvaiaOGGr0a7pmHQwYQ_1776868543 Received: by mail-ua1-f71.google.com with SMTP id a1e0cc1a2514c-956732444ffso8342514241.1 for ; Wed, 22 Apr 2026 07:35:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776868542; x=1777473342; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lii28lW5m99pofyjS9nR4h3DGTnsnXBA8LkY5nU0REo=; b=qbU54obAG6CusHPjiveE1sngODam93SVcutFJx2KyK6McDq/KeS8NTKZO8FNyVTf3/ 1i0LhKMOdkyRIZlnyKudj9sfLJE68LV7oPboM6ajONYOhzpruO3fLU2Q6F2GMyUUwJDA m/vyP6nDJJ+3jJEudnUZdYv7i5b30s32s7rlFROktb4xzRgBBzUt8L0S0vj+QEft7hM5 hvQb+HP2ma27GT96aBERRyqzTHqyikrmyTZlYVb4GYXoqmEGFThnUYk51wPWv0OFp9YH 2th7WYoQMvHWb7rMWiL94uf7ySbZNtqIrIHQdJZqbbhdbbEubk/Qyx3SusQfWYxQlvyN K1BQ== X-Gm-Message-State: AOJu0Yw1MalxmxmNE6lufU0gdiiqcsSHT8j2K119LvV3ZwdDyct3lyc1 lHL1wsBtPEW6c39bxhitw4pSqUHhbne9EMmxiUzbgDhegABdcUlChIPKSCLgsBOV9xt5S+Lb3uj XHjwJbxa9DFVufKdsjRNX0ZiU46xX/YSNbZNrEJYXs8usaoNTUXM6vj74fDCFE0jPzBeivo8= X-Gm-Gg: AeBDieuTd07VK1zeXbBuqPSZXYta6Nnw+KPHMxVnk/i9iH+YySXopic6j57+K2Q13Du TN7lXIYdPBAUIoUwrUsQ1J29tXFyaJS3YcM85ezztzlaXz4JdvzA8pnbx47VMNK+fBnUrmaftJO TzulPcMF7pBcwNgp2/y/WXjy43LTch5x+ZbYAg1KnAHFMSnMN4gsWNpgvgwEZoLVyw5OmiJT9gG NX7sW7+KskxgwDgQum/9c92ixXSmH519fnwhEMkdT4tkm/tHGJ2LEUfs4ZOvS+s2jDmawovzTgv kRueiAdwPsM3JxV/Oy31k0ZTXLPMP92ie05dzRojEo+/rw7++Ih1676DHvjwec4bhGyMLHTr+RU TnwR2vtEqmYiU6mh1KXGkTGp+sha8lvOW5hqjD9yJ4A== X-Received: by 2002:a05:6102:605b:b0:607:7991:8edd with SMTP id ada2fe7eead31-616f69cf898mr10913015137.19.1776868542296; Wed, 22 Apr 2026 07:35:42 -0700 (PDT) X-Received: by 2002:a05:6102:605b:b0:607:7991:8edd with SMTP id ada2fe7eead31-616f69cf898mr10912955137.19.1776868541736; Wed, 22 Apr 2026 07:35:41 -0700 (PDT) Received: from ?IPV6:2804:14d:8084:993e::75d? ([2804:14d:8084:993e::75d]) by smtp.gmail.com with ESMTPSA id ada2fe7eead31-617455b52bcsm8064382137.3.2026.04.22.07.35.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Apr 2026 07:35:41 -0700 (PDT) Message-ID: <7504cdd3-a25b-4225-b343-0d985b9de55a@redhat.com> Date: Wed, 22 Apr 2026 11:35:36 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 6/6] gdb/record: Define new version of the record-save section To: Thiago Jung Bauermann Cc: gdb-patches@sourceware.org References: <20260415185836.2732968-1-guinevere@redhat.com> <20260415185836.2732968-7-guinevere@redhat.com> <87v7do95pm.fsf@linaro.org> From: Guinevere Larsen In-Reply-To: <87v7do95pm.fsf@linaro.org> X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: jqg-VdAAdu2zj9z0Ytj9-mXAj10MzGKGVaBLMA0z5HE_1776868543 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 On 4/18/26 2:51 AM, Thiago Jung Bauermann wrote: > Guinevere Larsen writes: > >> 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. >> --- >> gdb/NEWS | 3 +++ >> gdb/record-full.c | 35 +++++++++++++++++++++++++++++++---- >> 2 files changed, 34 insertions(+), 4 deletions(-) > Assuming that the order switch between number of effect entries and > signal I mention below is fixed (or I misunderstood it): > > Reviewed-by: Thiago Jung Bauermann > >> diff --git a/gdb/record-full.c b/gdb/record-full.c >> index 297b5b76ae7..f7cfe5ca1e9 100644 >> --- a/gdb/record-full.c >> +++ b/gdb/record-full.c >> @@ -76,7 +76,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) > Out of curiosity: how was the magic number chosen? It doesn't seem to > based on ASCII. Is it worth adding a comment to explain it? the previous number was 2009 10 16, ie, 16th of october 2009. So I just went with a similar idea, and made the new number 2026 04 15 (15th of april, 2026). I thought that was pretty self explanatory, but I can add a comment explaining it if you'd like. In the end it is just an arbitrary number that shouldn't overlap with previous ones, so I don't find it that important that this is followed in the future honestly. > >> /* These are the core structs of the process record functionality. >> >> @@ -2161,6 +2162,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: >> + 4 bytes: number of reg and mem entries for this instruction. >> + 1 byte: signal. > Looking at the code in record_full_restore, signal comes before the > number of effect entries. Ah, nice catch. I knew I wanted to swap the order of things at some point and I think I forgot to update the comment. Fixed > >> + 4 bytes: instruction count. > Maybe it's just me or I'm a bit tired, but "instruction sequence number" > sounds clearer to me than "instruction count". Make sense, will change the wording > >> + 4 bytes: PC register ID. > Considering that we know that it will be the PC in this "register slot", > it's slightly wasteful to include the register ID here. But I suppose > it's not a problem in practice. Yeah those 4 bytes aren't really required, but they allow me to reuse the write_reg_to_bfd and read_reg_from_bfd functions. Figured the more compact code was worth the extra space required. > >> + 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. */ -- Cheers, Guinevere Larsen It/she