aboutsummaryrefslogtreecommitdiff
path: root/system/kernel/pdp_debug.c
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2005-11-28 01:07:25 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2005-11-28 01:07:25 +0000
commitc50ce0e0217ea07e2d450add2ab29cecea66fa96 (patch)
tree0700e1e5fd14ff99e5a4c6d4b4937268a1d9804f /system/kernel/pdp_debug.c
parentd7f71f87b112317d8303f25b4a536b943ea59d97 (diff)
This commit was generated by cvs2svn to compensate for changes in r4059,
which included commits to RCS files with non-trunk default branches. svn path=/trunk/externals/pdp/; revision=4060
Diffstat (limited to 'system/kernel/pdp_debug.c')
-rw-r--r--system/kernel/pdp_debug.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/system/kernel/pdp_debug.c b/system/kernel/pdp_debug.c
new file mode 100644
index 0000000..07f6541
--- /dev/null
+++ b/system/kernel/pdp_debug.c
@@ -0,0 +1,21 @@
+#include <sys/types.h>
+#include <signal.h>
+#include <unistd.h>
+#include "pdp_post.h"
+
+int pdp_debug_sigtrap_on_assert;
+
+
+void pdp_assert_hook (char *condition, char *file, int line)
+{
+ pdp_post("PDP_ASSERT (%s) failed in file %s, line %u. ", condition, file, line);
+ pdp_post("%s.\n", pdp_debug_sigtrap_on_assert ? "sending SIGTRAP" : "continuing");
+
+ if (pdp_debug_sigtrap_on_assert) kill(getpid(), SIGTRAP);
+}
+
+
+void pdp_debug_setup(void)
+{
+ pdp_debug_sigtrap_on_assert = 1;
+}