/* 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.
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. */
const char *err;
char *combined;
- err = strerror (errno);
+ err = safe_strerror (errno);
if (err == NULL)
err = "unknown error";
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
}
return plongest (fd);
#endif
}
-
-/* See common/common-exceptions.h. */
-
-void
-prepare_to_throw_exception (void)
-{
- /* No client-specific actions required. */
-}