]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb] Drop nullptr in "get_selected_frame (nullptr)"
authorTom de Vries <tdevries@suse.de>
Fri, 5 Jun 2026 21:06:48 +0000 (23:06 +0200)
committerTom de Vries <tdevries@suse.de>
Fri, 5 Jun 2026 21:06:48 +0000 (23:06 +0200)
I came across "get_selected_frame (nullptr)", and realized nullptr is the
default argument, so this can be simplified to "get_selected_frame ()".

Do so using the following script:
...
$ find gdb* -type f -name "*.[ch]" -o -name "*.cc" \
    | xargs sed -i 's/get_selected_frame (nullptr)/get_selected_frame ()/'
...
and likewise for "get_selected_frame (NULL)".

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
31 files changed:
gdb/ada-lang.c
gdb/ada-tasks.c
gdb/arch-utils.c
gdb/breakpoint.c
gdb/bsd-kvm.c
gdb/cli/cli-cmds.c
gdb/compile/compile-c-symbols.c
gdb/compile/compile-cplus-symbols.c
gdb/compile/compile-loc2c.c
gdb/compile/compile.c
gdb/corelow.c
gdb/dwarf2/loc.c
gdb/eval.c
gdb/frame.c
gdb/infcmd.c
gdb/infrun.c
gdb/language.c
gdb/mi/mi-cmd-stack.c
gdb/mi/mi-interp.c
gdb/mi/mi-main.c
gdb/namespace.c
gdb/printcmd.c
gdb/record-btrace.c
gdb/record-full.c
gdb/stack.c
gdb/thread.c
gdb/tracepoint.c
gdb/tui/tui-hooks.c
gdb/tui/tui-regs.c
gdb/tui/tui-source.c
gdb/varobj.c

index cb741647d47149a6b9f34ddd85f7fd7c346e9f3f..bb044e2c5a078426907bb02c8a5a503b51b5803f 100644 (file)
@@ -13167,7 +13167,7 @@ ada_exceptions_list_1 (compiled_regex *preg)
   if (has_stack_frames ())
     {
       prev_len = result.size ();
-      ada_add_exceptions_from_frame (preg, get_selected_frame (NULL),
+      ada_add_exceptions_from_frame (preg, get_selected_frame (),
                                     &result);
       if (result.size () > prev_len)
        sort_remove_dups_ada_exceptions_list (&result, prev_len);
index 6bd6600b8025bab23b60b50588fc8aa663b124dd..f55afcc915d98806c474272a9ac939a78eeaa1ac 100644 (file)
@@ -1382,11 +1382,11 @@ task_command_1 (const char *taskno_str, int from_tty, struct inferior *inf)
           task_to_str (taskno, task_info).c_str ());
 
   switch_to_thread (tp);
-  ada_find_printable_frame (get_selected_frame (NULL));
+  ada_find_printable_frame (get_selected_frame ());
   gdb_printf (_("[Switching to task %s]\n"),
              task_to_str (taskno, task_info).c_str ());
-  print_stack_frame (get_selected_frame (NULL),
-                    frame_relative_level (get_selected_frame (NULL)),
+  print_stack_frame (get_selected_frame (),
+                    frame_relative_level (get_selected_frame ()),
                     SRC_AND_LOC, 1);
 }
 
index 5e15fa5b4344356380362e4d5cfa0e891787dc8e..e959788bd3b471c46e9dd32642c63d8f517bd2c3 100644 (file)
@@ -844,7 +844,7 @@ struct gdbarch *
 get_current_arch (void)
 {
   if (has_stack_frames ())
-    return get_frame_arch (get_selected_frame (NULL));
+    return get_frame_arch (get_selected_frame ());
   else
     return current_inferior ()->arch ();
 }
index 101dc57ee6bbaa5b0829012204680e524d754a76..199b52433b32430be24d722c2951fb6579547076 100644 (file)
@@ -2295,7 +2295,7 @@ update_watchpoint (struct watchpoint *b, bool reparse)
       if (b->exp_valid_block == nullptr)
        wp_pspace = current_program_space;
       else
-       wp_pspace = get_frame_program_space (get_selected_frame (NULL));
+       wp_pspace = get_frame_program_space (get_selected_frame ());
 
       /* Look at each value on the value chain.  */
       gdb_assert (!val_chain.empty ());
@@ -10981,7 +10981,7 @@ until_break_command (const char *arg, int from_tty, int anywhere)
      may need to switch threads), so do any frame handling before
      that.  */
 
