remove product name from vdi contents
differentiate between "can't open .vdi" and "can't parse .vdi"
This commit is contained in:
@@ -80,6 +80,7 @@ struct VDDebugInfoContext
|
|||||||
const unsigned long (*pSegments)[2];
|
const unsigned long (*pSegments)[2];
|
||||||
int nSegments;
|
int nSegments;
|
||||||
char sFilename[1024];
|
char sFilename[1024];
|
||||||
|
char szError[1024];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -445,8 +446,12 @@ bool VDDebugInfoInitFromMemory(VDDebugInfoContext *pctx, const void *_src) {
|
|||||||
|
|
||||||
pctx->pRVAHeap = NULL;
|
pctx->pRVAHeap = NULL;
|
||||||
|
|
||||||
if (memcmp((char *)src, PRODUCT_NAME " symbolic debug information", 36))
|
static const char *header = "symbolic debug information";
|
||||||
|
if (memcmp((char *)src, header, strlen(header)))
|
||||||
|
{
|
||||||
|
strcpy( pctx->szError, "header doesn't match" );
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// Extract fields
|
// Extract fields
|
||||||
|
|
||||||
@@ -474,15 +479,18 @@ bool VDDebugInfoInitFromFile( VDDebugInfoContext *pctx )
|
|||||||
if( pctx->Loaded() )
|
if( pctx->Loaded() )
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
GetVDIPath( pctx->sFilename, sizeof(pctx->sFilename) );
|
|
||||||
|
|
||||||
pctx->pRawBlock = NULL;
|
pctx->pRawBlock = NULL;
|
||||||
pctx->pRVAHeap = NULL;
|
pctx->pRVAHeap = NULL;
|
||||||
|
GetVDIPath( pctx->sFilename, ARRAYSIZE(pctx->sFilename) );
|
||||||
|
pctx->szError[0] = 0;
|
||||||
|
|
||||||
HANDLE h = CreateFile(pctx->sFilename, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
HANDLE h = CreateFile(pctx->sFilename, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||||
|
|
||||||
if (INVALID_HANDLE_VALUE == h)
|
if (INVALID_HANDLE_VALUE == h)
|
||||||
|
{
|
||||||
|
strcpy( pctx->szError, "CreateFile failed" );
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
DWORD dwFileSize = GetFileSize(h, NULL);
|
DWORD dwFileSize = GetFileSize(h, NULL);
|
||||||
@@ -751,7 +759,7 @@ static bool ReportCallStack( HWND hwnd, HANDLE hFile, const void **Backtrace )
|
|||||||
VDDebugInfoInitFromFile( &g_debugInfo );
|
VDDebugInfoInitFromFile( &g_debugInfo );
|
||||||
if( !g_debugInfo.Loaded() )
|
if( !g_debugInfo.Loaded() )
|
||||||
{
|
{
|
||||||
Report( hwnd, hFile, "Could not open debug resource file (%s).", g_debugInfo.sFilename );
|
Report( hwnd, hFile, "debug resource file '%s': %s.", g_debugInfo.sFilename, g_debugInfo.szError );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
// dump data
|
// dump data
|
||||||
|
|
||||||
static const char header[64]="StepMania symbolic debug information\r\n\x1A";
|
static const char header[64]="symbolic debug information\r\n\x1A";
|
||||||
|
|
||||||
fwrite(header, 64, 1, fo);
|
fwrite(header, 64, 1, fo);
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user