mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[RSYM] When determining the current function, always prefer COFF symbols if they're closer.
This commit is contained in:
parent
87845a1cc2
commit
e51f4db7d0
1 changed files with 15 additions and 8 deletions
|
@ -720,7 +720,8 @@ MergeStabsAndCoffs(ULONG *MergedSymbolCount, PROSSYM_ENTRY *MergedSymbols,
|
||||||
ULONG StabIndex, j;
|
ULONG StabIndex, j;
|
||||||
ULONG CoffIndex;
|
ULONG CoffIndex;
|
||||||
ULONG_PTR StabFunctionStartAddress;
|
ULONG_PTR StabFunctionStartAddress;
|
||||||
ULONG StabFunctionStringOffset, NewStabFunctionStringOffset;
|
ULONG StabFunctionStringOffset, NewStabFunctionStringOffset, CoffFunctionStringOffset;
|
||||||
|
PROSSYM_ENTRY CoffFunctionSymbol;
|
||||||
|
|
||||||
*MergedSymbolCount = 0;
|
*MergedSymbolCount = 0;
|
||||||
if (StabSymbolsCount == 0)
|
if (StabSymbolsCount == 0)
|
||||||
|
@ -737,6 +738,8 @@ MergeStabsAndCoffs(ULONG *MergedSymbolCount, PROSSYM_ENTRY *MergedSymbols,
|
||||||
|
|
||||||
StabFunctionStartAddress = 0;
|
StabFunctionStartAddress = 0;
|
||||||
StabFunctionStringOffset = 0;
|
StabFunctionStringOffset = 0;
|
||||||
|
CoffFunctionStringOffset = 0;
|
||||||
|
CoffFunctionSymbol = NULL;
|
||||||
CoffIndex = 0;
|
CoffIndex = 0;
|
||||||
for (StabIndex = 0; StabIndex < StabSymbolsCount; StabIndex++)
|
for (StabIndex = 0; StabIndex < StabSymbolsCount; StabIndex++)
|
||||||
{
|
{
|
||||||
|
@ -761,18 +764,22 @@ MergeStabsAndCoffs(ULONG *MergedSymbolCount, PROSSYM_ENTRY *MergedSymbols,
|
||||||
StabIndex = j - 1;
|
StabIndex = j - 1;
|
||||||
|
|
||||||
while (CoffIndex < CoffSymbolsCount &&
|
while (CoffIndex < CoffSymbolsCount &&
|
||||||
CoffSymbols[CoffIndex + 1].Address <= (*MergedSymbols)[*MergedSymbolCount].Address)
|
CoffSymbols[CoffIndex].Address <= (*MergedSymbols)[*MergedSymbolCount].Address)
|
||||||
{
|
{
|
||||||
|
if (CoffSymbols[CoffIndex].FunctionOffset != 0)
|
||||||
|
{
|
||||||
|
CoffFunctionSymbol = &CoffSymbols[CoffIndex];
|
||||||
|
CoffFunctionStringOffset = CoffFunctionSymbol->FunctionOffset;
|
||||||
|
}
|
||||||
CoffIndex++;
|
CoffIndex++;
|
||||||
}
|
}
|
||||||
NewStabFunctionStringOffset = (*MergedSymbols)[*MergedSymbolCount].FunctionOffset;
|
NewStabFunctionStringOffset = (*MergedSymbols)[*MergedSymbolCount].FunctionOffset;
|
||||||
if (CoffSymbolsCount > 0 &&
|
if (CoffFunctionSymbol &&
|
||||||
CoffSymbols[CoffIndex].Address < (*MergedSymbols)[*MergedSymbolCount].Address &&
|
CoffFunctionSymbol->Address <= (*MergedSymbols)[*MergedSymbolCount].Address &&
|
||||||
StabFunctionStartAddress < CoffSymbols[CoffIndex].Address &&
|
StabFunctionStartAddress < CoffFunctionSymbol->Address)
|
||||||
CoffSymbols[CoffIndex].FunctionOffset != 0)
|
|
||||||
{
|
{
|
||||||
(*MergedSymbols)[*MergedSymbolCount].FunctionOffset = CoffSymbols[CoffIndex].FunctionOffset;
|
(*MergedSymbols)[*MergedSymbolCount].FunctionOffset = CoffFunctionStringOffset;
|
||||||
CoffSymbols[CoffIndex].FileOffset = CoffSymbols[CoffIndex].FunctionOffset = 0;
|
CoffFunctionSymbol->FunctionOffset = 0;
|
||||||
}
|
}
|
||||||
if (StabFunctionStringOffset != NewStabFunctionStringOffset)
|
if (StabFunctionStringOffset != NewStabFunctionStringOffset)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue