server: Take into account the extended registers part of the i386 context.

This commit is contained in:
Alexandre Julliard 2008-01-15 11:53:31 +01:00
parent 2fdaa56693
commit b317416b20
2 changed files with 28 additions and 12 deletions

View File

@ -66,6 +66,10 @@ void copy_context( CONTEXT *to, const CONTEXT *from, unsigned int flags )
{ {
to->FloatSave = from->FloatSave; to->FloatSave = from->FloatSave;
} }
if (flags & CONTEXT_EXTENDED_REGISTERS)
{
memcpy( to->ExtendedRegisters, from->ExtendedRegisters, sizeof(to->ExtendedRegisters) );
}
if (flags & CONTEXT_DEBUG_REGISTERS) if (flags & CONTEXT_DEBUG_REGISTERS)
{ {
to->Dr0 = from->Dr0; to->Dr0 = from->Dr0;

View File

@ -259,21 +259,30 @@ static void dump_luid( const luid_t *luid )
fprintf( stderr, "%d.%u", luid->high_part, luid->low_part ); fprintf( stderr, "%d.%u", luid->high_part, luid->low_part );
} }
static void dump_context( const CONTEXT *context ) static void dump_context( const CONTEXT *context, data_size_t size )
{ {
CONTEXT ctx;
memset( &ctx, 0, sizeof(ctx) );
memcpy( &ctx, context, min( size, sizeof(CONTEXT) ));
#ifdef __i386__ #ifdef __i386__
fprintf( stderr, "{flags=%08x,eax=%08x,ebx=%08x,ecx=%08x,edx=%08x,esi=%08x,edi=%08x," fprintf( stderr, "{flags=%08x,eax=%08x,ebx=%08x,ecx=%08x,edx=%08x,esi=%08x,edi=%08x,"
"ebp=%08x,eip=%08x,esp=%08x,eflags=%08x,cs=%04x,ds=%04x,es=%04x," "ebp=%08x,eip=%08x,esp=%08x,eflags=%08x,cs=%04x,ds=%04x,es=%04x,"
"fs=%04x,gs=%04x,dr0=%08x,dr1=%08x,dr2=%08x,dr3=%08x,dr6=%08x,dr7=%08x,", "fs=%04x,gs=%04x,dr0=%08x,dr1=%08x,dr2=%08x,dr3=%08x,dr6=%08x,dr7=%08x,",
context->ContextFlags, context->Eax, context->Ebx, context->Ecx, context->Edx, ctx.ContextFlags, ctx.Eax, ctx.Ebx, ctx.Ecx, ctx.Edx,
context->Esi, context->Edi, context->Ebp, context->Eip, context->Esp, context->EFlags, ctx.Esi, ctx.Edi, ctx.Ebp, ctx.Eip, ctx.Esp, ctx.EFlags,
context->SegCs, context->SegDs, context->SegEs, context->SegFs, context->SegGs, ctx.SegCs, ctx.SegDs, ctx.SegEs, ctx.SegFs, ctx.SegGs,
context->Dr0, context->Dr1, context->Dr2, context->Dr3, context->Dr6, context->Dr7 ); ctx.Dr0, ctx.Dr1, ctx.Dr2, ctx.Dr3, ctx.Dr6, ctx.Dr7 );
fprintf( stderr, "float=" ); fprintf( stderr, "float=" );
dump_uints( (const int *)&context->FloatSave, sizeof(context->FloatSave) / sizeof(int) ); dump_uints( (const int *)&ctx.FloatSave, sizeof(ctx.FloatSave) / sizeof(int) );
if (size > FIELD_OFFSET( CONTEXT, ExtendedRegisters ))
{
fprintf( stderr, ",extended=" );
dump_uints( (const int *)&ctx.ExtendedRegisters, sizeof(ctx.ExtendedRegisters) / sizeof(int) );
}
fprintf( stderr, "}" ); fprintf( stderr, "}" );
#else #else
dump_uints( (const int *)context, sizeof(*context) / sizeof(int) ); dump_uints( (const int *)&ctx, sizeof(ctx) / sizeof(int) );
#endif #endif
} }
@ -384,8 +393,8 @@ static void dump_varargs_context( data_size_t size )
fprintf( stderr, "{}" ); fprintf( stderr, "{}" );
return; return;
} }
dump_context( cur_data ); dump_context( cur_data, size );
remove_data( size ); remove_data( min( size, sizeof(CONTEXT) ));
} }
static void dump_varargs_exc_event( data_size_t size ) static void dump_varargs_exc_event( data_size_t size )
@ -398,9 +407,12 @@ static void dump_varargs_exc_event( data_size_t size )
return; return;
} }
fprintf( stderr, "{context=" ); fprintf( stderr, "{context=" );
dump_context( ptr ); dump_context( ptr, size );
fprintf( stderr, ",rec=" ); if (size > sizeof(CONTEXT))
dump_exc_record( (const EXCEPTION_RECORD *)(ptr + 1) ); {
fprintf( stderr, ",rec=" );
dump_exc_record( (const EXCEPTION_RECORD *)(ptr + 1) );
}
fputc( '}', stderr ); fputc( '}', stderr );
remove_data( size ); remove_data( size );
} }