diff options
| author | manuel <manuel@mausz.at> | 2012-03-27 11:51:08 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2012-03-27 11:51:08 +0200 |
| commit | 4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b (patch) | |
| tree | 868c52e06f207b5ec8a3cc141f4b8b2bdfcc165c /lib/user/debug.c | |
| parent | eae0bd57f0a26314a94785061888d193d186944a (diff) | |
| download | progos-4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b.tar.gz progos-4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b.tar.bz2 progos-4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b.zip | |
reorganize file structure to match the upstream requirements
Diffstat (limited to 'lib/user/debug.c')
| -rw-r--r-- | lib/user/debug.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/user/debug.c b/lib/user/debug.c new file mode 100644 index 0000000..f49b874 --- /dev/null +++ b/lib/user/debug.c | |||
| @@ -0,0 +1,25 @@ | |||
| 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 | } | ||
