summaryrefslogtreecommitdiff
path: root/src/VBox/Runtime/common/ldr/ldrEx.cpp
diff options
context:
space:
mode:
authorvboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f>2018-08-04 19:41:30 +0000
committervboxsync <vboxsync@cfe28804-0f27-0410-a406-dd0f0b0b656f>2018-08-04 19:41:30 +0000
commit46300d768de122107989ddd0a4cfc21997d63432 (patch)
treedd1c59d84d5117f7dfe8ad15f057a15f720dc722 /src/VBox/Runtime/common/ldr/ldrEx.cpp
parenta30991b4032e5f9e2e2d4b4a15c39bb0fd93cec3 (diff)
downloadVirtualBox-svn-46300d768de122107989ddd0a4cfc21997d63432.tar.gz
IPRT: Added single stack frame unwind function to RTDbgMod and RTLdr, copying over the PoC from DBGFRStack.cpp. bugref:3897
git-svn-id: https://www.virtualbox.org/svn/vbox/trunk@73494 cfe28804-0f27-0410-a406-dd0f0b0b656f
Diffstat (limited to 'src/VBox/Runtime/common/ldr/ldrEx.cpp')
-rw-r--r--src/VBox/Runtime/common/ldr/ldrEx.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/VBox/Runtime/common/ldr/ldrEx.cpp b/src/VBox/Runtime/common/ldr/ldrEx.cpp
index 969702a0a74..e52d843a609 100644
--- a/src/VBox/Runtime/common/ldr/ldrEx.cpp
+++ b/src/VBox/Runtime/common/ldr/ldrEx.cpp
@@ -33,6 +33,7 @@
#include "internal/iprt.h"
#include <iprt/assert.h>
+#include <iprt/dbg.h>
#include <iprt/err.h>
#include <iprt/log.h>
#include <iprt/md5.h>
@@ -707,6 +708,26 @@ RTDECL(int) RTLdrHashImage(RTLDRMOD hLdrMod, RTDIGESTTYPE enmDigest, char *pszDi
RT_EXPORT_SYMBOL(RTLdrHashImage);
+RTDECL(int) RTLdrUnwindFrame(RTLDRMOD hLdrMod, void const *pvBits, uint32_t iSeg, RTLDRADDR off, PRTDBGUNWINDSTATE pState)
+{
+ /*
+ * Validate.
+ */
+ AssertMsgReturn(rtldrIsValid(hLdrMod), ("hLdrMod=%p\n", hLdrMod), VERR_INVALID_HANDLE);
+ PRTLDRMODINTERNAL pMod = (PRTLDRMODINTERNAL)hLdrMod;
+ AssertPtr(pState);
+ AssertReturn(pState->u32Magic == RTDBGUNWINDSTATE_MAGIC, VERR_INVALID_MAGIC);
+
+ /*
+ * Pass on the work.
+ */
+ if (pMod->pOps->pfnUnwindFrame)
+ return pMod->pOps->pfnUnwindFrame(pMod, pvBits, iSeg, off, pState);
+ return VERR_DBG_NO_UNWIND_INFO;
+}
+RT_EXPORT_SYMBOL(RTLdrUnwindFrame);
+
+
/**
* Internal method used by the IPRT debug bits.
*