From 4be2543b2fb0aa20d0f2197dafa7eafef08499d1 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 19 Jun 2018 19:49:21 +0200 Subject: [PATCH] Cygwin support for callstack tracing. --- client/TracyCallstack.cpp | 2 +- client/TracyCallstack.hpp | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/client/TracyCallstack.cpp b/client/TracyCallstack.cpp index b3ad73f6..6981f8c0 100644 --- a/client/TracyCallstack.cpp +++ b/client/TracyCallstack.cpp @@ -2,7 +2,7 @@ #ifdef TRACY_HAS_CALLSTACK -#ifdef _WIN32 +#if defined _WIN32 || defined __CYGWIN__ # ifndef MAXLONG enum { SYMOPT_LOAD_LINES = 0x00000010 }; typedef struct _SYMBOL_INFO diff --git a/client/TracyCallstack.hpp b/client/TracyCallstack.hpp index 9c6efedb..7322b704 100644 --- a/client/TracyCallstack.hpp +++ b/client/TracyCallstack.hpp @@ -1,10 +1,14 @@ #ifndef __TRACYCALLSTACK_HPP__ #define __TRACYCALLSTACK_HPP__ -#ifdef _WIN32 +#if defined _WIN32 || defined __CYGWIN__ # define TRACY_HAS_CALLSTACK # ifndef MAXLONG +# ifdef __CYGWIN__ +extern "C" __declspec(dllimport) unsigned short __stdcall RtlCaptureStackBackTrace( unsigned int, unsigned int, void**, unsigned int* ); +# else extern "C" __declspec(dllimport) unsigned short __stdcall RtlCaptureStackBackTrace( unsigned long, unsigned long, void**, unsigned long* ); +# endif # endif #endif @@ -27,7 +31,7 @@ struct CallstackEntry uint32_t line; }; -#ifdef _WIN32 +#if defined _WIN32 || defined __CYGWIN__ void InitCallstack(); CallstackEntry DecodeCallstackPtr( uint64_t ptr );