Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2016-05-27 22:09:50 +0300
committerJan Kotas <jkotas@microsoft.com>2016-05-27 22:09:50 +0300
commit40a239edd9bdb06c9b47c1d7c97b142a2c3d1a6c (patch)
treee94cb060c628f1c6fbf2bfe524f8c9758d66d8f3 /src/Native/Runtime/MiscHelpers.cpp
parentfc20f70e1b642c9602ef22161021f205d9fe22b3 (diff)
Reimplement RhGetCurrentThreadStackTrace without asm code
[tfs-changeset: 1608916]
Diffstat (limited to 'src/Native/Runtime/MiscHelpers.cpp')
-rw-r--r--src/Native/Runtime/MiscHelpers.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Native/Runtime/MiscHelpers.cpp b/src/Native/Runtime/MiscHelpers.cpp
index aa8f14dcb..1e9d4dc69 100644
--- a/src/Native/Runtime/MiscHelpers.cpp
+++ b/src/Native/Runtime/MiscHelpers.cpp
@@ -657,6 +657,17 @@ EXTERN_C REDHAWK_API void __cdecl RhpReleaseCastCacheLock()
g_CastCacheLock.Leave();
}
+EXTERN_C Int32 __cdecl RhpCalculateStackTraceWorker(void* pOutputBuffer, UInt32 outputBufferLength);
+
+EXTERN_C REDHAWK_API Int32 __cdecl RhpGetCurrentThreadStackTrace(void* pOutputBuffer, UInt32 outputBufferLength)
+{
+ // This must be called via p/invoke rather than RuntimeImport to make the stack crawlable.
+
+ ThreadStore::GetCurrentThread()->SetupHackPInvokeTunnel();
+
+ return RhpCalculateStackTraceWorker(pOutputBuffer, outputBufferLength);
+}
+
#ifdef CORERT
COOP_PINVOKE_HELPER(void*, RhpGetModuleSection, (ModuleManager* pModule, Int32 headerId, Int32* length))
{