]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
GDB: frame: Make VALUEP argument optional in frame_register_unwind
authorThiago Jung Bauermann <thiago.bauermann@linaro.org>
Fri, 10 Jan 2025 00:43:10 +0000 (21:43 -0300)
committerThiago Jung Bauermann <thiago.bauermann@linaro.org>
Fri, 10 Jan 2025 21:52:04 +0000 (18:52 -0300)
It already accepts a nullptr value and a couple of places were always
calling it that way, so make it possible to omit the argument entirely.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
gdb/frame.c
gdb/frame.h
gdb/stack.c

index a6900b280724a0fdc77611b5076b033553fbe6c2..ba4a07179f64bf20bdcd7ef11029dc7d52d5ddca 100644 (file)
@@ -1447,7 +1447,7 @@ put_frame_register (const frame_info_ptr &next_frame, int regnum,
   gdb_assert (buf.size () == size);
 
   frame_register_unwind (next_frame, regnum, &optim, &unavail, &lval, &addr,
-                        &realnum, nullptr);
+                        &realnum);
   if (optim)
     error (_("Attempt to assign to a register that was not saved."));
   switch (lval)
@@ -2159,7 +2159,7 @@ frame_register_unwind_location (const frame_info_ptr &initial_this_frame,
       int unavailable;
 
       frame_register_unwind (this_frame, regnum, optimizedp, &unavailable,
-                            lvalp, addrp, realnump, NULL);
+                            lvalp, addrp, realnump);
 
       if (*optimizedp)
        break;
index 9b41dd958fa4e2d3baad921edfb56f9ac4bf26ea..b265c9bc5bb3bd828aeebb64875180eb8415c948 100644 (file)
@@ -685,14 +685,14 @@ const char *unwind_stop_reason_to_string (enum unwind_stop_reason);
 const char *frame_stop_reason_string (const frame_info_ptr &);
 
 /* Unwind the stack frame so that the value of REGNUM, in the previous
-   (up, older) frame is returned.  If VALUEP is NULL, don't
+   (up, older) frame is returned.  If VALUEP is nullptr, don't
    fetch/compute the value.  Instead just return the location of the
    value.  */
 extern void frame_register_unwind (const frame_info_ptr &frame, int regnum,
                                   int *optimizedp, int *unavailablep,
                                   enum lval_type *lvalp,
                                   CORE_ADDR *addrp, int *realnump,
-                                  gdb_byte *valuep);
+                                  gdb_byte *valuep = nullptr);
 
 /* Fetch a register from this, or unwind a register from the next
    frame.  Note that the get_frame methods are wrappers to
index 73165c801343d87a6f1aa114f99c4e41148c3bce..2d6712ab16ba74cf5a560ec9a8611976f72df72e 100644 (file)
@@ -1750,7 +1750,7 @@ info_frame_command_core (const frame_info_ptr &fi, bool selected_frame_p)
          /* Find out the location of the saved register without
             fetching the corresponding value.  */
          frame_register_unwind (fi, i, &optimized, &unavailable,
-                                &lval, &addr, &realnum, NULL);
+                                &lval, &addr, &realnum);
          /* For moment, only display registers that were saved on the
             stack.  */
          if (!optimized && !unavailable && lval == lval_memory)