From c48e6ec36da97d514488f88fa4b9c268fd0d6284 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Mon, 11 Feb 2013 01:54:55 +0100 Subject: Fix registers recording in core dump * exec/elfcore.c (fetch_thread_regset): Fix field shifting order to avoid losing register content. --- exec/elfcore.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'exec') diff --git a/exec/elfcore.c b/exec/elfcore.c index f953cc76..1f9238b6 100644 --- a/exec/elfcore.c +++ b/exec/elfcore.c @@ -63,11 +63,11 @@ fetch_thread_regset (thread_t thread, prgregset_t *gregs) (void) thread_get_state (thread, i386_THREAD_STATE, (thread_state_t) &u->state, &count); - u->gregs[REG_EIP] = u->state.eip; - u->gregs[REG_CS] = u->state.cs; - u->gregs[REG_EFL] = u->state.efl; - u->gregs[REG_UESP] = u->state.uesp; u->gregs[REG_SS] = u->state.ss; + u->gregs[REG_UESP] = u->state.uesp; + u->gregs[REG_EFL] = u->state.efl; + u->gregs[REG_CS] = u->state.cs; + u->gregs[REG_EIP] = u->state.eip; /* These are the extra words that don't exist in prgregset_t. */ u->gregs[REG_ERR] = u->gregs[REG_TRAPNO] = 0; -- cgit v1.2.3