Fixed rsym for executables without any debug informations.

svn path=/trunk/; revision=15387
This commit is contained in:
Hartmut Birr 2005-05-17 20:28:57 +00:00
parent 2e000e7b38
commit e3ac1e89d5

View file

@ -368,7 +368,8 @@ MergeStabsAndCoffs(ULONG *MergedSymbolCount, PROSSYM_ENTRY *MergedSymbols,
CoffIndex++;
}
NewStabFunctionStringOffset = (*MergedSymbols)[*MergedSymbolCount].FunctionOffset;
if (CoffSymbols[CoffIndex].Address < (*MergedSymbols)[*MergedSymbolCount].Address
if (CoffSymbolsCount > 0 &&
CoffSymbols[CoffIndex].Address < (*MergedSymbols)[*MergedSymbolCount].Address
&& StabFunctionStartAddress < CoffSymbols[CoffIndex].Address
&& 0 != CoffSymbols[CoffIndex].FunctionOffset)
{
@ -799,6 +800,13 @@ int main(int argc, char* argv[])
exit(1);
}
if (StabsLength == 0 || StabStringsLength == 0)
{
/* no symbol info */
free(FileData);
return 0;
}
if (GetCoffInfo(FileData, PEFileHeader, PESectionHeaders, &CoffsLength, &CoffBase,
&CoffStringsLength, &CoffStringBase))
{