Make tests public. Rewrite most tests. Add tests.
[pintos-anon] / src / lib / user / debug.c
1 #include <debug.h>
2 #include <stdarg.h>
3 #include <stdbool.h>
4 #include <stdio.h>
5 #include <syscall.h>
6
7 /* Aborts the user program, printing the source file name, line
8    number, and function name, plus a user-specific message. */
9 void
10 debug_panic (const char *file, int line, const char *function,
11              const char *message, ...)
12 {
13   va_list args;
14
15   printf ("User process abort at %s:%d in %s(): ", file, line, function);
16
17   va_start (args, message);
18   vprintf (message, args);
19   printf ("\n");
20   va_end (args);
21
22   debug_backtrace ();
23   
24   exit (1);
25 }