Delete unnecessary code from kill_command
[deliverable/binutils-gdb.git] / gdb / infcmd.c
index 465d3a10e5952be82b5776e13615c38679a8eebb..aea977f492cd68d18f46d1599de35134a48ba4df 100644 (file)
@@ -1,6 +1,6 @@
 /* Memory-access and commands for "inferior" process, for GDB.
 
-   Copyright (C) 1986-2019 Free Software Foundation, Inc.
+   Copyright (C) 1986-2020 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -19,7 +19,6 @@
 
 #include "defs.h"
 #include "arch-utils.h"
-#include <signal.h>
 #include "symtab.h"
 #include "gdbtypes.h"
 #include "frame.h"
@@ -35,8 +34,6 @@
 #include "objfiles.h"
 #include "completer.h"
 #include "ui-out.h"
-#include "event-top.h"
-#include "parser-defs.h"
 #include "regcache.h"
 #include "reggroups.h"
 #include "block.h"
@@ -45,7 +42,6 @@
 #include "observable.h"
 #include "target-descriptions.h"
 #include "user-regs.h"
-#include "cli/cli-decode.h"
 #include "gdbthread.h"
 #include "valprint.h"
 #include "inline-frame.h"
 #include "inf-loop.h"
 #include "continuations.h"
 #include "linespec.h"
-#include "cli/cli-utils.h"
-#include "infcall.h"
 #include "thread-fsm.h"
 #include "top.h"
 #include "interps.h"
+#include "skip.h"
 #include "gdbsupport/gdb_optional.h"
 #include "source.h"
 #include "cli/cli-style.h"
@@ -1112,14 +1107,29 @@ prepare_one_step (struct step_command_fsm *sm)
              && inline_skipped_frames (tp))
            {
              ptid_t resume_ptid;
+             const char *fn = NULL;
+             symtab_and_line sal;
+             struct symbol *sym;
 
              /* Pretend that we've ran.  */
              resume_ptid = user_visible_resume_ptid (1);
              set_running (resume_ptid, 1);
 
              step_into_inline_frame (tp);
-             sm->count--;
-             return prepare_one_step (sm);
+
+             frame = get_current_frame ();
+             sal = find_frame_sal (frame);
+             sym = get_frame_function (frame);
+
+             if (sym != NULL)
+               fn = sym->print_name ();
+
+             if (sal.line == 0
+                 || !function_name_is_marked_for_skip (fn, sal))
+               {
+                 sm->count--;
+                 return prepare_one_step (sm);
+               }
            }
 
          pc = get_frame_pc (frame);
@@ -1216,7 +1226,7 @@ jump_command (const char *arg, int from_tty)
   if (fn != NULL && sfn != fn)
     {
       if (!query (_("Line %d is not in `%s'.  Jump anyway? "), sal.line,
-                 SYMBOL_PRINT_NAME (fn)))
+                 fn->print_name ()))
        {
          error (_("Not confirmed."));
          /* NOTREACHED */
@@ -1945,7 +1955,7 @@ finish_command (const char *arg, int from_tty)
          if (sm->function != NULL && TYPE_NO_RETURN (sm->function->type)
              && !query (_("warning: Function %s does not return normally.\n"
                           "Try to finish anyway? "),
-                        SYMBOL_PRINT_NAME (sm->function)))
+                        sm->function->print_name ()))
            error (_("Not confirmed."));
          printf_filtered (_("Run till exit from "));
        }
@@ -2222,7 +2232,7 @@ default_print_one_register_info (struct ui_file *file,
     {
       struct value_print_options opts;
       const gdb_byte *valaddr = value_contents_for_printing (val);
-      enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (regtype));
+      enum bfd_endian byte_order = type_byte_order (regtype);
 
       get_user_print_options (&opts);
       opts.deref_ref = 1;
@@ -2501,20 +2511,6 @@ kill_command (const char *arg, int from_tty)
     printf_unfiltered (_("[Inferior %d (%s) killed]\n"),
                       infnum, pid_str.c_str ());
 
-  /* If we still have other inferiors to debug, then don't mess with
-     with their threads.  */
-  if (!have_inferiors ())
-    {
-      init_thread_list ();             /* Destroy thread info.  */
-
-      /* Killing off the inferior can leave us with a core file.  If
-        so, print the state we are left in.  */
-      if (target_has_stack)
-       {
-         printf_filtered (_("In %s,\n"), target_longname);
-         print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC, 1);
-       }
-    }
   bfd_cache_close_all ();
 }
 
This page took 0.026582 seconds and 4 git commands to generate.