Cygwin support for callstack tracing.

This commit is contained in:
Bartosz Taudul 2018-06-19 19:49:21 +02:00
parent 288744273b
commit 4be2543b2f
2 changed files with 7 additions and 3 deletions

View File

@ -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

View File

@ -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 );