From 835b293d35a209d38047126443d41fa7090daa4c Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Mon, 19 Jun 2017 21:20:57 +0200 Subject: Use our own variant of 'assert' and 'assert_perror'. Our variants print stack traces on failures. This will make locating errors much easier. --- console/display.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'console/display.c') diff --git a/console/display.c b/console/display.c index ed5571e6..20914955 100644 --- a/console/display.c +++ b/console/display.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include @@ -325,7 +325,7 @@ do_mach_notify_port_deleted (struct port_info *pi, mach_port_t name) { /* As we cancel the dead-name notification before deallocating the port, this should not happen. */ - assert (0); + assert_backtrace (0); } /* We request dead name notifications for the user ports. */ @@ -376,7 +376,7 @@ do_mach_notify_dead_name (struct port_info *pi, mach_port_t dead_name) error_t do_mach_notify_port_destroyed (struct port_info *pi, mach_port_t rights) { - assert (0); + assert_backtrace (0); } error_t @@ -409,7 +409,7 @@ do_mach_notify_msg_accepted (struct port_info *pi, mach_port_t send) case. */ if (!send) { - assert(0); + assert_backtrace (0); return 0; } @@ -424,7 +424,7 @@ do_mach_notify_msg_accepted (struct port_info *pi, mach_port_t send) here. */ if (! *preq) { - assert(0); + assert_backtrace (0); pthread_mutex_unlock (&display->lock); return 0; } @@ -526,7 +526,7 @@ display_notice_changes (display_t display, mach_port_t notify) pthread_mutex_unlock (&display->lock); return err; } - assert (old == MACH_PORT_NULL); + assert_backtrace (old == MACH_PORT_NULL); req->port = notify; req->pending = 0; @@ -1820,7 +1820,7 @@ display_output_some (display_t display, char **buffer, size_t *length) #define UNICODE_REPLACEMENT_CHARACTER ((wchar_t) 0xfffd) if (saved_err == EILSEQ) { - assert (*length); + assert_backtrace (*length); (*length)--; (*buffer)++; display_output_one (display, UNICODE_REPLACEMENT_CHARACTER); -- cgit v1.2.3