-  frame = get_selected_frame (NULL);
+  frame = get_selected_frame ();
   frame_gdbarch = get_frame_arch (frame);
   stack_frame_id = get_stack_frame_id (frame);
   caller_frame_id = frame_unwind_caller_id (frame);
index ca7aed7ec420965a3869b3ee45c4b3fd714341a5..3cf217b88a41a9520610fcf69a6569a8426011b7 100644 (file)
@@ -137,7 +137,7 @@ bsd_kvm_target_open (const char *arg, int from_tty)
   target_fetch_registers (get_thread_regcache (thr), -1);
 
   reinit_frame_cache ();
-  print_stack_frame (get_selected_frame (NULL), 0, SRC_AND_LOC, 1);
+  print_stack_frame (get_selected_frame (), 0, SRC_AND_LOC, 1);
 }
 
 void
@@ -335,7 +335,7 @@ bsd_kvm_proc_cmd (const char *arg, int fromtty)
   target_fetch_registers (get_thread_regcache (inferior_thread ()), -1);
 
   reinit_frame_cache ();
-  print_stack_frame (get_selected_frame (NULL), 0, SRC_AND_LOC, 1);
+  print_stack_frame (get_selected_frame (), 0, SRC_AND_LOC, 1);
 }
 
 #endif
@@ -355,7 +355,7 @@ bsd_kvm_pcb_cmd (const char *arg, int fromtty)
   target_fetch_registers (get_thread_regcache (inferior_thread ()), -1);
 
   reinit_frame_cache ();
-  print_stack_frame (get_selected_frame (NULL), 0, SRC_AND_LOC, 1);
+  print_stack_frame (get_selected_frame (), 0, SRC_AND_LOC, 1);
 }
 
 bool
