diff options
-rw-r--r-- | hurd/ChangeLog | 5 | ||||
-rw-r--r-- | hurd/thread.h | 15 | ||||
-rw-r--r-- | libhurd-mm/ChangeLog | 6 | ||||
-rw-r--r-- | libhurd-mm/exceptions.c | 44 |
4 files changed, 32 insertions, 38 deletions
diff --git a/hurd/ChangeLog b/hurd/ChangeLog index 1082520..659488a 100644 --- a/hurd/ChangeLog +++ b/hurd/ChangeLog @@ -1,3 +1,8 @@ +2009-01-16 Neal H. Walfield <neal@gnu.org> + + * thread.h (AF_REGS_FMT): New macro. + (AF_REGS_PRINTF): Likewise. + 2008-12-18 Neal H. Walfield <neal@gnu.org> * thread.h (hurd_myself): Assume UTCB->TID is set correctly. diff --git a/hurd/thread.h b/hurd/thread.h index aa292ab..653bbf6 100644 --- a/hurd/thread.h +++ b/hurd/thread.h @@ -37,6 +37,21 @@ struct activation_frame uintptr_t regs[10]; struct { +#define AF_REGS_FMT \ + "ip: %p, sp: %p, eax: %p, ebx: %p, ecx: %p, " \ + "edx: %p, edi: %p, esi: %p, ebp: %p, eflags: %p" +#define AF_REGS_PRINTF(activation_frame) \ + (void *) activation_frame->eip, \ + (void *) activation_frame->esp, \ + (void *) activation_frame->eax, \ + (void *) activation_frame->ebx, \ + (void *) activation_frame->ecx, \ + (void *) activation_frame->edx, \ + (void *) activation_frame->edi, \ + (void *) activation_frame->esi, \ + (void *) activation_frame->ebp, \ + (void *) activation_frame->eflags + uintptr_t eax; uintptr_t ecx; uintptr_t edx; diff --git a/libhurd-mm/ChangeLog b/libhurd-mm/ChangeLog index e72d016..121e73c 100644 --- a/libhurd-mm/ChangeLog +++ b/libhurd-mm/ChangeLog @@ -1,5 +1,11 @@ 2009-01-16 Neal H. Walfield <neal@gnu.org> + * exceptions.c (hurd_activation_stack_dump): Use AF_REGS_FMT and + AF_REGS_PRINTF rather than naming the registers explicitly. + (hurd_activation_handler_normal): Likewise. + +2009-01-16 Neal H. Walfield <neal@gnu.org> + * mm-init.c (mm_init) [!NDEBUG && i386]: Clear STORAGE and assert that it is not VG_ADDR_VOID before freeing the associated storage. Assert that the fault callback was called. diff --git a/libhurd-mm/exceptions.c b/libhurd-mm/exceptions.c index 1a855b9..6ad928a 100644 --- a/libhurd-mm/exceptions.c +++ b/libhurd-mm/exceptions.c @@ -280,20 +280,8 @@ hurd_activation_stack_dump (void) activation_frame = activation_frame->next) { depth ++; - debug (0, "%d (%p): ip: %p, sp: %p, eax: %p, ebx: %p, ecx: %p, " - "edx: %p, edi: %p, esi: %p, ebp: %p, eflags: %p", - depth, activation_frame, - (void *) activation_frame->eip, - (void *) activation_frame->esp, - (void *) activation_frame->eax, - (void *) activation_frame->ebx, - (void *) activation_frame->ecx, - (void *) activation_frame->edx, - (void *) activation_frame->edi, - (void *) activation_frame->esi, - (void *) activation_frame->ebp, - (void *) activation_frame->eflags); - + debug (0, "%d (%p): " AF_REGS_FMT, + depth, activation_frame, AF_REGS_PRINTF (activation_frame)); } } @@ -353,19 +341,9 @@ hurd_activation_handler_normal (struct activation_frame *activation_frame, if (err) panic ("Failed to unmarshal exception: %d", err); - debug (5, "Fault at " VG_ADDR_FMT " (ip: %p, sp: %p, eax: %p, " - "ebx: %p, ecx: %p, edx: %p, edi: %p, esi: %p, ebp: %p, " - "eflags: %p)", + debug (5, "Fault at " VG_ADDR_FMT " " AF_REGS_FMT, VG_ADDR_PRINTF (fault), - (void *) ip, (void *) sp, - (void *) activation_frame->eax, - (void *) activation_frame->ebx, - (void *) activation_frame->ecx, - (void *) activation_frame->edx, - (void *) activation_frame->edi, - (void *) activation_frame->esi, - (void *) activation_frame->ebp, - (void *) activation_frame->eflags); + AF_REGS_PRINTF (activation_frame)); extern l4_thread_id_t as_rwlock_owner; @@ -403,19 +381,9 @@ hurd_activation_handler_normal (struct activation_frame *activation_frame, if (as_rwlock_owner == l4_myself ()) debug (0, "I hold as_rwlock!"); - debug (0, "SIGSEGV at " VG_ADDR_FMT " " - "(ip: %p, sp: %p, eax: %p, ebx: %p, ecx: %p, " - "edx: %p, edi: %p, esi: %p, ebp: %p, eflags: %p)", + debug (0, "SIGSEGV at " VG_ADDR_FMT " " AF_REGS_FMT, VG_ADDR_PRINTF (fault), - (void *) ip, (void *) sp, - (void *) activation_frame->eax, - (void *) activation_frame->ebx, - (void *) activation_frame->ecx, - (void *) activation_frame->edx, - (void *) activation_frame->edi, - (void *) activation_frame->esi, - (void *) activation_frame->ebp, - (void *) activation_frame->eflags); + AF_REGS_PRINTF (activation_frame)); backtrace_print (); |