2019-12-18 Anthony Green <green@moxielogic.com>
[deliverable/binutils-gdb.git] / gdb / gdbserver / utils.c
index e310b9e1405fe7f5f800ab8f3fa6523a2f4734af..b72dd0ec2b2c9bd35bc1dd01a6b5f1d375345abf 100644 (file)
@@ -1,5 +1,5 @@
 /* General utility routines for the remote server for GDB.
-   Copyright (C) 1986-2014 Free Software Foundation, Inc.
+   Copyright (C) 1986-2019 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -37,18 +37,6 @@ malloc_failure (long size)
   exit (1);
 }
 
-/* Copy a string into a memory buffer.
-   If malloc fails, this will print a message to stderr and exit.  */
-
-char *
-xstrdup (const char *s)
-{
-  char *ret = strdup (s);
-  if (ret == NULL)
-    malloc_failure (strlen (s) + 1);
-  return ret;
-}
-
 /* Print the system error message for errno, and also mention STRING
    as the file name for which the error was encountered.
    Then return to command level.  */
@@ -59,7 +47,7 @@ perror_with_name (const char *string)
   const char *err;
   char *combined;
 
-  err = strerror (errno);
+  err = safe_strerror (errno);
   if (err == NULL)
     err = "unknown error";
 
@@ -76,17 +64,13 @@ perror_with_name (const char *string)
 void
 verror (const char *string, va_list args)
 {
-#ifndef IN_PROCESS_AGENT
-  extern jmp_buf toplevel;
-#endif
-
+#ifdef IN_PROCESS_AGENT
   fflush (stdout);
   vfprintf (stderr, string, args);
   fprintf (stderr, "\n");
-#ifndef IN_PROCESS_AGENT
-  longjmp (toplevel, 1);
-#else
   exit (1);
+#else
+  throw_verror (GENERIC_ERROR, string, args);
 #endif
 }
 
@@ -141,11 +125,3 @@ pfildes (gdb_fildes_t fd)
   return plongest (fd);
 #endif
 }
-
-/* See common/common-exceptions.h.  */
-
-void
-prepare_to_throw_exception (void)
-{
-  /* No client-specific actions required.  */
-}
This page took 0.025315 seconds and 4 git commands to generate.