diff options
author | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2005-11-28 01:07:25 +0000 |
---|---|---|
committer | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2005-11-28 01:07:25 +0000 |
commit | c50ce0e0217ea07e2d450add2ab29cecea66fa96 (patch) | |
tree | 0700e1e5fd14ff99e5a4c6d4b4937268a1d9804f /system/kernel/pdp_debug.c | |
parent | d7f71f87b112317d8303f25b4a536b943ea59d97 (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.c | 21 |
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; +} |