diff options
author | Justus Winter <justus@gnupg.org> | 2017-06-19 21:20:57 +0200 |
---|---|---|
committer | Justus Winter <justus@gnupg.org> | 2017-08-05 18:42:22 +0200 |
commit | 835b293d35a209d38047126443d41fa7090daa4c (patch) | |
tree | 5bf956895e6030f91cd618fb191b2151f6d25423 /console/display.c | |
parent | dc0b5a43224999223a246870912b0f292b1980e9 (diff) | |
download | hurd-835b293d35a209d38047126443d41fa7090daa4c.tar.gz hurd-835b293d35a209d38047126443d41fa7090daa4c.tar.bz2 hurd-835b293d35a209d38047126443d41fa7090daa4c.zip |
Use our own variant of 'assert' and 'assert_perror'.
Our variants print stack traces on failures. This will make locating
errors much easier.
Diffstat (limited to 'console/display.c')
-rw-r--r-- | console/display.c | 14 |
1 files changed, 7 insertions, 7 deletions
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 <iconv.h> #include <argp.h> #include <string.h> -#include <assert.h> +#include <assert-backtrace.h> #include <error.h> #include <pthread.h> @@ -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); |