index 63f5a6376978934ff8a908c76c95ab8b3c703c8c..3abb2f136ec5d2bc2bfbe62f1406238b00e72bb1 100644 (file)
@@ -1310,7 +1310,7 @@ list_command (const char *arg, int from_tty)
            {
              /* Find the current line by getting the PC of the currently
                 selected frame, and finding the line associated to it.  */
-             frame_info_ptr frame = get_selected_frame (nullptr);
+             frame_info_ptr frame = get_selected_frame ();
              CORE_ADDR curr_pc = get_frame_pc (frame);
              cursal = find_sal_for_pc (curr_pc, 0);
 
index dc0487d8f82f1c509f026ca216ace44b5aba3b62..09bf22bacff9fa03686397f474607a4d20c2f4dc 100644 (file)
@@ -147,7 +147,7 @@ convert_one_symbol (compile_c_instance *context,
 
            if (symbol_read_needs_frame (sym.symbol))
              {
-               frame = get_selected_frame (NULL);
+               frame = get_selected_frame ();
                if (frame == NULL)
                  error (_("Symbol \"%s\" cannot be used because "
                           "there is no selected frame"),
index bc582ffb51116ad42ff2a2cbb4c0badf7cc62ca7..779e66d30730ef611c7ea6e195f36b4186989b9d 100644 (file)
@@ -143,7 +143,7 @@ convert_one_symbol (compile_cplus_instance *instance,
 
            if (symbol_read_needs_frame (sym.symbol))
              {
-               frame = get_selected_frame (nullptr);
+               frame = get_selected_frame ();
                if (frame == nullptr)
                  error (_("Symbol \"%s\" cannot be used because "
                           "there is no selected frame"),
index 9f189ef1cc79431de082d6a838c19cd80ee0bea2..5e208a8656328fbff901dbcd25989ace20e88001 100644 (file)
@@ -632,7 +632,7 @@ do_compile_dwarf_expr_to_c (int indent, string_file *stream,
      offset by hand seemed too hackish.  */
   if (is_tls)
     {
-      frame_info_ptr frame = get_selected_frame (NULL);
+      frame_info_ptr frame = get_selected_frame ();
       struct value *val;
 
       if (frame == NULL)
index c0b548fefd8f60c11e9b9e08407be2d59761445c..b52859b4bc8aaa4eeb8cf7be034b0fde3cd5dede 100644 (file)
@@ -437,7 +437,7 @@ show_compile_gcc (struct ui_file *file, int from_tty,
 static const char *
 get_selected_pc_producer_options (void)
 {
-  CORE_ADDR pc = get_frame_pc (get_selected_frame (NULL));
+  CORE_ADDR pc = get_frame_pc (get_selected_frame ());
   struct compunit_symtab *symtab = find_compunit_symtab_for_pc (pc);
   const char *cs;
 
@@ -584,7 +584,7 @@ compile_to_object (struct command_line *cmd, const char *cmd_string,
             "work."));
 
   expr_block = get_expr_block_and_pc (&trash_pc);
-  expr_pc = get_frame_address_in_block (get_selected_frame (NULL));
+  expr_pc = get_frame_address_in_block (get_selected_frame ());
 
   /* Set up instance and context for the compiler.  */
   std::unique_ptr<compile_instance> compiler
index 819e7cae6f98a6568e815bd1765a2f7bfb8c41fe..d5a724ab551e6c266ddba0849e74cef9fdcf5429 100644 (file)
@@ -1252,7 +1252,7 @@ core_target_open (const char *arg, int from_tty)
 
   /* Now, set up the frame cache, and print the top of stack.  */
   reinit_frame_cache ();
-  print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC, 1);
+  print_stack_frame (get_selected_frame (), 1, SRC_AND_LOC, 1);
 
   /* Current thread should be NUM 1 but the user does not know that.
      If a program is single threaded gdb in general does not mention
index 5bf863e13d53e8f1659c4fe6beab0150de485ab0..8e2b401ba34c33a92c69bcd9788b978dfda3b648 100644 (file)
@@ -1639,7 +1639,7 @@ dwarf2_evaluate_property (const dynamic_prop *prop,
   frame_info_ptr frame = initial_frame;
 
   if (frame == NULL && has_stack_frames ())
-    frame = get_selected_frame (NULL);
+    frame = get_selected_frame ();
 
   switch (prop->kind ())
     {
index a00774bda3dd99cdf2884743eac008d951972b71..7e07765c9e6cb073823875f88d355f9c8cb7b42b 100644 (file)
@@ -1088,7 +1088,7 @@ eval_op_var_entry_value (struct type *expect_type, struct expression *exp,
     error (_("Symbol \"%s\" does not have any specific entry value"),
           sym->print_name ());
 
-  frame_info_ptr frame = get_selected_frame (NULL);
+  frame_info_ptr frame = get_selected_frame ();
   return computed_ops->read_variable_at_entry (sym, frame);
 }
 
index 179e251eb1f2178c9c7510164a281a3568b72885..f64f5554f8c2cd3d74a6a1586edf4a4976d76ef7 100644 (file)
@@ -1975,7 +1975,7 @@ deprecated_safe_get_selected_frame (void)
 {
   if (!has_stack_frames ())
     return NULL;
-  return get_selected_frame (NULL);
+  return get_selected_frame ();
 }
 
 /* Invalidate the selected frame.  */
index f3f15c9ae1d057c2767b6de9778ae7cf4550a52b..bd5dbb02f48547085067247350c08fb7fc84e581 100644 (file)
@@ -1817,7 +1817,7 @@ finish_backward (struct finish_command_fsm *sm)
   CORE_ADDR func_addr;
   CORE_ADDR alt_entry_point;
   CORE_ADDR entry_point;
-  frame_info_ptr frame = get_selected_frame (nullptr);
+  frame_info_ptr frame = get_selected_frame ();
   struct gdbarch *gdbarch = get_frame_arch (frame);
 
   pc = get_frame_pc (get_current_frame ());
@@ -1983,7 +1983,7 @@ finish_command (const char *arg, int from_tty)
       if (from_tty)
        {
          gdb_printf (_("Run till exit from "));
-         print_stack_frame (get_selected_frame (nullptr), 1, LOCATION, 0);
+         print_stack_frame (get_selected_frame (), 1, LOCATION, 0);
        }
 
       proceed ((CORE_ADDR) -1, GDB_SIGNAL_DEFAULT);
@@ -1991,7 +1991,7 @@ finish_command (const char *arg, int from_tty)
     }
 
   /* Find the function we will return from.  */
-  frame_info_ptr callee_frame = get_selected_frame (nullptr);
+  frame_info_ptr callee_frame = get_selected_frame ();
   sm->function = find_symbol_for_pc (get_frame_pc (callee_frame));
   sm->return_buf = 0;    /* Initialize buffer address is not available.  */
 
@@ -2523,7 +2523,7 @@ registers_info (const char *addr_exp, bool fpregs)
 
   if (!target_has_registers ())
     error (_("The program has no registers now."));
-  frame = get_selected_frame (nullptr);
+  frame = get_selected_frame ();
   gdbarch = get_frame_arch (frame);
 
   if (!addr_exp)
@@ -2660,7 +2660,7 @@ info_vector_command (const char *args, int from_tty)
   if (!target_has_registers ())
     error (_("The program has no registers now."));
 
-  print_vector_info (gdb_stdout, get_selected_frame (nullptr), args);
+  print_vector_info (gdb_stdout, get_selected_frame (), args);
 }
 \f
 /* Kill the inferior process.  Make us have no inferior.  */
@@ -3197,7 +3197,7 @@ info_float_command (const char *args, int from_tty)
   if (!target_has_registers ())
     error (_("The program has no registers now."));
 
-  frame = get_selected_frame (nullptr);
+  frame = get_selected_frame ();
   gdbarch_print_float_info (get_frame_arch (frame), gdb_stdout, frame, args);
 }
 \f
index 11c5d5214d647854654244f65d21763356a66987..22a0560848613b05d524a6ad9266f34121b88be6 100644 (file)
@@ -9457,7 +9457,7 @@ print_stop_location (const target_waitstatus &ws)
   /* Function bpstat_print selects the frame to print.  Typically, that is the
      stop frame, in other words get_current_frame ().  But bpstat_print may
      select a different frame, see for instance ada_catchpoint::print_it.  */
-  frame_info_ptr print_frame = get_selected_frame (nullptr);
+  frame_info_ptr print_frame = get_selected_frame ();
 
  switch (bpstat_ret)
     {
index 439ef293622df146aefcd83c1a1d322a8b39dd70..312135770526b78602a2d2570e0519664eafb24e 100644 (file)
@@ -174,7 +174,7 @@ show_language_command (struct ui_file *file, int from_tty,
     {
       frame_info_ptr frame;
 
-      frame = get_selected_frame (NULL);
+      frame = get_selected_frame ();
       flang = get_frame_language (frame);
       if (flang != language_unknown
          && language_mode == language_mode_manual
@@ -200,7 +200,7 @@ set_language (const char *language)
        {
          frame_info_ptr frame;
 
-         frame = get_selected_frame (NULL);
+         frame = get_selected_frame ();
          flang = get_frame_language (frame);
        }
       catch (const gdb_exception_error &ex)
index 3281be2b4dcc60a6a0a4b5b506ebd96f4811862a..280a08d121e215dd87e5be679e31ab472ab5e551 100644 (file)
@@ -262,7 +262,7 @@ mi_cmd_stack_list_locals (const char *command, const char *const *argv,
     error (_("-stack-list-locals: Usage: [--no-frame-filters] "
             "[--skip-unavailable] PRINT_VALUES"));
 
-  frame = get_selected_frame (NULL);
+  frame = get_selected_frame ();
   print_value = mi_parse_print_values (argv[oind]);
 
    if (! raw_arg && frame_filters)
@@ -456,7 +456,7 @@ mi_cmd_stack_list_variables (const char *command, const char *const *argv,
     error (_("-stack-list-variables: Usage: [--no-frame-filters] " \
             "[--skip-unavailable] PRINT_VALUES"));
 
-   frame = get_selected_frame (NULL);
+   frame = get_selected_frame ();
    print_value = mi_parse_print_values (argv[oind]);
 
    if (! raw_arg && frame_filters)
@@ -762,5 +762,5 @@ mi_cmd_stack_info_frame (const char *command, const char *const *argv,
     error (_("-stack-info-frame: No arguments allowed"));
 
   print_frame_info (user_frame_print_options,
-                   get_selected_frame (NULL), 1, LOC_AND_ADDRESS, 0, 1);
+                   get_selected_frame (), 1, LOC_AND_ADDRESS, 0, 1);
 }
index 8b3048c5a46cc906a4fd7aeb28266d4a6ea95eb5..1a0d34106ed123c2ddf0c322ecb91333e7ea63c5 100644 (file)
@@ -861,7 +861,7 @@ mi_interp::on_user_selected_context_changed (user_selected_what selection)
       if (tp->state () != THREAD_RUNNING)
        {
          if (has_stack_frames ())
-           print_stack_frame_to_uiout (mi_uiout, get_selected_frame (NULL),
+           print_stack_frame_to_uiout (mi_uiout, get_selected_frame (),
                                        1, SRC_AND_LOC, 1);
        }
     }
index 52e642e1464404863f681510247cc1d2c23ff076..73c64b821860fb2b81d894020f04954b758b86cb 100644 (file)
@@ -225,7 +225,7 @@ mi_cmd_exec_return (const char *command, const char *const *argv, int argc)
 
   /* Because we have called return_command with from_tty = 0, we need
      to print the frame here.  */
-  print_stack_frame (get_selected_frame (NULL), 1, LOC_AND_ADDRESS, 1);
+  print_stack_frame (get_selected_frame (), 1, LOC_AND_ADDRESS, 1);
 }
 
 void
@@ -880,7 +880,7 @@ mi_cmd_data_list_changed_registers (const char *command,
      contents.  */
 
   prev_regs = std::move (this_regs);
-  this_regs = frame_save_as_regcache (get_selected_frame (NULL));
+  this_regs = frame_save_as_regcache (get_selected_frame ());
 
   /* Note that the test for a valid register must include checking the
      gdbarch_register_name because gdbarch_num_regs may be allocated
@@ -1014,7 +1014,7 @@ mi_cmd_data_list_register_values (const char *command, const char *const *argv,
 
   format = (int) argv[oind][0];
 
-  frame = get_selected_frame (NULL);
+  frame = get_selected_frame ();
   gdbarch = get_frame_arch (frame);
   numregs = gdbarch_num_cooked_regs (gdbarch);
 
@@ -2388,7 +2388,7 @@ mi_cmd_trace_find (const char *command, const char *const *argv, int argc)
     error (_("Invalid mode '%s'"), mode);
 
   if (has_stack_frames () || get_traceframe_number () >= 0)
-    print_stack_frame (get_selected_frame (NULL), 1, LOC_AND_ADDRESS, 1);
+    print_stack_frame (get_selected_frame (), 1, LOC_AND_ADDRESS, 1);
 }
 
 void
@@ -2630,7 +2630,7 @@ mi_cmd_trace_frame_collected (const char *command, const char *const *argv,
 
     ui_out_emit_list list_emitter (uiout, "registers");
 
-    frame = get_selected_frame (NULL);
+    frame = get_selected_frame ();
     gdbarch = get_frame_arch (frame);
     numregs = gdbarch_num_cooked_regs (gdbarch);
 
index 5b5749369eebc4980a7fcdd791531086b7cbad51..e67ddc5efa7397dcc31c90781d8aac5a5e0161d0 100644 (file)
@@ -111,7 +111,7 @@ using_direct::valid_line (unsigned int boundary) const
 {
   try
     {
-      CORE_ADDR curr_pc = get_frame_pc (get_selected_frame (nullptr));
+      CORE_ADDR curr_pc = get_frame_pc (get_selected_frame ());
       symtab_and_line curr_sal = find_sal_for_pc (curr_pc, 0);
       return (decl_line <= curr_sal.line)
             || (decl_line >= boundary);
index ae4983954362588184b3780921f73ae97cc6867f..0485670c4b2195b311c9a6411f12728f03293260 100644 (file)
@@ -750,7 +750,7 @@ pc_prefix (CORE_ADDR addr)
       frame_info_ptr frame;
       std::optional<CORE_ADDR> pc;
 
-      frame = get_selected_frame (NULL);
+      frame = get_selected_frame ();
       if ((pc = get_frame_pc_if_available (frame)) && *pc == addr)
        return "=> ";
     }
index b4f1dcc3dea812bf93d7ae4d769bd876b98bdfd6..4bd755b24f24baed583f9372bb1bf925fa0d13be 100644 (file)
@@ -2799,7 +2799,7 @@ record_btrace_set_replay (struct thread_info *tp,
   record_btrace_clear_histories (btinfo);
 
   tp->set_stop_pc (regcache_read_pc (get_thread_regcache (tp)));
-  print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC, 1);
+  print_stack_frame (get_selected_frame (), 1, SRC_AND_LOC, 1);
 }
 
 /* The goto_record_begin method of target record-btrace.  */
index 69d2c100e57d3db0867c226aec5c88cdd93b0669..bd3ea7ef962c292fc5b46443d2b5d93782eac090 100644 (file)
@@ -2025,7 +2025,7 @@ record_full_goto_entry (struct record_full_entry *p)
 
   thread_info *thr = inferior_thread ();
   thr->set_stop_pc (regcache_read_pc (get_thread_regcache (thr)));
-  print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC, 1);
+  print_stack_frame (get_selected_frame (), 1, SRC_AND_LOC, 1);
 }
 
 /* The "goto_record_begin" target method.  */
@@ -2509,7 +2509,7 @@ record_full_restore (struct bfd &cbfd)
   gdb_printf (_("Restored records from core file %s.\n"),
              bfd_get_filename (&cbfd));
 
-  print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC, 1);
+  print_stack_frame (get_selected_frame (), 1, SRC_AND_LOC, 1);
 }
 
 /* bfdcore_write -- write bytes into a core file section.  */
index 7329430adab4288b1dafbf7a834a374b0d187beb..e084976eabfaf20344d6594ee755a31b168a705e 100644 (file)
@@ -2471,7 +2471,7 @@ get_selected_block (CORE_ADDR *addr_in_block)
   if (!has_stack_frames ())
     return 0;
 
-  return get_frame_block (get_selected_frame (NULL), addr_in_block);
+  return get_frame_block (get_selected_frame (), addr_in_block);
 }
 
 /* Find a frame a certain number of levels away from FRAME.
@@ -2702,7 +2702,7 @@ return_command (const char *retval_exp, int from_tty)
     }
 
   /* Discard the selected frame and all frames inner-to it.  */
-  frame_pop (get_selected_frame (NULL));
+  frame_pop (get_selected_frame ());
 
   /* Store RETURN_VALUE in the just-returned register set.  */
   if (return_value != NULL)
@@ -2726,7 +2726,7 @@ return_command (const char *retval_exp, int from_tty)
   select_frame (get_current_frame ());
   /* If interactive, print the frame that is now current.  */
   if (from_tty)
-    print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC, 1);
+    print_stack_frame (get_selected_frame (), 1, SRC_AND_LOC, 1);
 }
 
 /* Find the most inner frame in the current stack for a function called
index 110e58a70aaec2595bdbe702fea6c3dd1e9d6ca9..96c733e0629b9d99fb2ac5e34c886b1d9a574163 100644 (file)
@@ -1243,7 +1243,7 @@ do_print_thread (ui_out *uiout, const char *requested_threads,
     {
       /* The switch above put us at the top of the stack (leaf
         frame).  */
-      print_stack_frame (get_selected_frame (NULL),
+      print_stack_frame (get_selected_frame (),
                         /* For MI output, print frame level.  */
                         uiout->is_mi_like_p (),
                         LOCATION, 0);
@@ -2163,7 +2163,7 @@ print_selected_thread_frame (struct ui_out *uiout,
        uiout->text ("\n");
 
       if (has_stack_frames ())
-       print_stack_frame_to_uiout (uiout, get_selected_frame (NULL),
+       print_stack_frame_to_uiout (uiout, get_selected_frame (),
                                    1, SRC_AND_LOC, 1);
     }
 }
index 7f078684b14200bb36c7e4e0311761a43520706a..798bb9a552d8bce977bfa2aa2f2f793f0dc1c8ee 100644 (file)
@@ -2188,7 +2188,7 @@ tfind_1 (enum trace_find_type type, int num,
       else
        print_what = SRC_AND_LOC;
 
-      print_stack_frame (get_selected_frame (NULL), 1, print_what, 1);
+      print_stack_frame (get_selected_frame (), 1, print_what, 1);
       do_displays ();
     }
 }
index 17ae8e7a590d02081c088b06ec2a748b4e52fc4f..f3d3cbe87a687314fe1390f671de76a24e0a996d 100644 (file)
@@ -59,7 +59,7 @@ tui_register_changed (const frame_info_ptr &frame, int regno)
      And even if the frames differ a register change made in one can still show
      up in the other.  So we always use the selected frame here, and ignore
      FRAME.  */
-  fi = get_selected_frame (NULL);
+  fi = get_selected_frame ();
   tui_data_win ()->check_register_values (fi);
 }
 
@@ -114,7 +114,7 @@ tui_refresh_frame_and_register_information ()
       frame_info_ptr fi;
       if (has_stack_frames ())
        {
-         fi = get_selected_frame (NULL);
+         fi = get_selected_frame ();
 
          /* Display the frame position (even if there is no symbols or
             the PC is not known).  */
index 28f0d8b82d4217730d345b1276cf1e42aa65b656..3e2e0745993ec8d6259c4a89670d85c6d96f5ce2 100644 (file)
@@ -143,7 +143,7 @@ tui_data_window::update_register_data (const reggroup *group)
   if (group == nullptr)
     group = general_reggroup;
 
-  frame_info_ptr frame = get_selected_frame (nullptr);
+  frame_info_ptr frame = get_selected_frame ();
   struct gdbarch *gdbarch = get_frame_arch (frame);
 
   if (m_current_group == group && m_gdbarch == gdbarch)
index 85b754730c8fa71c0d8bd7b2222fba89df0abe28..783d4b2a1c24182e43ea6b113f3f1970a7c2cb7c 100644 (file)
@@ -158,7 +158,7 @@ tui_source_window::do_scroll_vertical (int num_to_scroll)
 
       if (cursal.symtab == NULL)
        {
-         frame_info_ptr fi = get_selected_frame (NULL);
+         frame_info_ptr fi = get_selected_frame ();
          s = find_symtab_for_pc (get_frame_pc (fi));
          arch = get_frame_arch (fi);
        }
index edd94ea49630c0eda7eace7a1b54f643edc155a3..0cd3ba90a9151e01076d454842d8bbb7372f2335 100644 (file)
@@ -276,7 +276,7 @@ varobj_create (const char *objname,
        {
          /* Allow creator to specify context of variable.  */
          if ((type == USE_CURRENT_FRAME) || (type == USE_SELECTED_FRAME))
-           fi = get_selected_frame (NULL);
+           fi = get_selected_frame ();
          else
            /* FIXME: cagney/2002-11-23: This code should be doing a
               lookup using the frame ID and not just the frame's
@@ -354,7 +354,7 @@ varobj_create (const char *objname,
 
          var->root->frame = get_frame_id (fi);
          var->root->thread_id = inferior_thread ()->global_num;
-         old_id = get_frame_id (get_selected_frame (NULL));
+         old_id = get_frame_id (get_selected_frame ());
          select_frame (fi);
        }