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 /exec/elfcore.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 'exec/elfcore.c')
-rw-r--r-- | exec/elfcore.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/exec/elfcore.c b/exec/elfcore.c index 3e4551e5..12ecf34f 100644 --- a/exec/elfcore.c +++ b/exec/elfcore.c @@ -40,7 +40,7 @@ #endif #include <mach/thread_status.h> -#include <assert.h> +#include <assert-backtrace.h> #ifdef i386_THREAD_STATE # define ELF_MACHINE EM_386 @@ -56,9 +56,9 @@ fetch_thread_regset (thread_t thread, prgregset_t *gregs) prgregset_t gregs; } *u = (void *) gregs; mach_msg_type_number_t count = i386_THREAD_STATE_COUNT; - assert (sizeof (struct i386_thread_state) < sizeof (prgregset_t)); - assert (offsetof (struct i386_thread_state, gs) == REG_GS * 4); - assert (offsetof (struct i386_thread_state, eax) == REG_EAX * 4); + assert_backtrace (sizeof (struct i386_thread_state) < sizeof (prgregset_t)); + assert_backtrace (offsetof (struct i386_thread_state, gs) == REG_GS * 4); + assert_backtrace (offsetof (struct i386_thread_state, eax) == REG_EAX * 4); (void) thread_get_state (thread, i386_THREAD_STATE, (thread_state_t) &u->state, &count); @@ -82,7 +82,7 @@ fetch_thread_fpregset (thread_t thread, prfpregset_t *fpregs) (thread_state_t) &st, &count); if (err == 0 && st.initialized) { - assert (sizeof *fpregs >= sizeof st.hw_state); + assert_backtrace (sizeof *fpregs >= sizeof st.hw_state); memcpy (fpregs, st.hw_state, sizeof st.hw_state); } } @@ -96,7 +96,7 @@ static inline void fetch_thread_regset (thread_t thread, prgregset_t *gregs) { mach_msg_type_number_t count = ALPHA_THREAD_STATE_COUNT; - assert (sizeof (struct alpha_thread_state) <= sizeof (prgregset_t)); + assert_backtrace (sizeof (struct alpha_thread_state) <= sizeof (prgregset_t)); (void) thread_get_state (thread, ALPHA_THREAD_STATE, (thread_state_t) gregs, &count); /* XXX @@ -110,7 +110,7 @@ static inline void fetch_thread_fpregset (thread_t thread, prfpregset_t *fpregs) { mach_msg_type_number_t count = ALPHA_FLOAT_STATE_COUNT; - assert (sizeof (struct alpha_float_state) == sizeof *fpregs); + assert_backtrace (sizeof (struct alpha_float_state) == sizeof *fpregs); (void) thread_get_state (thread, ALPHA_FLOAT_STATE, (thread_state_t) fpregs, &count); } |