From: "Schimpe, Christina" <christina.schimpe@intel.com>
To: Guinevere Larsen <guinevere@redhat.com>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: [PATCH v3 6/6] gdb/record: rename record_full_list to record_full_log
Date: Fri, 29 May 2026 12:05:51 +0000 [thread overview]
Message-ID: <SN7PR11MB763802D3C605A6FB52374B81F9162@SN7PR11MB7638.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20260515163706.3355686-9-guinevere@redhat.com>
> -----Original Message-----
> From: Guinevere Larsen <guinevere@redhat.com>
> Sent: Freitag, 15. Mai 2026 18:37
> To: gdb-patches@sourceware.org
> Cc: Guinevere Larsen <guinevere@redhat.com>
> Subject: [PATCH v3 6/6] gdb/record: rename record_full_list to
> record_full_log
>
> 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.
> ---
> gdb/record-full.c | 120 +++++++++++++++++++++++-----------------------
> 1 file changed, 60 insertions(+), 60 deletions(-)
>
> diff --git a/gdb/record-full.c b/gdb/record-full.c index
> 055d2c66346..3c63753d24e 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)
> @@ -446,7 +446,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 @@
> -459,7 +459,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_instruction> record_full_list;
> +static std::deque<record_full_instruction> record_full_log;
> static record_full_instruction record_full_incomplete_instruction;
> static int record_full_next_insn;
>
> @@ -665,14 +665,14 @@ record_full_reset_history ()
> record_full_insn_count = 0;
> record_full_next_insn = 0;
>
> - record_full_list.clear ();
> + record_full_log.clear ();
> }
>
> static void
> -record_full_list_release_following (int index)
> +record_full_log_release_following (int index)
> {
> - 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;
> @@ -686,7 +686,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 ();
> @@ -696,12 +696,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;
> }
>
> @@ -765,7 +765,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)
> @@ -781,9 +781,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)
> @@ -821,8 +821,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)) @@ -847,8 +847,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
> @@ -1325,7 +1325,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
> {
> @@ -1339,14 +1339,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)
> @@ -1380,7 +1380,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) @@ -1395,10
> +1395,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. */
> @@ -1412,9 +1412,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);
> }
> @@ -1537,8 +1537,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. */ @@ -1587,7
> +1587,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); @@ -1620,7 +1620,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 */
> @@ -1639,8 +1639,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, @@ -
> 1796,11 +1796,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)
> {
> @@ -1862,16 +1862,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"), @@ -
> 1879,7 +1879,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")); @@ -1928,14
> +1928,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
> @@ -1966,7 +1966,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. */ @@ -2403,7 +2403,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"); @@ -
> 2454,9 +2454,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);
> }
> @@ -2634,16 +2634,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:
> @@ -2682,12 +2682,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 ();
> @@ -2714,10 +2714,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". */
> @@ -2732,10 +2732,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 ();
> }
> }
>
> @@ -2744,21 +2744,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
>
LGTM.
Reviewed-By: Christina Schimpe <christina.schimpe@intel.com>
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
next prev parent reply other threads:[~2026-05-29 12:06 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-15 16:36 [PATCH v3 0/7] refactor the internals of record-full Guinevere Larsen
2026-05-15 16:36 ` [PATCH v3 1/7] gdb/record: Refactor record history Guinevere Larsen
2026-05-26 8:33 ` Schimpe, Christina
2026-05-28 13:20 ` Guinevere Larsen
2026-05-29 13:47 ` Schimpe, Christina
2026-05-15 16:36 ` [PATCH v3 2/7] gdb/record: remove record_full_insn_num Guinevere Larsen
2026-05-26 8:35 ` Schimpe, Christina
2026-05-15 16:37 ` [PATCH v3 3/7] gdb/record: c++ify internal structures of record-full.c Guinevere Larsen
2026-05-26 9:00 ` Schimpe, Christina
2026-05-27 20:13 ` Guinevere Larsen
2026-05-29 12:09 ` Schimpe, Christina
2026-05-29 16:38 ` Guinevere Larsen
2026-05-15 16:37 ` [PATCH v3 4/7] gdb/record: make record_full_history more c++-like Guinevere Larsen
2026-05-16 1:03 ` Thiago Jung Bauermann
2026-05-26 9:04 ` Schimpe, Christina
2026-05-26 20:07 ` Guinevere Larsen
2026-05-15 16:37 ` [PATCH v3 5/6] gdb/record: Define new version of the record-save section Guinevere Larsen
2026-05-15 16:37 ` [PATCH v3 5/7] gdb/record: extract the PC to record_full_instruction Guinevere Larsen
2026-05-16 1:04 ` Thiago Jung Bauermann
2026-05-29 12:40 ` Schimpe, Christina
2026-06-01 20:24 ` Guinevere Larsen
2026-05-15 16:37 ` [PATCH v3 6/7] gdb/record: Define new version of the record-save section Guinevere Larsen
2026-05-15 16:37 ` [PATCH v3 6/6] gdb/record: rename record_full_list to record_full_log Guinevere Larsen
2026-05-29 12:05 ` Schimpe, Christina [this message]
2026-05-15 16:37 ` [PATCH v3 7/7] " Guinevere Larsen
2026-05-16 1:07 ` Thiago Jung Bauermann
2026-05-15 17:45 ` [PATCH v3 0/7] refactor the internals of record-full Guinevere Larsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=SN7PR11MB763802D3C605A6FB52374B81F9162@SN7PR11MB7638.namprd11.prod.outlook.com \
--to=christina.schimpe@intel.com \
--cc=gdb-patches@sourceware.org \
--cc=guinevere@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox