aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/utils.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2010-03-16 17:47:52 +0000
committerPedro Alves <palves@redhat.com>2010-03-16 17:47:52 +0000
commite92d13d5bcf6a7d365fcbaae5af81ad80648fe8f (patch)
tree71ac9c810f41ac867f425f508ee10f7be9061305 /gdb/gdbserver/utils.c
parent46956e396d10846a7ab0374a71bb1204bdd4d0d5 (diff)
downloadgdb-e92d13d5bcf6a7d365fcbaae5af81ad80648fe8f.zip
gdb-e92d13d5bcf6a7d365fcbaae5af81ad80648fe8f.tar.gz
gdb-e92d13d5bcf6a7d365fcbaae5af81ad80648fe8f.tar.bz2
gdb/gdbserver/
* server.h (internal_error): Declare. (gdb_assert, ASSERT_FUNCTION, gdb_assert_fail): Define. * utils.c (internal_error): New function.
Diffstat (limited to 'gdb/gdbserver/utils.c')
-rw-r--r--gdb/gdbserver/utils.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gdb/gdbserver/utils.c b/gdb/gdbserver/utils.c
index 6035f1e..78c6f66 100644
--- a/gdb/gdbserver/utils.c
+++ b/gdb/gdbserver/utils.c
@@ -171,6 +171,22 @@ warning (const char *string,...)
va_end (args);
}
+/* Report a problem internal to GDBserver, and exit. */
+
+void
+internal_error (const char *file, int line, const char *fmt, ...)
+{
+ va_list args;
+ va_start (args, fmt);
+
+ fprintf (stderr, "\
+%s:%d: A problem internal to GDBserver has been detected.\n", file, line);
+ vfprintf (stderr, fmt, args);
+ fprintf (stderr, "\n");
+ va_end (args);
+ exit (1);
+}
+
/* Temporary storage using circular buffer. */
#define NUMCELLS 4
#define CELLSIZE 50