diff options
author | John Emmas <johne53@tiscali.co.uk> | 2015-07-18 15:22:43 +0100 |
---|---|---|
committer | John Emmas <johne53@tiscali.co.uk> | 2015-07-18 15:22:43 +0100 |
commit | e29fd9a2fde099ea14d8c8517c3967eb62e2ac0e (patch) | |
tree | b0ab643bb62b2c59697b8ec16d9ef0fae29ab4a6 /libs | |
parent | 8587fef16afd4b14e871ed22ea23492f14b8af85 (diff) |
Minor changes to ensure that MSVC knows about 'CaptureStackBackTrace()'
Diffstat (limited to 'libs')
-rw-r--r-- | libs/pbd/MSVCpbd/pbd.vcproj | 2 | ||||
-rw-r--r-- | libs/pbd/pbd/debug.h | 4 | ||||
-rw-r--r-- | libs/pbd/stacktrace.cc | 16 |
3 files changed, 20 insertions, 2 deletions
diff --git a/libs/pbd/MSVCpbd/pbd.vcproj b/libs/pbd/MSVCpbd/pbd.vcproj index 07bb5fa592..e03b18aff2 100644 --- a/libs/pbd/MSVCpbd/pbd.vcproj +++ b/libs/pbd/MSVCpbd/pbd.vcproj @@ -62,7 +62,7 @@ /> <Tool Name="VCLinkerTool" - AdditionalDependencies="$(DllPrefix)giomm32$(GlibmmDllSuffix)D.lib $(DllPrefix)glibmm32$(GlibmmDllSuffix)D.lib pthreadVCE2.lib $(DllPrefix)gio32$(GlibDllSuffix)D.lib $(DllPrefix)glib32$(GlibDllSuffix)D.lib $(DllPrefix)gobject32$(GlibDllSuffix)D.lib $(DllPrefix)sigc++32-2.0D.lib libxml2D.lib libsndfile-1D.lib intlD.lib ws2_32.lib" + AdditionalDependencies="$(DllPrefix)giomm32$(GlibmmDllSuffix)D.lib $(DllPrefix)glibmm32$(GlibmmDllSuffix)D.lib pthreadVCE2.lib $(DllPrefix)gio32$(GlibDllSuffix)D.lib $(DllPrefix)glib32$(GlibDllSuffix)D.lib $(DllPrefix)gobject32$(GlibDllSuffix)D.lib $(DllPrefix)sigc++32-2.0D.lib libxml2D.lib libsndfile-1D.lib intlD.lib ws2_32.lib dbghelp.lib" OutputFile="$(OutDir)\$(DllPrefix)$(ProjectName)32D.dll" AdditionalLibraryDirectories="F:\pthread-win32\Pre-built.2\lib" GenerateDebugInformation="true" diff --git a/libs/pbd/pbd/debug.h b/libs/pbd/pbd/debug.h index a372c3963c..8beed56d41 100644 --- a/libs/pbd/pbd/debug.h +++ b/libs/pbd/pbd/debug.h @@ -28,6 +28,10 @@ #include "pbd/libpbd_visibility.h" #include "pbd/timing.h" +#if defined(COMPILER_MSVC) && !defined(PTW32_VERSION) +#include <ardourext/pthread.h> // Gets us 'PTW32_VERSION' +#endif + namespace PBD { typedef std::bitset<128> DebugBits; diff --git a/libs/pbd/stacktrace.cc b/libs/pbd/stacktrace.cc index d4199b9adc..181b7d18e7 100644 --- a/libs/pbd/stacktrace.cc +++ b/libs/pbd/stacktrace.cc @@ -20,6 +20,7 @@ #include "libpbd-config.h" #include "pbd/stacktrace.h" +#include "pbd/debug.h" #include "pbd/compose.h" #include "pbd/pthread_utils.h" @@ -113,6 +114,19 @@ PBD::stacktrace (std::ostream& out, int levels) #elif defined (PLATFORM_WINDOWS) +#if defined DEBUG && !defined CaptureStackBackTrace +#define CaptureStackBackTrace RtlCaptureStackBackTrace + +extern "C" { + __declspec(dllimport) USHORT WINAPI CaptureStackBackTrace ( + ULONG FramesToSkip, + ULONG FramesToCapture, + PVOID *BackTrace, + PULONG BackTraceHash + ); +} +#endif + std::string PBD::demangle (std::string const & l) /* JE - !!!! 'PBD' namespace might possibly get removed (except it's still used in 'libs/canvas/item.cc') */ { @@ -131,7 +145,7 @@ PBD::stacktrace( std::ostream& out, int) HANDLE process; process = GetCurrentProcess(); - out << "+++++Backtrace process: " << pthread_self() << std::endl; + out << "+++++Backtrace process: " << DEBUG_THREAD_SELF << std::endl; SymInitialize( process, NULL, TRUE ); |