From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id PE+KEcf9FWqISh4AWB0awg (envelope-from ) for ; Tue, 26 May 2026 16:08:39 -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=guO9zSF1; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 3002E1E0A3; Tue, 26 May 2026 16:08:39 -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 2AC5D1E024 for ; Tue, 26 May 2026 16:08:38 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 457484BA23CD for ; Tue, 26 May 2026 20:08:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 457484BA23CD 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=guO9zSF1 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 8A69D4BA23CD for ; Tue, 26 May 2026 20:08:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8A69D4BA23CD 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 8A69D4BA23CD 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=1779826084; cv=none; b=fVoKsa15CoeNNEZOhOY3nrJh/nh7A/l6XxadOyyWMZl8L7daIJGcchoVJ39o7N5BcqJ6zI1qhdJmbAW5m9P9Un1PI3wTw05voE7h9nHljeZV+gtUluH6b58ECotM4TgFUYZYuNy6377sXRfWlo3H3J0Y5aAiYRoM5lUR3jVArGc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1779826084; c=relaxed/simple; bh=hZ+IDp2vZVgk8WJ9FQMMzJSdho7Dv6/4gjTFaxCpOmM=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=HFr7mQf6HsC2qhGkTWSA6O4vaAaQei1r4Xzu4Pqa3qI0+o5mBNavkeszbu8JEjASKp4ooUh5dIjq6IBzk5fHnAVLp3ovXXiqIY+N1O/UIsdpUUyTDvyfIKvtLNJRNg+mtzEVuol2nZpW2PBBQFUhhctOuGOV/f00JHkrNyJmKQw= 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=guO9zSF1 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8A69D4BA23CD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1779826084; h=from:from:reply-to:subject:subject: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=U9oetB1XKcQkWUBOMf/AY7sEOh/BzC17V0dEiYKXRVI=; b=guO9zSF18SFBjZqEoezLg5HwfHWYYkk+tAzce0+o+tCENHhHsBZl9iAoT4A8ASa9pBmZ9j ltj0lw/WQ8zBNvlQTztQx3BPGIt0py0BGRvnRYhWugDsKBnA8Fnd5Uiv1x/PhA58SsFnXe 9mibFArTJgxXUJIjKHutbOsgrKXBL/Y= Received: from mail-vk1-f200.google.com (mail-vk1-f200.google.com [209.85.221.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-515-sV1G4_WlN9mY5hCARxO-Cg-1; Tue, 26 May 2026 16:08:01 -0400 X-MC-Unique: sV1G4_WlN9mY5hCARxO-Cg-1 X-Mimecast-MFC-AGG-ID: sV1G4_WlN9mY5hCARxO-Cg_1779826080 Received: by mail-vk1-f200.google.com with SMTP id 71dfb90a1353d-575456ad2b2so7420518e0c.0 for ; Tue, 26 May 2026 13:08:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779826080; x=1780430880; h=content-transfer-encoding:in-reply-to:from:content-language :references: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=U9oetB1XKcQkWUBOMf/AY7sEOh/BzC17V0dEiYKXRVI=; b=B8fwO/fkkdIiuMSkyY7SiwJYvMrAUGYabwvnGHfRP2Ub1x7ZIWoj4wgMAx5jCUT+xZ dXLr/1R1tCsquP6YMXN0Ekh0vA+1KGP4/OPJleG5GxjKcXbKETjLZ9+iPRjPe+yTPVTM UpRy0bPpkHmKIPVeT1QVXxmY59KhTHKmnPT7bl+tQz/2C/LU5HBElRMq12jYlhSuHfeA Jm+Pfh9OWMm3kaHr04RY/AEY1qxy/QzZOVO3bwZ+KdP/VyqOki1igqxdL6oWgMvMFk35 HIK4EzWqYsLPXIXv7HD7y5oqBdES/cWST4VkplUHi5ipM2ZeQVGRofj1xNR/9BwZUHib eM0A== X-Forwarded-Encrypted: i=1; AFNElJ/V+Kqy19GVXHN0/mlcZCDB6ZQ2J7F7VF0tAxjXCkj62BjrYZS+LhdJJdtYfOS0Oz/jTl77JLFFa4/xWg==@sourceware.org X-Gm-Message-State: AOJu0YzGLmJljLbpPDmmtzcgs0i+yRb2orPed9fnrmw2StrfhevQ1ob+ 0oc/vo71PmNLeZmN8JSsEIRAxLJbz8Y0nknTw4643So1ylnjwVWPMVF+QEIeDyJjS7MiiA6hksX iNNgm0tMMNwdXyXwxGIsDAZznDCWVTpz0h7+s6hzRWaVZ8TDuGayy854tkZ9PPBg= X-Gm-Gg: Acq92OGTtfvIXp96RRzBgGlewiyrvhw6UUZJWmBTrxeCbg0oEI91ZfjCku2sZjMAh35 wWawh+NutVUO5Ae+NUKxpsB7mhjL9mikJqeanxDXJlL3/S1AT0EUB89jI8/biyHPmOgDBFyaM/O r7O/7SGShPAWH5vZoMvWvwOkzIdzig7EaYlX1HAm+QCrI+6IEWVfra+GftGoI5hrPFTthYRpw7D y/jdCOqjOln+TRecolQxpCTsR1mNQEJmb5KEbpzdQE8PA37JFhiHnFDIjqEQDH2glur74LukhO5 fjFjNSk1gc+4dnRWDlDytJIizFb7b+VdK8CPDuEwMd212tYKmZoaDtchatU+5kJnPSv92ItmVyE q3Ct7t9Wn6EaTUn7AOaSl0qjtPue8lhn50IwCyKd7ZG64DyC2OUXMbmIZPD5lUpYQ8Pgp X-Received: by 2002:a05:6122:4b89:b0:56e:ded3:98eb with SMTP id 71dfb90a1353d-5865f727132mr10106859e0c.6.1779826080327; Tue, 26 May 2026 13:08:00 -0700 (PDT) X-Received: by 2002:a05:6122:4b89:b0:56e:ded3:98eb with SMTP id 71dfb90a1353d-5865f727132mr10106848e0c.6.1779826079820; Tue, 26 May 2026 13:07:59 -0700 (PDT) Received: from ?IPV6:2804:14d:8084:993e:2d5d:7adb:2b6:a50e? ([2804:14d:8084:993e:2d5d:7adb:2b6:a50e]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-58d6412d8cbsm9468181e0c.4.2026.05.26.13.07.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 26 May 2026 13:07:59 -0700 (PDT) Message-ID: <4e25ebb2-c992-4183-9ef5-97f63760ca87@redhat.com> Date: Tue, 26 May 2026 17:07:55 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 4/7] gdb/record: make record_full_history more c++-like To: "Schimpe, Christina" , "gdb-patches@sourceware.org" References: <20260515163706.3355686-1-guinevere@redhat.com> <20260515163706.3355686-5-guinevere@redhat.com> From: Guinevere Larsen In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 8xufIwpHciw5T5lsoMx1HggZso4zuIVFpv-NKMgvU1I_1779826080 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 5/26/26 6:04 AM, Schimpe, Christina wrote: >> -----Original Message----- >> From: Guinevere Larsen >> Sent: Freitag, 15. Mai 2026 18:37 >> To: gdb-patches@sourceware.org >> Cc: Guinevere Larsen >> Subject: [PATCH v3 4/7] gdb/record: make record_full_history more c++-like >> >> Move some functions to being a method of record_full_history, instead of >> floating functions. > Commit message: > > - Shouldn't it be "a method of struct record_full_instruction" (also for the header)? > - it's only one function, so you could simply write the function name instead of "Move some functions" > >> --- >> gdb/record-full.c | 25 +++++++++++-------------- >> 1 file changed, 11 insertions(+), 14 deletions(-) >> >> diff --git a/gdb/record-full.c b/gdb/record-full.c index >> 24e94eaf5da..8cabd6e9438 100644 >> --- a/gdb/record-full.c >> +++ b/gdb/record-full.c >> @@ -388,6 +388,10 @@ struct record_full_instruction >> uint32_t insn_num; >> std::optional sigval; >> std::vector effects; >> + >> + /* Execute the full instruction. As a side effect, set >> + record_full_stop_reason. */ >> + void exec_insn (regcache *regcache); >> }; >> >> /* If true, query if PREC cannot record memory @@ -843,12 +847,9 @@ >> record_full_gdb_operation_disable_set (void) static enum target_stop_reason >> record_full_stop_reason >> = TARGET_STOPPED_BY_NO_REASON; >> >> -static inline void >> -record_full_exec_insn (regcache *regcache, >> - gdbarch *gdbarch, >> - record_full_instruction &insn) >> +void record_full_instruction::exec_insn (regcache *regcache) >> { >> - for (auto &entry : insn.effects) >> + for (auto &entry : effects) >> if (entry.execute (regcache)) >> record_full_stop_reason = TARGET_STOPPED_BY_WATCHPOINT; } @@ - >> 1308,9 +1309,7 @@ record_full_wait_1 (struct target_ops *ops, >> break; >> } >> >> - record_full_exec_insn >> - (regcache, gdbarch, >> - record_full_list[record_full_next_insn]); >> + record_full_list[record_full_next_insn].exec_insn (regcache); >> >> /* step */ >> if (record_full_resume_step) >> @@ -2503,8 +2502,7 @@ record_full_base_target::save_record (const char >> *recfilename) >> >> /* Reverse execute to the begin of record list. */ >> for (int i = record_full_next_insn - 1; i >= 0; i--) >> - record_full_exec_insn (regcache, gdbarch, >> - record_full_list[i]); >> + record_full_list[i].exec_insn (regcache); >> >> /* Compute the size needed for the extra bfd section. */ >> save_size = 4; /* magic cookie */ >> @@ -2576,7 +2574,7 @@ record_full_base_target::save_record (const char >> *recfilename) >> } >> /* Execute entry. */ >> if (i < record_full_next_insn) >> - record_full_exec_insn (regcache, gdbarch, record_full_list[i]); >> + record_full_list[i].exec_insn (regcache); >> } >> >> unlink_file.keep (); >> @@ -2597,17 +2595,16 @@ record_full_goto_insn (size_t target_insn, >> scoped_restore restore_operation_disable >> = record_full_gdb_operation_disable_set (); >> regcache *regcache = get_thread_regcache (inferior_thread ()); >> - struct gdbarch *gdbarch = regcache->arch (); >> >> /* Assume everything is valid: we will hit the entry, >> and we will not hit the end of the recording. */ >> >> if (dir == EXEC_REVERSE) >> for (int i = record_full_next_insn; i > target_insn; i--) >> - record_full_exec_insn (regcache, gdbarch, record_full_list[i - 1]); >> + record_full_list[i-1].exec_insn (regcache); > Nit: spaces missing in i-1 => i - i > >> else >> for (int i = record_full_next_insn; i < target_insn; i++) >> - record_full_exec_insn (regcache, gdbarch, record_full_list[i]); >> + record_full_list[i].exec_insn (regcache); >> } >> >> /* Alias for "target record-full". */ >> -- >> 2.54.0 >> > With the nits fixed, LGTM. > > Reviewed-By: Christina Schimpe Fixed all the nits! thanks for the review! > > Christina > > Intel Deutschland GmbH > Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany > Tel: +49 89 991 430, www.intel.de > Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell > Chairperson of the Supervisory Board: Nicole Lau > Registered Seat: Munich > Commercial Register: Amtsgericht Muenchen HRB 186928 > -- Cheers, Guinevere Larsen It/she