ODR warning for "enum string_repr_result"
[binutils-gdb.git] / gdb / inf-child.c
index 5e821f4559825030db9f3376e970181b84ad5ff3..56ebd2a5549cadbb910446ba0b27b748328750be 100644 (file)
@@ -1,6 +1,6 @@
 /* Base/prototype target for default child (native) targets.
 
-   Copyright (C) 1988-2021 Free Software Foundation, Inc.
+   Copyright (C) 1988-2022 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -51,18 +51,19 @@ inf_child_target::info () const
   return inf_child_target_info;
 }
 
-/* Helper function for child_wait and the derivatives of child_wait.
-   HOSTSTATUS is the waitstatus from wait() or the equivalent; store our
-   translation of that in OURSTATUS.  */
-void
-store_waitstatus (struct target_waitstatus *ourstatus, int hoststatus)
+/* See inf-child.h.  */
+
+target_waitstatus
+host_status_to_waitstatus (int hoststatus)
 {
   if (WIFEXITED (hoststatus))
-    ourstatus->set_exited (WEXITSTATUS (hoststatus));
+    return target_waitstatus ().set_exited (WEXITSTATUS (hoststatus));
   else if (!WIFSTOPPED (hoststatus))
-    ourstatus->set_signalled (gdb_signal_from_host (WTERMSIG (hoststatus)));
+    return target_waitstatus ().set_signalled
+      (gdb_signal_from_host (WTERMSIG (hoststatus)));
   else
-    ourstatus->set_stopped (gdb_signal_from_host (WSTOPSIG (hoststatus)));
+    return target_waitstatus ().set_stopped
+      (gdb_signal_from_host (WSTOPSIG (hoststatus)));
 }
 
 inf_child_target::~inf_child_target ()
@@ -160,7 +161,7 @@ inf_child_open_target (const char *arg, int from_tty)
   current_inferior ()->push_target (target);
   inf_child_explicitly_opened = 1;
   if (from_tty)
-    printf_filtered ("Done.  Use the \"run\" command to start a process.\n");
+    gdb_printf ("Done.  Use the \"run\" command to start a process.\n");
 }
 
 /* Implement the to_disconnect target_ops method.  */
@@ -201,13 +202,6 @@ inf_child_target::maybe_unpush_target ()
     current_inferior ()->unpush_target (this);
 }
 
-void
-inf_child_target::post_startup_inferior (ptid_t ptid)
-{
-  /* This target doesn't require a meaningful "post startup inferior"
-     operation by a debugger.  */
-}
-
 bool
 inf_child_target::can_run ()
 {
@@ -226,7 +220,7 @@ inf_child_target::can_attach ()
   return true;
 }
 
-char *
+const char *
 inf_child_target::pid_to_exec_file (int pid)
 {
   /* This target doesn't support translation of a process ID to the