From 5f299d6fe53fc11e8c56d21ba571d36ec16eb4f1 Mon Sep 17 00:00:00 2001 From: Ge van Geldorp Date: Mon, 19 Jun 2006 20:03:37 +0200 Subject: [PATCH] dbghelp: Fix compilation for x86_64. --- dlls/dbghelp/minidump.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/dlls/dbghelp/minidump.c b/dlls/dbghelp/minidump.c index 6572248fcfd..e8c0c397916 100644 --- a/dlls/dbghelp/minidump.c +++ b/dlls/dbghelp/minidump.c @@ -166,18 +166,21 @@ static BOOL fetch_thread_info(struct dump_context* dc, int thd_idx, mdThd->Stack.StartOfMemoryRange = (ctx->Esp - 4); else mdThd->Stack.StartOfMemoryRange = (ULONG_PTR)tib.StackLimit; - mdThd->Stack.Memory.DataSize = (ULONG_PTR)tib.StackBase - - mdThd->Stack.StartOfMemoryRange; #elif defined(__powerpc__) if (ctx->Iar) mdThd->Stack.StartOfMemoryRange = ctx->Iar - 4; else mdThd->Stack.StartOfMemoryRange = (ULONG_PTR)tib.StackLimit; - mdThd->Stack.Memory.DataSize = (ULONG_PTR)tib.StackBase - - mdThd->Stack.StartOfMemoryRange; +#elif defined(__x86_64__) + if (ctx->Rsp) + mdThd->Stack.StartOfMemoryRange = (ctx->Rsp - 8); + else + mdThd->Stack.StartOfMemoryRange = (ULONG_PTR)tib.StackLimit; #else -#error unsupported CPU +#error unsupported CPU #endif + mdThd->Stack.Memory.DataSize = (ULONG_PTR)tib.StackBase - + mdThd->Stack.StartOfMemoryRange; } ResumeThread(hThread); }