- enable loading of pdb files named in NB10 records of a dbg file

- disable timestamp check for pdb files
This commit is contained in:
Juergen Schmied 2000-10-29 18:03:41 +00:00 committed by Alexandre Julliard
parent ad2b103b32
commit 7493eada13

View file

@ -2883,6 +2883,7 @@ static int DEBUG_ProcessPDBFile( DBG_MODULE* module, const char *full_filename )
int header_size = 0;
char *modimage, *file;
DEBUG_Printf(DBG_CHN_TRACE, "Processing PDB file %s\n", full_filename);
/*
* Open and map() .PDB file
@ -2948,8 +2949,10 @@ static int DEBUG_ProcessPDBFile( DBG_MODULE* module, const char *full_filename )
if ( root->TimeDateStamp
!= ((struct CodeViewDebug *)MSC_INFO(module)->dbg_info)->cv_timestamp )
{
DEBUG_Printf(DBG_CHN_ERR, "-Wrong time stamp of .PDB file %s\n", full_filename);
goto leave;
/* the timestamp seems to be wrong often (we may read the file wrong)*/
DEBUG_Printf(DBG_CHN_MESG, "-Wrong time stamp of .PDB file %s (0x%08lx, 0x%08x)\n",
full_filename, root->TimeDateStamp,
((struct CodeViewDebug *)MSC_INFO(module)->dbg_info)->cv_timestamp);
}
/*
@ -3057,14 +3060,10 @@ DEBUG_ProcessDBGFile(DBG_MODULE* module, const char* filename)
{
HANDLE hFile, hMap;
char * addr;
char * codeview;
struct CV4_DirHead * codeview_dir;
struct CV4_DirEnt * codeview_dent;
PIMAGE_DEBUG_DIRECTORY dbghdr;
DBG_MODULE module2;
int i;
int j;
struct codeview_linetab_hdr * linetab;
int nsect;
PIMAGE_SEPARATE_DEBUG_HEADER pdbg = NULL;
IMAGE_SECTION_HEADER * sectp;
@ -3115,7 +3114,31 @@ DEBUG_ProcessDBGFile(DBG_MODULE* module, const char* filename)
DEBUG_ProcessCoff(&module2);
break;
case IMAGE_DEBUG_TYPE_CODEVIEW:
{
char * codeview;
struct CV4_DirHead * codeview_dir;
struct CV4_DirEnt * codeview_dent;
struct codeview_linetab_hdr * linetab;
struct CodeViewDebug * cvd;
cvd = (struct CodeViewDebug *) (addr + dbghdr->PointerToRawData);
/*
* see msdn.microsoft.com/library/specs/S66EA.HTM
* for desriptions of more NBxx formats
*/
if( strcmp(cvd->cv_nbtype, "NB10") == 0 )
{
/*
* The debug information resides in a seperate pdb file.
* This section contains only a filename.
*/
DEBUG_ProcessPDBFile(module, cvd->cv_name);
}
else if (strcmp(cvd->cv_nbtype, "NB09") == 0 )
{
/*
* CodeView 4.10
* This is the older format by which codeview stuff is
* stored, known as the 'NB09' format. Newer executables
* and dlls created by VC++ use PDB files instead, which
@ -3124,18 +3147,9 @@ DEBUG_ProcessDBGFile(DBG_MODULE* module, const char* filename)
*/
codeview = (addr + dbghdr->PointerToRawData);
/*
* The first thing in the codeview section should be
* an 'NB09' identifier. As a sanity check, make sure
* it is there.
*/
if( *((unsigned int*) codeview) != 0x3930424e )
{
break;
}
/*
* Next we need to find the directory. This is easy too.
* We need to find the directory. This is easy too.
*/
codeview_dir = (struct CV4_DirHead *)
(codeview + ((unsigned int*) codeview)[1]);
@ -3186,7 +3200,13 @@ DEBUG_ProcessDBGFile(DBG_MODULE* module, const char* filename)
linetab);
}
}
}
else
{
DEBUG_Printf(DBG_CHN_ERR, "Unknown CODEVIEW type %s in module %s\n",
cvd->cv_nbtype, module->module_name);
}
}
break;
default:
break;
@ -3230,10 +3250,11 @@ DEBUG_ProcessMSCDebugInfo(DBG_MODULE* module)
* it yet.
*/
sts = FALSE;
DEBUG_Printf(DBG_CHN_ERR, "Unknown CODEVIEW type %s in module %s\n",
cvd->cv_nbtype, module->module_name);
break;
}
sts = DEBUG_ProcessPDBFile(module, cvd->cv_name);
DEBUG_Printf(DBG_CHN_TRACE, "Processing PDB file %s\n", cvd->cv_name);
break;
case IMAGE_DEBUG_TYPE_MISC:
/*