summaryrefslogtreecommitdiffstats
path: root/src/dviewhelper
diff options
context:
space:
mode:
authorsagitario <sagitario@fc51e93f-b9fe-4711-8d8d-3ae870c5f7d8>2013-05-25 17:40:23 (GMT)
committersagitario <sagitario@fc51e93f-b9fe-4711-8d8d-3ae870c5f7d8>2013-05-25 17:40:23 (GMT)
commit0fb1fd5b60c996ed16affcefd37603fb620f107e (patch)
tree66c3c2824a9a8bf6c4096203d5b6a80dc1e7f4d4 /src/dviewhelper
parentdd2882c90682885dea946a6e527645b4b237da99 (diff)
downloadcv2pdb-0fb1fd5b60c996ed16affcefd37603fb620f107e.zip
cv2pdb-0fb1fd5b60c996ed16affcefd37603fb620f107e.tar.gz
cv2pdb-0fb1fd5b60c996ed16affcefd37603fb620f107e.tar.bz2
2012-11-09 Version 0.26
* new option -p allows to specify the embedded PDB reference in the binary * added support for VS2012 2013-05-11 Version 0.27 * fixed crash when converting DWARF locations using 8 bytes or more
Diffstat (limited to 'src/dviewhelper')
-rw-r--r--src/dviewhelper/dviewhelper.cpp38
1 files changed, 29 insertions, 9 deletions
diff --git a/src/dviewhelper/dviewhelper.cpp b/src/dviewhelper/dviewhelper.cpp
index e2b295a..f777e20 100644
--- a/src/dviewhelper/dviewhelper.cpp
+++ b/src/dviewhelper/dviewhelper.cpp
@@ -155,34 +155,54 @@ __declspec(dllexport)
HRESULT WINAPI DObjectView(DWORD dwAddress, DEBUGHELPER *pHelper, int nBase, BOOL bUniStrings,
char *pResult, size_t max, DWORD reserved)
{
- if(dwAddress == 0)
+ DWORDLONG qwAddress = dwAddress;
+ if(pHelper->dwVersion >= 0x20000)
+ qwAddress = pHelper->GetRealAddress(pHelper);
+
+ if(qwAddress == 0)
{
strncpy(pResult,"null", max);
return S_OK;
}
+ int proc = 0;
+ if(pHelper->dwVersion >= 0x20000)
+ proc = pHelper->GetProcessorType(pHelper);
+ int sizeOfPtr = proc == 0 ? 4 : 8;
+
DWORD read;
- DWORD vtablePtr;
- if (pHelper->ReadDebuggeeMemory(pHelper, dwAddress, sizeof(vtablePtr), &vtablePtr, &read) != S_OK)
+ DWORDLONG vtablePtr = 0;
+ if (readMem(pHelper, qwAddress, sizeOfPtr, &vtablePtr, &read) != S_OK)
{
strncpy(pResult,"Cannot access object", max);
return S_OK;
}
- DWORD classinfoPtr;
- if (pHelper->ReadDebuggeeMemory(pHelper, vtablePtr, sizeof(vtablePtr), &classinfoPtr, &read) != S_OK)
+ DWORDLONG classinfoPtr = 0;
+ if (readMem(pHelper, vtablePtr, sizeOfPtr, &classinfoPtr, &read) != S_OK)
{
strncpy(pResult,"Cannot access vtable", max);
return S_OK;
}
- DString dstr;
- if (pHelper->ReadDebuggeeMemory(pHelper, classinfoPtr + 16, sizeof(dstr), &dstr, &read) != S_OK)
+ char strdata[16];
+ if (readMem(pHelper, classinfoPtr + 4*sizeOfPtr, 2*sizeOfPtr, strdata, &read) != S_OK)
{
strncpy(pResult,"Cannot access class info", max);
return S_OK;
}
- DWORD cnt = (dstr.length < max - 1 ? dstr.length : max - 1);
- if (pHelper->ReadDebuggeeMemory(pHelper, dstr.data, cnt, pResult, &read) != S_OK)
+ DWORDLONG length, data;
+ if(sizeOfPtr > 4)
+ {
+ length = *(DWORDLONG*) strdata;
+ data = *(DWORDLONG*) (strdata + sizeOfPtr);
+ }
+ else
+ {
+ length = *(DWORD*) strdata;
+ data = *(DWORD*) (strdata + sizeOfPtr);
+ }
+ DWORD cnt = (DWORD)(length < max - 1 ? length : max - 1);
+ if (readMem(pHelper, data, cnt, pResult, &read) != S_OK)
{
strncpy(pResult,"Cannot access name data", max);
return S_OK;