mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
Proper search for lines and files as with functions.
svn path=/trunk/; revision=7599
This commit is contained in:
parent
2b806f43c8
commit
a9582ff53d
1 changed files with 12 additions and 9 deletions
|
@ -410,6 +410,7 @@ LdrpGetFileName(IN PIMAGE_SYMBOL_INFO SymbolInfo,
|
||||||
{
|
{
|
||||||
PSYMBOL NextSymbol;
|
PSYMBOL NextSymbol;
|
||||||
ULONG_PTR NextAddress;
|
ULONG_PTR NextAddress;
|
||||||
|
ULONG_PTR AddrFound = 0;
|
||||||
PSYMBOL Symbol;
|
PSYMBOL Symbol;
|
||||||
|
|
||||||
Symbol = SymbolInfo->FileNameSymbols.Symbols;
|
Symbol = SymbolInfo->FileNameSymbols.Symbols;
|
||||||
|
@ -425,19 +426,20 @@ LdrpGetFileName(IN PIMAGE_SYMBOL_INFO SymbolInfo,
|
||||||
Symbol->SymbolType, RelativeAddress, Symbol->RelativeAddress, NextAddress);
|
Symbol->SymbolType, RelativeAddress, Symbol->RelativeAddress, NextAddress);
|
||||||
|
|
||||||
if ((Symbol->SymbolType == ST_FILENAME) &&
|
if ((Symbol->SymbolType == ST_FILENAME) &&
|
||||||
(RelativeAddress >= Symbol->RelativeAddress) &&
|
(RelativeAddress >= Symbol->RelativeAddress) &&
|
||||||
(RelativeAddress < NextAddress))
|
(RelativeAddress < NextAddress) &&
|
||||||
|
Symbol->RelativeAddress > AddrFound)
|
||||||
{
|
{
|
||||||
DPRINT("FN found\n");
|
DPRINT("FN found\n");
|
||||||
strcpy(FileName, Symbol->Name.Buffer);
|
strcpy(FileName, Symbol->Name.Buffer);
|
||||||
return STATUS_SUCCESS;
|
AddrFound = Symbol->RelativeAddress;
|
||||||
}
|
}
|
||||||
Symbol = NextSymbol;
|
Symbol = NextSymbol;
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT("FN not found\n");
|
DPRINT("FN not found\n");
|
||||||
|
|
||||||
return STATUS_UNSUCCESSFUL;
|
return AddrFound ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static NTSTATUS
|
static NTSTATUS
|
||||||
|
@ -484,7 +486,6 @@ LdrpGetFunctionName(IN PIMAGE_SYMBOL_INFO SymbolInfo,
|
||||||
strncpy(FunctionName, Symbol->Name.Buffer, Length);
|
strncpy(FunctionName, Symbol->Name.Buffer, Length);
|
||||||
FunctionName[Length]=0;
|
FunctionName[Length]=0;
|
||||||
AddrFound = Symbol->RelativeAddress;
|
AddrFound = Symbol->RelativeAddress;
|
||||||
/* return STATUS_SUCCESS; */
|
|
||||||
}
|
}
|
||||||
Symbol = NextSymbol;
|
Symbol = NextSymbol;
|
||||||
}
|
}
|
||||||
|
@ -501,6 +502,7 @@ LdrpGetLineNumber(IN PIMAGE_SYMBOL_INFO SymbolInfo,
|
||||||
{
|
{
|
||||||
PSYMBOL NextSymbol;
|
PSYMBOL NextSymbol;
|
||||||
ULONG_PTR NextAddress;
|
ULONG_PTR NextAddress;
|
||||||
|
ULONG_PTR AddrFound = 0;
|
||||||
PSYMBOL Symbol;
|
PSYMBOL Symbol;
|
||||||
|
|
||||||
Symbol = SymbolInfo->LineNumberSymbols.Symbols;
|
Symbol = SymbolInfo->LineNumberSymbols.Symbols;
|
||||||
|
@ -518,19 +520,20 @@ LdrpGetLineNumber(IN PIMAGE_SYMBOL_INFO SymbolInfo,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if ((Symbol->SymbolType == ST_LINENUMBER) &&
|
if ((Symbol->SymbolType == ST_LINENUMBER) &&
|
||||||
(RelativeAddress >= Symbol->RelativeAddress) &&
|
(RelativeAddress >= Symbol->RelativeAddress) &&
|
||||||
(RelativeAddress < NextAddress))
|
(RelativeAddress < NextAddress) &&
|
||||||
|
Symbol->RelativeAddress > AddrFound)
|
||||||
{
|
{
|
||||||
DPRINT("LN found\n");
|
DPRINT("LN found\n");
|
||||||
*LineNumber = Symbol->LineNumber;
|
*LineNumber = Symbol->LineNumber;
|
||||||
return STATUS_SUCCESS;
|
AddrFound = Symbol->RelativeAddress;
|
||||||
}
|
}
|
||||||
Symbol = NextSymbol;
|
Symbol = NextSymbol;
|
||||||
}
|
}
|
||||||
|
|
||||||
DPRINT("LN not found\n");
|
DPRINT("LN not found\n");
|
||||||
|
|
||||||
return STATUS_UNSUCCESSFUL;
|
return AddrFound ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
||||||
|
|
Loading…
Reference in a new issue