From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 8ZUHBBMmMGpPfggAWB0awg (envelope-from ) for ; Mon, 15 Jun 2026 12:19:31 -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=eWhwpELf; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 08E161E098; Mon, 15 Jun 2026 12:19:31 -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.1 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_SBL_CSS 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 96BC11E070 for ; Mon, 15 Jun 2026 12:19:29 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 985D94B9DB79 for ; Mon, 15 Jun 2026 16:19:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 985D94B9DB79 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=eWhwpELf 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 BA6B54B9DB79 for ; Mon, 15 Jun 2026 16:15:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BA6B54B9DB79 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 BA6B54B9DB79 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1781540160; cv=none; b=v5DySSHA1yJiyVXluTMZNqH+uROjks5P7LXcVzQYs1wLaeDzkAcVITCesOoTD/LRWA3DSMIJnIjy+4hsEqqX2mugDfKVKMm7UUj5SeylOB8B3snYYl90mYkmFU3nFgRXA3DfaJu6TrIL9FavDOv57Ig5R1rk+2wM9i+J8lW50a8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1781540160; c=relaxed/simple; bh=caUv/BOlDNiZRSvY1OLl3FK1/qfYQJvUqjRzBDY2QO0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=LvMZOrUX2CNpLYaRqOatqLwsSBnOwgFqCwzBuwuCXbXHjHt32m62b4ltDBr+pfHnKNr1apikTEQ+ddU1IHvGtn4AJisbG6IqCmQQhuZ2eYHdySncjhBLiogBk9mbL/HSz+xbAshQJ/NKDXdhYRZT+4Qnqa1gZUCqg5U0xE8824c= 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=eWhwpELf DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BA6B54B9DB79 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1781540158; 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=Bhsw8dZkE3oK/0MxK2xYCzbH0+zLve1rvk0fPVVTBhI=; b=eWhwpELfjjGEj4uQ+WgjTihUQojpir9g5xvn3pN07W1iVhJ0KloTSeSBlLMdCSDcA4O7Xw dN1XHY8BT28+E1tfct7XO/xPswwEYNgnWzNyZLbInOKbJR3Fi46vlqICIKch7jqo3cIaEc tZxRfobFE/kIlvMmjJXJ/Pgzo+Ii260= Received: from mx-prod-mc-03.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-454-ui45tN7zM--qFoeCuwHJ4w-1; Mon, 15 Jun 2026 12:15:54 -0400 X-MC-Unique: ui45tN7zM--qFoeCuwHJ4w-1 X-Mimecast-MFC-AGG-ID: ui45tN7zM--qFoeCuwHJ4w_1781540153 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 70B211956054; Mon, 15 Jun 2026 16:15:53 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.96.134.37]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 665B01955BCE; Mon, 15 Jun 2026 16:15:51 +0000 (UTC) From: Guinevere Larsen To: gdb-patches@sourceware.org Cc: Guinevere Larsen , Thiago Jung Bauermann , Christina Schimpe Subject: [PATCH v5 8/8] gdb/record: rename record_full_list to record_full_log Date: Mon, 15 Jun 2026 13:15:00 -0300 Message-ID: <20260615161500.34181-9-guinevere@redhat.com> In-Reply-To: <20260615161500.34181-1-guinevere@redhat.com> References: <20260615161500.34181-1-guinevere@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: Ej6agDG1l_l6qK5Zy_8kGr1kuM29I9-fHwXvBVNOkB0_1781540153 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 Now that we no longer use a linked list to manage the history, the name "record_full_list" is no longer meaningful. This commit changes the name to record_full_log since it is the execution log. I decided to not say "record_full_execution_log" to avoid overly long lines when accessing it. Reviewed-by: Thiago Jung Bauermann Reviewed-By: Christina Schimpe --- gdb/record-full.c | 122 +++++++++++++++++++++++----------------------- 1 file changed, 61 insertions(+), 61 deletions(-) diff --git a/gdb/record-full.c b/gdb/record-full.c index ba8b8688415..dee505bcaa7 100644 --- a/gdb/record-full.c +++ b/gdb/record-full.c @@ -76,7 +76,7 @@ #define DEFAULT_RECORD_FULL_INSN_MAX_NUM 200000 #define RECORD_FULL_IS_REPLAY \ - ((record_full_next_insn != record_full_list.size ()) \ + ((record_full_next_insn != record_full_log.size ()) \ || ::execution_direction == EXEC_REVERSE) #define RECORD_FULL_FILE_MAGIC_OLD netorder32(0x20091016) @@ -464,7 +464,7 @@ static struct record_full_core_buf_entry *record_full_core_buf_list = NULL; /* The following variables are used for managing the history of executed instructions from the inferior. - record_full_list contains all instructions that were fully executed and + record_full_log contains all instructions that were fully executed and saved to the log, so that we can replay the execution. record_full_next_insn always points to the next instruction that would @@ -477,7 +477,7 @@ static struct record_full_core_buf_entry *record_full_core_buf_list = NULL; happening. It is manipulated by the "arch list" functions for historical reasons. */ -static std::deque record_full_list; +static std::deque record_full_log; static record_full_instruction record_full_incomplete_instruction; static int record_full_next_insn; @@ -685,19 +685,19 @@ record_full_reset_history () record_full_insn_count = 0; record_full_next_insn = 0; - record_full_list.clear (); + record_full_log.clear (); } /* Release all record entries after the INDEXth entry in the log. */ static void -record_full_list_release_following (int index) +record_full_log_release_following (int index) { - if (record_full_list.empty ()) + if (record_full_log.empty ()) return; - for (int i = record_full_list.size () - 1; i > index; i--) - record_full_list.pop_back (); + for (int i = record_full_log.size () - 1; i > index; i--) + record_full_log.pop_back (); /* Set the next instruction to be past the end of the log so we start recording if the user moves forward again. */ record_full_next_insn = index; @@ -711,7 +711,7 @@ record_full_save_instruction () ++record_full_insn_count; record_full_incomplete_instruction.insn_num = record_full_insn_count; record_full_incomplete_instruction.effects.shrink_to_fit (); - record_full_list.push_back (std::move (record_full_incomplete_instruction)); + record_full_log.push_back (std::move (record_full_incomplete_instruction)); record_full_next_insn++; record_full_reset_incomplete (); @@ -721,12 +721,12 @@ record_full_save_instruction () room for adding a new instruction at the end of the log. */ static void -record_full_list_release_first (void) +record_full_log_release_first (void) { - if (record_full_list.empty ()) + if (record_full_log.empty ()) return; - record_full_list.pop_front (); + record_full_log.pop_front (); --record_full_next_insn; } @@ -790,7 +790,7 @@ record_full_arch_list_add_mem (CORE_ADDR addr, int len) static void record_full_check_insn_num (void) { - if (record_full_list.size () == record_full_insn_max_num) + if (record_full_log.size () == record_full_insn_max_num) { /* Ask user what to do. */ if (record_full_stop_at_limit) @@ -806,9 +806,9 @@ record_full_check_insn_num (void) /* Before inferior step (when GDB record the running message, inferior only can step), GDB will call this function to record the values to - record_full_list. This function will call gdbarch_process_record to + record_full_log. This function will call gdbarch_process_record to record the running message of inferior and set them to - record_full_arch_list, and add it to record_full_list. */ + record_full_arch_list, and add it to record_full_log. */ static void record_full_message (struct regcache *regcache, enum gdb_signal signal) @@ -846,8 +846,8 @@ record_full_message (struct regcache *regcache, enum gdb_signal signal) if we delivered it during the recording. Therefore we should record the signal during record_full_wait, not record_full_resume. */ - if (signal != GDB_SIGNAL_0 && !record_full_list.empty ()) - record_full_list[record_full_next_insn - 1].sigval = signal; + if (signal != GDB_SIGNAL_0 && !record_full_log.empty ()) + record_full_log[record_full_next_insn - 1].sigval = signal; if (signal == GDB_SIGNAL_0 || !gdbarch_process_record_signal_p (gdbarch)) @@ -872,8 +872,8 @@ record_full_message (struct regcache *regcache, enum gdb_signal signal) record_full_save_instruction (); - if (record_full_list.size () == record_full_insn_max_num) - record_full_list_release_first (); + if (record_full_log.size () == record_full_insn_max_num) + record_full_log_release_first (); } static bool @@ -1353,7 +1353,7 @@ record_full_wait_1 (struct target_ops *ops, if (execution_direction == EXEC_REVERSE) record_full_next_insn--; - /* Loop over the record_full_list, looking for the next place to + /* Loop over the record_full_log, looking for the next place to stop. */ do { @@ -1367,14 +1367,14 @@ record_full_wait_1 (struct target_ops *ops, break; } if (execution_direction != EXEC_REVERSE - && record_full_next_insn == record_full_list.size ()) + && record_full_next_insn == record_full_log.size ()) { /* Hit end of record log going forward. */ status->set_no_history (); break; } - record_full_list[record_full_next_insn].exec_insn (regcache); + record_full_log[record_full_next_insn].exec_insn (regcache); /* step */ if (record_full_resume_step) @@ -1408,7 +1408,7 @@ record_full_wait_1 (struct target_ops *ops, "watchpoint.\n"); continue_flag = 0; } - if (record_full_list[record_full_next_insn].sigval.has_value ()) + if (record_full_log[record_full_next_insn].sigval.has_value ()) continue_flag = 0; if (execution_direction == EXEC_REVERSE) @@ -1423,10 +1423,10 @@ record_full_wait_1 (struct target_ops *ops, gdb_assert (execution_direction == EXEC_REVERSE); record_full_next_insn = 0; } - else if (record_full_next_insn > record_full_list.size ()) + else if (record_full_next_insn > record_full_log.size ()) { gdb_assert (execution_direction == EXEC_FORWARD); - record_full_next_insn = record_full_list.size (); + record_full_next_insn = record_full_log.size (); } /* Reset the current instruction to point to the one to be replayed moving forward. */ @@ -1440,9 +1440,9 @@ record_full_wait_1 (struct target_ops *ops, ? record_full_next_insn - 1 : record_full_next_insn; if (record_full_get_sig) status->set_stopped (GDB_SIGNAL_INT); - else if (record_full_list[insn].sigval.has_value ()) + else if (record_full_log[insn].sigval.has_value ()) status->set_stopped - (record_full_list[insn].sigval.value ()); + (record_full_log[insn].sigval.value ()); else status->set_stopped (GDB_SIGNAL_TRAP); } @@ -1565,8 +1565,8 @@ record_full_registers_change (struct regcache *regcache, int regnum) } record_full_save_instruction (); - if (record_full_list.size () == record_full_insn_max_num) - record_full_list_release_first (); + if (record_full_log.size () == record_full_insn_max_num) + record_full_log_release_first (); } /* "store_registers" method for process record target. */ @@ -1615,7 +1615,7 @@ record_full_target::store_registers (struct regcache *regcache, int regno) } /* Destroy the record from here forward. */ - record_full_list_release_following (record_full_next_insn); + record_full_log_release_following (record_full_next_insn); } record_full_registers_change (regcache, regno); @@ -1648,7 +1648,7 @@ record_full_target::xfer_partial (enum target_object object, error (_("Process record canceled the operation.")); /* Destroy the record from here forward. */ - record_full_list_release_following (record_full_next_insn); + record_full_log_release_following (record_full_next_insn); } /* Check record_full_insn_num */ @@ -1667,8 +1667,8 @@ record_full_target::xfer_partial (enum target_object object, } record_full_save_instruction (); - if (record_full_list.size () == record_full_insn_max_num) - record_full_list_release_first (); + if (record_full_log.size () == record_full_insn_max_num) + record_full_log_release_first (); } return this->beneath ()->xfer_partial (object, annex, readbuf, writebuf, @@ -1824,11 +1824,11 @@ record_full_base_target::get_bookmark (const char *args, int from_tty) { char *ret = NULL; - if (record_full_list.empty ()) + if (record_full_log.empty ()) return (gdb_byte *) ret; /* Return stringified form of instruction count. */ - ret = xstrdup (pulongest (record_full_list[record_full_next_insn].insn_num)); + ret = xstrdup (pulongest (record_full_log[record_full_next_insn].insn_num)); if (record_debug) { @@ -1890,16 +1890,16 @@ record_full_base_target::info_record () gdb_printf (_("Record mode:\n")); /* Do we have a log at all? */ - if (!record_full_list.empty ()) + if (!record_full_log.empty ()) { /* Display instruction number for first instruction in the log. */ gdb_printf (_("Lowest recorded instruction number is %u.\n"), - record_full_list[0].insn_num); + record_full_log[0].insn_num); /* If in replay mode, display where we are in the log. */ if (RECORD_FULL_IS_REPLAY) gdb_printf (_("Current instruction number is %u.\n"), - record_full_list[record_full_next_insn].insn_num); + record_full_log[record_full_next_insn].insn_num); /* Display instruction number for last instruction in the log. */ gdb_printf (_("Highest recorded instruction number is %s.\n"), @@ -1907,7 +1907,7 @@ record_full_base_target::info_record () /* Display log count. */ gdb_printf (_("Log contains %lu instructions.\n"), - (unsigned long int) record_full_list.size ()); + (unsigned long int) record_full_log.size ()); } else gdb_printf (_("No instructions have been logged.\n")); @@ -1956,14 +1956,14 @@ record_full_base_target::record_will_replay (ptid_t ptid, int dir) static void record_full_goto_entry (size_t target_insn) { - if (target_insn >= record_full_list.size ()) + if (target_insn >= record_full_log.size ()) error (_("Target insn not found.")); else if (target_insn == record_full_next_insn) error (_("Already at target insn.")); else if (target_insn > record_full_next_insn) { gdb_printf (_("Go forward to insn number %s\n"), - pulongest (record_full_list[target_insn].insn_num)); + pulongest (record_full_log[target_insn].insn_num)); record_full_goto_insn (target_insn, EXEC_FORWARD); } else @@ -1994,7 +1994,7 @@ record_full_base_target::goto_record_begin () void record_full_base_target::goto_record_end () { - record_full_goto_entry (record_full_list.size () - 1); + record_full_goto_entry (record_full_log.size () - 1); } /* The "goto_record" target method. */ @@ -2431,7 +2431,7 @@ record_full_restore (struct bfd &cbfd) int bfd_offset = 0; /* "record_full_restore" can only be called when record list is empty. */ - gdb_assert (record_full_list.empty ()); + gdb_assert (record_full_log.empty ()); if (record_debug) gdb_printf (gdb_stdlog, "Restoring recording from core file.\n"); @@ -2482,9 +2482,9 @@ record_full_restore (struct bfd &cbfd) } /* Update record_full_insn_max_num. */ - if (record_full_list.size () > record_full_insn_max_num) + if (record_full_log.size () > record_full_insn_max_num) { - record_full_insn_max_num = record_full_list.size (); + record_full_insn_max_num = record_full_log.size (); warning (_("Auto increase record/replay buffer limit to %u."), record_full_insn_max_num); } @@ -2660,16 +2660,16 @@ 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_list[i].exec_insn (regcache); + record_full_log[i].exec_insn (regcache); /* Compute the size needed for the extra bfd section. */ save_size = 4; /* magic cookie */ - for (int i = record_full_list.size () - 1; i >= 0; i--) + for (int i = record_full_log.size () - 1; i >= 0; i--) { /* Number of effects of an instruction. */ save_size += sizeof (uint32_t) + sizeof (uint8_t) + sizeof (uint32_t); - save_size += 4 + record_full_list[i].pc.len; - for (auto &entry : record_full_list[i].effects) + save_size += 4 + record_full_log[i].pc.len; + for (auto &entry : record_full_log[i].effects) switch (entry.type ()) { case record_full_reg: @@ -2708,12 +2708,12 @@ record_full_base_target::save_record (const char *recfilename) /* Save the entries to recfd and forward execute to the end of record list. */ - for (int i = 0; i < record_full_list.size (); i++) + for (int i = 0; i < record_full_log.size (); i++) { - record_full_list[i].to_bfd (obfd, osec, &bfd_offset, gdbarch); + record_full_log[i].to_bfd (obfd, osec, &bfd_offset, gdbarch); /* Execute entry. */ if (i < record_full_next_insn) - record_full_list[i].exec_insn (regcache); + record_full_log[i].exec_insn (regcache); } unlink_file.keep (); @@ -2740,10 +2740,10 @@ record_full_goto_insn (size_t target_insn, if (dir == EXEC_REVERSE) for (int i = record_full_next_insn; i > target_insn; i--) - record_full_list[i - 1].exec_insn (regcache); + record_full_log[i - 1].exec_insn (regcache); else for (int i = record_full_next_insn; i < target_insn; i++) - record_full_list[i].exec_insn (regcache); + record_full_log[i].exec_insn (regcache); } /* Alias for "target record-full". */ @@ -2758,10 +2758,10 @@ static void set_record_full_insn_max_num (const char *args, int from_tty, struct cmd_list_element *c) { - if (record_full_list.size () > record_full_insn_max_num) + if (record_full_log.size () > record_full_insn_max_num) { - while (record_full_list.size () > record_full_insn_max_num) - record_full_list_release_first (); + while (record_full_log.size () > record_full_insn_max_num) + record_full_log_release_first (); } } @@ -2770,21 +2770,21 @@ set_record_full_insn_max_num (const char *args, int from_tty, static void maintenance_print_record_instruction (const char *args, int from_tty) { - if (record_full_list.empty ()) + if (record_full_log.empty ()) error (_("Not enough recorded history")); int offset = record_full_next_insn - 1; /* Reduce the offset by 1 if the record_full_next_insn is after the end so that we show the last recorded instruction instead of crashing. */ - if (offset == record_full_list.size ()) + if (offset == record_full_log.size ()) offset--; if (args != nullptr) { offset += value_as_long (parse_and_eval (args)); - if (offset >= record_full_list.size () || offset < 0) + if (offset >= record_full_log.size () || offset < 0) error (_("Not enough recorded history")); } - auto to_print = record_full_list.begin () + offset; + auto to_print = record_full_log.begin () + offset; gdbarch *arch = current_inferior ()->arch (); struct value_print_options opts; -- 2.54.0