summaryrefslogtreecommitdiff
path: root/thirdparty/thekla_atlas/nvcore/Debug.cpp
diff options
context:
space:
mode:
authorHein-Pieter van Braam <hp@tmm.cx>2017-12-15 23:16:09 +0100
committerHein-Pieter van Braam <hp@tmm.cx>2017-12-15 23:26:10 +0100
commit241de95884ae7c0985d03d534b085b1b147ceed8 (patch)
tree8195337cc4916ac468cbb2646d9e8b563fc88eee /thirdparty/thekla_atlas/nvcore/Debug.cpp
parentbca97e33cefdf2687ea766fd9bd7032aa98cd0e8 (diff)
Fix 32bit MingW build for thekla_altas
Diffstat (limited to 'thirdparty/thekla_atlas/nvcore/Debug.cpp')
-rw-r--r--thirdparty/thekla_atlas/nvcore/Debug.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/thirdparty/thekla_atlas/nvcore/Debug.cpp b/thirdparty/thekla_atlas/nvcore/Debug.cpp
index 81498c219e..4980ffa916 100644
--- a/thirdparty/thekla_atlas/nvcore/Debug.cpp
+++ b/thirdparty/thekla_atlas/nvcore/Debug.cpp
@@ -394,8 +394,10 @@ namespace
#pragma warning(disable:4748)
static NV_NOINLINE int backtrace(void * trace[], int maxcount) {
CONTEXT ctx = { 0 };
+// -- GODOT start --
#if NV_CPU_X86 && !NV_CPU_X86_64
ctx.ContextFlags = CONTEXT_CONTROL;
+#if NV_CC_MSVC
_asm {
call x
x: pop eax
@@ -404,6 +406,13 @@ namespace
mov ctx.Esp, esp
}
#else
+ register long unsigned int ebp asm("ebp");
+ ctx.Eip = (DWORD) __builtin_return_address(0);
+ ctx.Ebp = ebp;
+ ctx.Esp = (DWORD) __builtin_frame_address(0);
+#endif
+// -- GODOT end --
+#else
RtlCaptureContext(&ctx); // Not implemented correctly in x86.
#endif