TianoCore EDK2 master
|
#include "Edb.h"
Go to the source code of this file.
Data Structures | |
struct | EFI_DEBUG_IMAGE_INFO_TABLE_HEADER_OLD |
Functions | |
EFI_STATUS | EdbLoadSymbolSingleEntry (IN EFI_DEBUGGER_SYMBOL_OBJECT *Object, IN CHAR8 *Name, IN CHAR8 *ObjName, IN UINTN Address, IN EFI_DEBUGGER_SYMBOL_TYPE Type) |
EFI_STATUS | EdbLoadSymbolEntryByIec (IN EFI_DEBUGGER_SYMBOL_OBJECT *Object, IN UINTN BufferSize, IN VOID *Buffer) |
EFI_STATUS | EdbLoadSymbolEntry (IN EFI_DEBUGGER_SYMBOL_OBJECT *Object, IN UINTN BufferSize, IN VOID *Buffer) |
EFI_DEBUGGER_SYMBOL_OBJECT * | EdbFindSymbolFile (IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN CHAR16 *FileName, IN OUT UINTN *Index OPTIONAL) |
UINTN | EbdFindSymbolAddress (IN UINTN Address, IN EDB_MATCH_SYMBOL_TYPE Type, OUT EFI_DEBUGGER_SYMBOL_OBJECT **RetObject, OUT EFI_DEBUGGER_SYMBOL_ENTRY **RetEntry) |
EFI_STATUS | EdbUnloadSymbol (IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN CHAR16 *FileName) |
EFI_STATUS | EdbLoadSymbol (IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN CHAR16 *FileName, IN UINTN BufferSize, IN VOID *Buffer) |
CHAR8 * | GetPdbPath (VOID *ImageBase) |
BOOLEAN | MatchPdbAndMap (IN CHAR8 *PdbFileName, IN CHAR16 *MapFileName) |
VOID | EdbFixDebugImageInfoTable (IN OUT EFI_DEBUG_IMAGE_INFO_TABLE_HEADER **DebugImageInfoTableHeader) |
EFI_STATUS | EdbPatchSymbolRVA (IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN CHAR16 *FileName, IN EDB_EBC_IMAGE_RVA_SEARCH_TYPE SearchType) |
BOOLEAN | MatchObjAndCod (IN CHAR8 *ObjFileName, IN CHAR16 *CodFileName) |
CHAR8 * | EdbLoadCodBySymbolByIec (IN CHAR8 *Name, IN VOID *Buffer, IN UINTN BufferSize, OUT UINTN *CodeBufferSize, OUT UINTN *FuncOffset) |
CHAR8 * | EdbLoadCodBySymbol (IN CHAR8 *Name, IN VOID *Buffer, IN UINTN BufferSize, OUT UINTN *CodeBufferSize, OUT UINTN *FuncOffset) |
VOID * | EdbFindCodeFromObject (IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_DEBUGGER_SYMBOL_OBJECT *Object, IN CHAR16 *FileName) |
EFI_STATUS | EdbLoadCode (IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN CHAR16 *MapFileName, IN CHAR16 *FileName, IN UINTN BufferSize, IN VOID *Buffer) |
EFI_STATUS | EdbUnloadCode (IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN CHAR16 *MapFileName, IN CHAR16 *FileName, OUT VOID **Buffer) |
EFI_STATUS | EdbAddCodeBuffer (IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN CHAR16 *MapFileName, IN CHAR16 *CodeFileName, IN UINTN SourceBufferSize, IN VOID *SourceBuffer) |
EFI_STATUS | EdbDeleteCodeBuffer (IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN CHAR16 *MapFileName, IN CHAR16 *CodeFileName, IN VOID *SourceBuffer) |
CHAR8 * | FindSymbolStr (IN UINTN Address) |
UINTN | EdbGetLineNumberAndOffsetFromThisLine (IN VOID *Line, OUT UINTN *Offset) |
UINTN | EdbGetLineNumberFromCode (IN EFI_DEBUGGER_SYMBOL_ENTRY *Entry, IN UINTN FuncOffset, IN EDB_EBC_LINE_SEARCH_TYPE SearchType) |
VOID * | EdbGetSourceStrFromCodeByLine (IN EFI_DEBUGGER_SYMBOL_ENTRY *Entry, IN UINTN LineNumber, IN VOID **FuncEnd) |
VOID * | EdbGetSourceStrFromCode (IN EFI_DEBUGGER_SYMBOL_ENTRY *Entry, IN UINTN FuncOffset, IN VOID **FuncEnd) |
UINTN | EdbPrintSource (IN UINTN Address, IN BOOLEAN IsPrint) |
VOID | GetMapfileAndSymbol (IN CHAR16 *Symbol, OUT CHAR16 **MapfileName, OUT CHAR16 **SymbolName) |
EFI_STATUS | Symboltoi (IN CHAR16 *Symbol, OUT UINTN *Address) |
Variables | |
EFI_DEBUG_IMAGE_INFO_TABLE_HEADER | mDebugImageInfoTableHeader |
Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file EdbSymbol.c.
enum EDB_EBC_COD_PARSE_STATE |
Definition at line 1170 of file EdbSymbol.c.
enum EDB_EBC_LINE_SEARCH_TYPE |
Definition at line 1858 of file EdbSymbol.c.
enum EDB_EBC_MAP_PARSE_STATE |
Definition at line 79 of file EdbSymbol.c.
enum EDB_EBC_SYMBOL_PARSE_STATE |
Definition at line 91 of file EdbSymbol.c.
UINTN EbdFindSymbolAddress | ( | IN UINTN | Address, |
IN EDB_MATCH_SYMBOL_TYPE | Type, | ||
OUT EFI_DEBUGGER_SYMBOL_OBJECT ** | RetObject, | ||
OUT EFI_DEBUGGER_SYMBOL_ENTRY ** | RetEntry | ||
) |
Find symbol by address.
Address | - Symbol address |
Type | - Search type |
RetObject | - Symbol object |
RetEntry | - Symbol entry |
Definition at line 477 of file EdbSymbol.c.
EFI_STATUS EdbAddCodeBuffer | ( | IN EFI_DEBUGGER_PRIVATE_DATA * | DebuggerPrivate, |
IN CHAR16 * | MapFileName, | ||
IN CHAR16 * | CodeFileName, | ||
IN UINTN | SourceBufferSize, | ||
IN VOID * | SourceBuffer | ||
) |
Add code buffer.
DebuggerPrivate | - EBC Debugger private data structure |
MapFileName | - Symbol file name |
CodeFileName | - Code file name |
SourceBufferSize- | Code buffer size |
SourceBuffer | - Code buffer |
EFI_SUCCESS | - CodeBuffer added successfully |
Definition at line 1630 of file EdbSymbol.c.
EFI_STATUS EdbDeleteCodeBuffer | ( | IN EFI_DEBUGGER_PRIVATE_DATA * | DebuggerPrivate, |
IN CHAR16 * | MapFileName, | ||
IN CHAR16 * | CodeFileName, | ||
IN VOID * | SourceBuffer | ||
) |
Delete code buffer.
DebuggerPrivate | - EBC Debugger private data structure |
MapFileName | - Symbol file name |
CodeFileName | - Code file name |
SourceBuffer | - Code buffer |
EFI_SUCCESS | - CodeBuffer deleted successfully |
Definition at line 1674 of file EdbSymbol.c.
VOID * EdbFindCodeFromObject | ( | IN EFI_DEBUGGER_PRIVATE_DATA * | DebuggerPrivate, |
IN EFI_DEBUGGER_SYMBOL_OBJECT * | Object, | ||
IN CHAR16 * | FileName | ||
) |
Find code from object.
DebuggerPrivate | EBC Debugger private data structure |
Object | - Symbol object |
FileName | - File name |
Definition at line 1375 of file EdbSymbol.c.
EFI_DEBUGGER_SYMBOL_OBJECT * EdbFindSymbolFile | ( | IN EFI_DEBUGGER_PRIVATE_DATA * | DebuggerPrivate, |
IN CHAR16 * | FileName, | ||
IN OUT UINTN *Index | OPTIONAL | ||
) |
Find symbol file by name.
DebuggerPrivate | - EBC Debugger private data structure |
FileName | - Symbol file name |
Index | - Symbol file index |
Definition at line 434 of file EdbSymbol.c.
VOID EdbFixDebugImageInfoTable | ( | IN OUT EFI_DEBUG_IMAGE_INFO_TABLE_HEADER ** | DebugImageInfoTableHeader | ) |
For compatibility consideration, we handle 2 cases:
1) IA32: Old: New: +---------------------—+ +---------------------—+ | EfiDebugImageInfoTable | | UpdateStatus | +---------------------—+ +---------------------—+ | UpdateStatus | | TableSize | +---------------------—+ +---------------------—+ | TableSize | | EfiDebugImageInfoTable | +---------------------—+ +---------------------—+
2) X64 and IPF: Old: New: +---------------------—+ +---------------------—+ | EfiDebugImageInfoTable | | UpdateStatus | | | +---------------------—+ | | | TableSize | +---------------------—+ +---------------------—+ | UpdateStatus | | EfiDebugImageInfoTable | +---------------------—+ | | | TableSize | | | +---------------------—+ +---------------------—+
DebugImageInfoTableHeader | Point to the EFI_DEBUG_IMAGE_INFO_TABLE_HEADER structure. |
Definition at line 959 of file EdbSymbol.c.
Get line number and offset from this line in code file.
Line | - Line buffer in code file |
Offset | - Offset to functin entry |
Definition at line 1782 of file EdbSymbol.c.
UINTN EdbGetLineNumberFromCode | ( | IN EFI_DEBUGGER_SYMBOL_ENTRY * | Entry, |
IN UINTN | FuncOffset, | ||
IN EDB_EBC_LINE_SEARCH_TYPE | SearchType | ||
) |
Get line number from this code file.
Entry | - Symbol entry |
FuncOffset | - Offset to functin entry |
SearchType | - Search type for the code |
Definition at line 1877 of file EdbSymbol.c.
VOID * EdbGetSourceStrFromCode | ( | IN EFI_DEBUGGER_SYMBOL_ENTRY * | Entry, |
IN UINTN | FuncOffset, | ||
IN VOID ** | FuncEnd | ||
) |
Get source string from this code file.
Entry | - Symbol entry |
FuncOffset | - Offset to functin entry |
FuncEnd | - Function end |
Funtion | start |
Definition at line 2055 of file EdbSymbol.c.
VOID * EdbGetSourceStrFromCodeByLine | ( | IN EFI_DEBUGGER_SYMBOL_ENTRY * | Entry, |
IN UINTN | LineNumber, | ||
IN VOID ** | FuncEnd | ||
) |
Get the source string from this code file by line.
Entry | - Symbol entry |
LineNumber | - line number |
FuncEnd | - Function end |
Definition at line 1988 of file EdbSymbol.c.
CHAR8 * EdbLoadCodBySymbol | ( | IN CHAR8 * | Name, |
IN VOID * | Buffer, | ||
IN UINTN | BufferSize, | ||
OUT UINTN * | CodeBufferSize, | ||
OUT UINTN * | FuncOffset | ||
) |
Load code by symbol.
Name | - Symbol file name |
Buffer | - Symbol file buffer |
BufferSize | - Symbol file buffer size |
CodeBufferSize | - Code buffer size |
FuncOffset | - Code funcion offset |
Definition at line 1348 of file EdbSymbol.c.
CHAR8 * EdbLoadCodBySymbolByIec | ( | IN CHAR8 * | Name, |
IN VOID * | Buffer, | ||
IN UINTN | BufferSize, | ||
OUT UINTN * | CodeBufferSize, | ||
OUT UINTN * | FuncOffset | ||
) |
The following code depends on the COD file generated by IEC compiler. Load code by symbol by Iec.
Name | - Symbol file name |
Buffer | - Symbol file buffer |
BufferSize | - Symbol file buffer size |
CodeBufferSize | - Code buffer size |
FuncOffset | - Code funcion offset |
Definition at line 1198 of file EdbSymbol.c.
EFI_STATUS EdbLoadCode | ( | IN EFI_DEBUGGER_PRIVATE_DATA * | DebuggerPrivate, |
IN CHAR16 * | MapFileName, | ||
IN CHAR16 * | FileName, | ||
IN UINTN | BufferSize, | ||
IN VOID * | Buffer | ||
) |
Load code.
DebuggerPrivate | - EBC Debugger private data structure |
MapFileName | - Symbol file name |
FileName | - Code file name |
BufferSize | - Code file buffer size |
Buffer | - Code file buffer |
EFI_SUCCESS | - Code loaded successfully |
Definition at line 1438 of file EdbSymbol.c.
EFI_STATUS EdbLoadSymbol | ( | IN EFI_DEBUGGER_PRIVATE_DATA * | DebuggerPrivate, |
IN CHAR16 * | FileName, | ||
IN UINTN | BufferSize, | ||
IN VOID * | Buffer | ||
) |
Load symbol file by name.
DebuggerPrivate | - EBC Debugger private data structure |
FileName | - Symbol file name |
BufferSize | - Symbol file buffer size |
Buffer | - Symbol file buffer |
EFI_SUCCESS | - load symbol successfully |
Definition at line 693 of file EdbSymbol.c.
EFI_STATUS EdbLoadSymbolEntry | ( | IN EFI_DEBUGGER_SYMBOL_OBJECT * | Object, |
IN UINTN | BufferSize, | ||
IN VOID * | Buffer | ||
) |
Load symbol entry.
Object | - Symbol file object |
BufferSize | - Symbol file buffer size |
Buffer | - Symbol file buffer |
EFI_SUCCESS | - add symbol entry successfully |
Definition at line 407 of file EdbSymbol.c.
EFI_STATUS EdbLoadSymbolEntryByIec | ( | IN EFI_DEBUGGER_SYMBOL_OBJECT * | Object, |
IN UINTN | BufferSize, | ||
IN VOID * | Buffer | ||
) |
The following code depends on the MAP file generated by IEC compiler (actually Microsoft linker).
EbcTest
Timestamp is 45b02718 (Fri Jan 19 10:04:08 2007)
Preferred load address is 10000000
Start Length Name Class 0001:00000000 00000370H .text CODE 0002:00000000 00000030H _VARBSS_INIT CODE 0003:00000000 00000004H .CRT$TSA DATA 0003:00000004 00000004H .CRT$TSC DATA 0003:00000008 00000004H .CRT$X DATA 0003:0000000c 00000008H .CRT$XCU DATA 0003:00000014 00000004H .CRT$Z DATA 0003:00000020 0000001cH .rdata DATA 0003:0000003c 00000000H .edata DATA 0003:0000003c 00000056H .rdata$debug DATA 0004:00000000 00000070H .data DATA 0004:00000070 00000020H .bss DATA
Address Publics by Value Rva+Base Lib:Object
0000:00000000 ___safe_se_handler_table 00000000 <absolute> 0000:00000000 ___safe_se_handler_count 00000000 <absolute> 0001:00000042 TestSubRoutine 10000442 f EbcTest.obj 0001:0000011a EfiMain 1000051a f EbcTest.obj 0001:00000200 TestSubRoutineSub 10000600 f EbcTestSub.obj 0001:00000220 EfiStart 10000620 f EbcLib:EbcLib.obj 0002:00000000 varbss_init_C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest$c45b02717 10000800 f EbcTest.obj 0002:00000020 varbss_init_C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTestSub$c45af77f3 10000820 f EbcTestSub.obj 0003:00000000 CrtThunkBegin 10000a00 EbcLib:EbcLib.obj 0003:00000004 CrtThunkEnd 10000a04 EbcLib:EbcLib.obj 0003:00000008 CrtBegin 10000a08 EbcLib:EbcLib.obj 0003:00000014 CrtEnd 10000a14 EbcLib:EbcLib.obj 0004:00000070 TestStr 10000c70 EbcTest.obj 0004:00000078 TestVariable1 10000c78 EbcTest.obj 0004:00000080 TestSubVariableSub 10000c80 EbcTestSub.obj
entry point at 0001:00000220
Static symbols
Load symbol entry by Iec.
Object | - Symbol file object |
BufferSize | - Symbol file buffer size |
Buffer | - Symbol file buffer |
EFI_SUCCESS | - add symbol entry successfully |
Definition at line 165 of file EdbSymbol.c.
EFI_STATUS EdbLoadSymbolSingleEntry | ( | IN EFI_DEBUGGER_SYMBOL_OBJECT * | Object, |
IN CHAR8 * | Name, | ||
IN CHAR8 * | ObjName, | ||
IN UINTN | Address, | ||
IN EFI_DEBUGGER_SYMBOL_TYPE | Type | ||
) |
Load single symbol entry.
Object | - Symbol file object |
Name | - Symbol name |
ObjName | - Object name |
Address | - Symbol address |
Type | - Symbol type |
EFI_SUCCESS | - add single symbol entry successfully |
Definition at line 25 of file EdbSymbol.c.
EFI_STATUS EdbPatchSymbolRVA | ( | IN EFI_DEBUGGER_PRIVATE_DATA * | DebuggerPrivate, |
IN CHAR16 * | FileName, | ||
IN EDB_EBC_IMAGE_RVA_SEARCH_TYPE | SearchType | ||
) |
Patch symbol RVA.
DebuggerPrivate | - EBC Debugger private data structure |
FileName | - Symbol file name |
SearchType | - Search type for Object |
EFI_SUCCESS | - Patch symbol RVA successfully |
EFI_NOT_FOUND | - Symbol RVA base not found |
Definition at line 997 of file EdbSymbol.c.
Print source.
Address | - Instruction address |
IsPrint | - Whether need to print |
1 | - find the source |
0 | - not find the source |
Definition at line 2086 of file EdbSymbol.c.
EFI_STATUS EdbUnloadCode | ( | IN EFI_DEBUGGER_PRIVATE_DATA * | DebuggerPrivate, |
IN CHAR16 * | MapFileName, | ||
IN CHAR16 * | FileName, | ||
OUT VOID ** | Buffer | ||
) |
Unload code.
DebuggerPrivate | - EBC Debugger private data structure |
MapFileName | - Symbol file name |
FileName | - Code file name |
Buffer | - Code file buffer |
EFI_SUCCESS | - Code unloaded successfully |
Definition at line 1554 of file EdbSymbol.c.
EFI_STATUS EdbUnloadSymbol | ( | IN EFI_DEBUGGER_PRIVATE_DATA * | DebuggerPrivate, |
IN CHAR16 * | FileName | ||
) |
Unload symbol file by name.
DebuggerPrivate | - EBC Debugger private data structure |
FileName | - Symbol file name |
EFI_SUCCESS | - unload symbol successfully |
Definition at line 614 of file EdbSymbol.c.
Find the symbol string according to address.
Address | - Symbol address |
Definition at line 1733 of file EdbSymbol.c.
VOID GetMapfileAndSymbol | ( | IN CHAR16 * | Symbol, |
OUT CHAR16 ** | MapfileName, | ||
OUT CHAR16 ** | SymbolName | ||
) |
Get Mapfile and SymbolName from one symbol format: [MapFileName:]SymbolName.
Symbol | - whole Symbol name |
MapfileName | - the mapfile name in the symbol |
SymbolName | - the symbol name in the symbol |
Definition at line 2183 of file EdbSymbol.c.
CHAR8 * GetPdbPath | ( | VOID * | ImageBase | ) |
Located PDB path name in PE image.
ImageBase | - base of PE to search |
Definition at line 773 of file EdbSymbol.c.
Check whether OBJ file and COD file have same name.
ObjFileName | - OBJ file name |
CodFileName | - COD file name |
TRUE | - OBJ and COD file name match |
FALSE | - OBJ and COD file name not match |
Definition at line 1125 of file EdbSymbol.c.
Check whether PDB file and MAP file have same name.
PdbFileName | - PDB file name |
MapFileName | - MAP file name |
TRUE | - PDB and MAP file name match |
FALSE | - PDB and MAP file name not match |
Definition at line 875 of file EdbSymbol.c.
EFI_STATUS Symboltoi | ( | IN CHAR16 * | Symbol, |
OUT UINTN * | Address | ||
) |
Convert a symbol to an address.
Symbol | - Symbol name |
Address | - Symbol address |
EFI_SUCCESS | - symbol found and address returned. |
EFI_NOT_FOUND | - symbol not found |
EFI_NO_MAPPING | - duplicated symbol not found |
Definition at line 2222 of file EdbSymbol.c.
EFI_DEBUG_IMAGE_INFO_TABLE_HEADER mDebugImageInfoTableHeader |
Definition at line 928 of file EdbSymbol.c.