MdeModulePkg/EbcDxe: Add comments for functions

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Pete Batard <pete@akeo.ie>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Jiewen.yao@intel.com
This commit is contained in:
Dandan Bi 2016-12-05 11:33:52 +08:00 committed by Star Zeng
parent 532daaed0d
commit d138a2e987
9 changed files with 1157 additions and 15 deletions

View File

@ -18,6 +18,11 @@
#include "EdbCommon.h" #include "EdbCommon.h"
#include "EdbSupport.h" #include "EdbSupport.h"
/**
The function that displays the utility usage message.
**/
VOID VOID
PrintUsage ( PrintUsage (
VOID VOID
@ -38,6 +43,13 @@ PrintUsage (
return; return;
} }
/**
The function is to show some information.
@param DebuggerConfiguration Point to the EFI_DEBUGGER_CONFIGURATION_PROTOCOL.
**/
VOID VOID
EdbShowInfo ( EdbShowInfo (
EFI_DEBUGGER_CONFIGURATION_PROTOCOL *DebuggerConfiguration EFI_DEBUGGER_CONFIGURATION_PROTOCOL *DebuggerConfiguration
@ -47,6 +59,15 @@ EdbShowInfo (
return ; return ;
} }
/**
EdbConfigBreak function.
@param DebuggerConfiguration Point to the EFI_DEBUGGER_CONFIGURATION_PROTOCOL.
@param Command Point to the command.
@param CommandArg The argument for this command.
**/
VOID VOID
EdbConfigBreak ( EdbConfigBreak (
EFI_DEBUGGER_CONFIGURATION_PROTOCOL *DebuggerConfiguration, EFI_DEBUGGER_CONFIGURATION_PROTOCOL *DebuggerConfiguration,

View File

@ -33,27 +33,69 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define EDB_INSTRUCTION_CONTENT_MAX_LENGTH 30 #define EDB_INSTRUCTION_CONTENT_MAX_LENGTH 30
#define EDB_INSTRUCTION_CONTENT_MAX_SIZE (EDB_INSTRUCTION_CONTENT_MAX_LENGTH * sizeof(CHAR16)) #define EDB_INSTRUCTION_CONTENT_MAX_SIZE (EDB_INSTRUCTION_CONTENT_MAX_LENGTH * sizeof(CHAR16))
/**
Set offset for Instruction name and content.
@param InstructionNameOffset - Instruction name offset
@param InstructionContentOffset - Instruction content offset
**/
VOID VOID
EdbSetOffset ( EdbSetOffset (
IN UINTN InstructionNameOffset, IN UINTN InstructionNameOffset,
IN UINTN InstructionContentOffset IN UINTN InstructionContentOffset
); );
/**
Pre instruction string construction.
@return Instruction string
**/
CHAR16 * CHAR16 *
EdbPreInstructionString ( EdbPreInstructionString (
VOID VOID
); );
/**
Post instruction string construction.
@return Instruction string
**/
CHAR16 * CHAR16 *
EdbPostInstructionString ( EdbPostInstructionString (
VOID VOID
); );
/**
Print the instruction name.
@param Name - instruction name
@return Instruction name offset
**/
UINTN UINTN
EdbPrintInstructionName ( EdbPrintInstructionName (
IN CHAR16 *Name IN CHAR16 *Name
); );
/**
Get Sign, NaturalUnits, and ConstantUnits of the WORD data.
@param Data16 - WORD data
@param NaturalUnits - Natural Units of the WORD
@param ConstantUnits - Constant Units of the WORD
@return Sign value of WORD
**/
BOOLEAN BOOLEAN
EdbGetNaturalIndex16 ( EdbGetNaturalIndex16 (
IN UINT16 Data16, IN UINT16 Data16,
@ -61,6 +103,17 @@ EdbGetNaturalIndex16 (
OUT UINTN *ConstantUnits OUT UINTN *ConstantUnits
); );
/**
Get Sign, NaturalUnits, and ConstantUnits of the DWORD data.
@param Data32 - DWORD data
@param NaturalUnits - Natural Units of the DWORD
@param ConstantUnits - Constant Units of the DWORD
@return Sign value of DWORD
**/
BOOLEAN BOOLEAN
EdbGetNaturalIndex32 ( EdbGetNaturalIndex32 (
IN UINT32 Data32, IN UINT32 Data32,
@ -68,6 +121,17 @@ EdbGetNaturalIndex32 (
OUT UINTN *ConstantUnits OUT UINTN *ConstantUnits
); );
/**
Get Sign, NaturalUnits, and ConstantUnits of the QWORD data.
@param Data64 - QWORD data
@param NaturalUnits - Natural Units of the QWORD
@param ConstantUnits - Constant Units of the QWORD
@return Sign value of QWORD
**/
BOOLEAN BOOLEAN
EdbGetNaturalIndex64 ( EdbGetNaturalIndex64 (
IN UINT64 Data64, IN UINT64 Data64,
@ -75,41 +139,115 @@ EdbGetNaturalIndex64 (
OUT UINT64 *ConstantUnits OUT UINT64 *ConstantUnits
); );
/**
Print the hexical WORD raw index data to instruction content.
@param Data16 - WORD data
@return Instruction content offset
**/
UINTN UINTN
EdbPrintRawIndexData16 ( EdbPrintRawIndexData16 (
IN UINT16 Data16 IN UINT16 Data16
); );
/**
Print the hexical DWORD raw index data to instruction content.
@param Data32 - DWORD data
@return Instruction content offset
**/
UINTN UINTN
EdbPrintRawIndexData32 ( EdbPrintRawIndexData32 (
IN UINT32 Data32 IN UINT32 Data32
); );
/**
Print the hexical QWORD raw index data to instruction content.
@param Data64 - QWORD data
@return Instruction content offset
**/
UINTN UINTN
EdbPrintRawIndexData64 ( EdbPrintRawIndexData64 (
IN UINT64 Data64 IN UINT64 Data64
); );
/**
Print register 1 in operands.
@param Operands - instruction operands
@return Instruction content offset
**/
UINTN UINTN
EdbPrintRegister1 ( EdbPrintRegister1 (
IN UINT8 Operands IN UINT8 Operands
); );
/**
Print register 2 in operands.
@param Operands - instruction operands
@return Instruction content offset
**/
UINTN UINTN
EdbPrintRegister2 ( EdbPrintRegister2 (
IN UINT8 Operands IN UINT8 Operands
); );
/**
Print dedicated register 1 in operands.
@param Operands - instruction operands
@return Instruction content offset
**/
UINTN UINTN
EdbPrintDedicatedRegister1 ( EdbPrintDedicatedRegister1 (
IN UINT8 Operands IN UINT8 Operands
); );
/**
Print dedicated register 2 in operands.
@param Operands - instruction operands
@return Instruction content offset
**/
UINTN UINTN
EdbPrintDedicatedRegister2 ( EdbPrintDedicatedRegister2 (
IN UINT8 Operands IN UINT8 Operands
); );
/**
Print the hexical UINTN index data to instruction content.
@param Sign - Signed bit of UINTN data
@param NaturalUnits - natural units of UINTN data
@param ConstantUnits - natural units of UINTN data
@return Instruction content offset
**/
UINTN UINTN
EdbPrintIndexData ( EdbPrintIndexData (
IN BOOLEAN Sign, IN BOOLEAN Sign,
@ -117,6 +255,17 @@ EdbPrintIndexData (
IN UINTN ConstantUnits IN UINTN ConstantUnits
); );
/**
Print the hexical QWORD index data to instruction content.
@param Sign - Signed bit of QWORD data
@param NaturalUnits - natural units of QWORD data
@param ConstantUnits - natural units of QWORD data
@return Instruction content offset
**/
UINTN UINTN
EdbPrintIndexData64 ( EdbPrintIndexData64 (
IN BOOLEAN Sign, IN BOOLEAN Sign,
@ -124,108 +273,297 @@ EdbPrintIndexData64 (
IN UINT64 ConstantUnits IN UINT64 ConstantUnits
); );
/**
Print the hexical BYTE immediate data to instruction content.
@param Data - BYTE data
@return Instruction content offset
**/
UINTN UINTN
EdbPrintImmData8 ( EdbPrintImmData8 (
IN UINT8 Data IN UINT8 Data
); );
/**
Print the hexical WORD immediate data to instruction content.
@param Data - WORD data
@return Instruction content offset
**/
UINTN UINTN
EdbPrintImmData16 ( EdbPrintImmData16 (
IN UINT16 Data IN UINT16 Data
); );
/**
Print the hexical DWORD immediate data to instruction content.
@param Data - DWORD data
@return Instruction content offset
**/
UINTN UINTN
EdbPrintImmData32 ( EdbPrintImmData32 (
IN UINT32 Data IN UINT32 Data
); );
/**
Print the hexical QWORD immediate data to instruction content.
@param Data - QWORD data
@return Instruction content offset
**/
UINTN UINTN
EdbPrintImmData64 ( EdbPrintImmData64 (
IN UINT64 Data IN UINT64 Data
); );
/**
Print the decimal UINTN immediate data to instruction content.
@param Data - UINTN data
@return Instruction content offset
**/
UINTN UINTN
EdbPrintImmDatan ( EdbPrintImmDatan (
IN UINTN Data IN UINTN Data
); );
/**
Print the decimal QWORD immediate data to instruction content.
@param Data64 - QWORD data
@return Instruction content offset
**/
UINTN UINTN
EdbPrintImmData64n ( EdbPrintImmData64n (
IN UINT64 Data64 IN UINT64 Data64
); );
/**
Print the hexical BYTE to instruction content.
@param Data8 - BYTE data
@return Instruction content offset
**/
UINTN UINTN
EdbPrintData8 ( EdbPrintData8 (
IN UINT8 Data8 IN UINT8 Data8
); );
/**
Print the hexical WORD to instruction content.
@param Data16 - WORD data
@return Instruction content offset
**/
UINTN UINTN
EdbPrintData16 ( EdbPrintData16 (
IN UINT16 Data16 IN UINT16 Data16
); );
/**
Print the hexical DWORD to instruction content.
@param Data32 - DWORD data
@return Instruction content offset
**/
UINTN UINTN
EdbPrintData32 ( EdbPrintData32 (
IN UINT32 Data32 IN UINT32 Data32
); );
/**
Print the hexical QWORD to instruction content.
@param Data64 - QWORD data
@return Instruction content offset
**/
UINTN UINTN
EdbPrintData64 ( EdbPrintData64 (
IN UINT64 Data64 IN UINT64 Data64
); );
/**
Print the decimal unsigned UINTN to instruction content.
@param Data - unsigned UINTN data
@return Instruction content offset
**/
UINTN UINTN
EdbPrintDatan ( EdbPrintDatan (
IN UINTN Data IN UINTN Data
); );
/**
Print the decimal unsigned QWORD to instruction content.
@param Data64 - unsigned QWORD data
@return Instruction content offset
**/
UINTN UINTN
EdbPrintData64n ( EdbPrintData64n (
IN UINT64 Data64 IN UINT64 Data64
); );
/**
Print the decimal signed BYTE to instruction content.
@param Data8 - signed BYTE data
@return Instruction content offset
**/
UINTN UINTN
EdbPrintData8s ( EdbPrintData8s (
IN UINT8 Data8 IN UINT8 Data8
); );
/**
Print the decimal signed WORD to instruction content.
@param Data16 - signed WORD data
@return Instruction content offset
**/
UINTN UINTN
EdbPrintData16s ( EdbPrintData16s (
IN UINT16 Data16 IN UINT16 Data16
); );
/**
Print the decimal signed DWORD to instruction content.
@param Data32 - signed DWORD data
@return Instruction content offset
**/
UINTN UINTN
EdbPrintData32s ( EdbPrintData32s (
IN UINT32 Data32 IN UINT32 Data32
); );
/**
Print the decimal signed QWORD to instruction content.
@param Data64 - signed QWORD data
@return Instruction content offset
**/
UINTN UINTN
EdbPrintData64s ( EdbPrintData64s (
IN UINT64 Data64 IN UINT64 Data64
); );
/**
Print the comma to instruction content.
@return Instruction content offset
**/
UINTN UINTN
EdbPrintComma ( EdbPrintComma (
VOID VOID
); );
/**
Find the symbol string according to address, then print it.
@param Address - instruction address
@retval 1 - symbol string is found and printed
@retval 0 - symbol string not found
**/
UINTN UINTN
EdbFindAndPrintSymbol ( EdbFindAndPrintSymbol (
IN UINTN Address IN UINTN Address
); );
/**
Print the EBC byte code.
@param InstructionAddress - instruction address
@param InstructionNumber - instruction number
**/
VOID VOID
EdbPrintRaw ( EdbPrintRaw (
IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_PHYSICAL_ADDRESS InstructionAddress,
IN UINTN InstructionNumber IN UINTN InstructionNumber
); );
/**
Print the EBC asm code.
@param DebuggerPrivate - EBC Debugger private data structure
@param SystemContext - EBC system context.
@retval EFI_SUCCESS - show disasm successfully
**/
EFI_STATUS EFI_STATUS
EdbShowDisasm ( EdbShowDisasm (
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN EFI_SYSTEM_CONTEXT SystemContext IN EFI_SYSTEM_CONTEXT SystemContext
); );
/**
Get register value accroding to the system context, and register index.
@param SystemContext - EBC system context.
@param Index - EBC register index
@return register value
**/
UINT64 UINT64
GetRegisterValue ( GetRegisterValue (
IN EFI_SYSTEM_CONTEXT SystemContext, IN EFI_SYSTEM_CONTEXT SystemContext,

View File

@ -278,6 +278,14 @@ EbcDebuggerPushStepEntry (
} }
} }
/**
Notify the callback function when an event is triggered.
@param Event Indicates the event that invoke this function.
@param Context Indicates the calling context.
**/
VOID VOID
EFIAPI EFIAPI
EbcDebuggerBreakEventFunc ( EbcDebuggerBreakEventFunc (
@ -467,7 +475,6 @@ EbcDebuggerHookUnload (
@param Handle - The EbcImage handle. @param Handle - The EbcImage handle.
**/ **/
VOID VOID
EbcDebuggerHookEbcUnloadImage ( EbcDebuggerHookEbcUnloadImage (
IN EFI_HANDLE Handle IN EFI_HANDLE Handle

View File

@ -25,36 +25,83 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define EFI_DEBUG_MAX_PRINT_BUFFER (80 * 4) #define EFI_DEBUG_MAX_PRINT_BUFFER (80 * 4)
/**
Convert hex string to uint.
@param Str - The string
**/
UINTN UINTN
EFIAPI EFIAPI
Xtoi ( Xtoi (
CHAR16 *Str CHAR16 *Str
); );
/**
Convert hex string to uint.
@param Str - The string
**/
UINT64 UINT64
EFIAPI EFIAPI
LXtoi ( LXtoi (
CHAR16 *Str CHAR16 *Str
); );
/**
Convert hex string to uint.
@param Str - The string
**/
UINTN UINTN
EFIAPI EFIAPI
Atoi ( Atoi (
CHAR16 *Str CHAR16 *Str
); );
/**
Convert hex string to uint.
@param Str - The string
**/
UINTN UINTN
EFIAPI EFIAPI
AsciiXtoi ( AsciiXtoi (
CHAR8 *Str CHAR8 *Str
); );
/**
Convert hex string to uint.
@param Str - The string
**/
UINTN UINTN
EFIAPI EFIAPI
AsciiAtoi ( AsciiAtoi (
CHAR8 *Str CHAR8 *Str
); );
/**
Compare the Unicode and Ascii string pointed by String to the string pointed by String2.
@param String - Unicode String to process
@param String2 - Ascii string to process
@return Return a positive integer if String is lexicall greater than String2; Zero if
the two strings are identical; and a negative interger if String is lexically
less than String2.
**/
INTN INTN
EFIAPI EFIAPI
StrCmpUnicodeAndAscii ( StrCmpUnicodeAndAscii (
@ -62,6 +109,18 @@ StrCmpUnicodeAndAscii (
IN CHAR8 *String2 IN CHAR8 *String2
); );
/**
Compare the Unicode string pointed by String to the string pointed by String2.
@param String - Unicode String to process
@param String2 - Unicode string to process
@return Return a positive integer if String is lexically greater than String2; Zero if
the two strings are identical; and a negative integer if String is lexically
less than String2.
**/
INTN INTN
EFIAPI EFIAPI
StriCmp ( StriCmp (
@ -69,6 +128,18 @@ StriCmp (
IN CHAR16 *String2 IN CHAR16 *String2
); );
/**
Compare the Unicode and Ascii string pointed by String to the string pointed by String2.
@param String - Unicode String to process
@param String2 - Ascii string to process
@return Return a positive integer if String is lexically greater than String2; Zero if
the two strings are identical; and a negative integer if String is lexically
less than String2.
**/
INTN INTN
EFIAPI EFIAPI
StriCmpUnicodeAndAscii ( StriCmpUnicodeAndAscii (
@ -76,6 +147,14 @@ StriCmpUnicodeAndAscii (
IN CHAR8 *String2 IN CHAR8 *String2
); );
/**
Verify if the string is end with the sub string.
@param Str - The string where to search the sub string
@param SubStr - The substring.
**/
BOOLEAN BOOLEAN
EFIAPI EFIAPI
StrEndWith ( StrEndWith (
@ -83,12 +162,26 @@ StrEndWith (
IN CHAR16 *SubStr IN CHAR16 *SubStr
); );
/**
Duplicate a string.
@param Src The string to be duplicated.
**/
CHAR16 * CHAR16 *
EFIAPI EFIAPI
StrDuplicate ( StrDuplicate (
IN CHAR16 *Src IN CHAR16 *Src
); );
/**
Find the next token after one or more specified characters.
@param String Point to the string where to find the substring.
@param CharSet Point to the string to be found.
**/
CHAR16 * CHAR16 *
EFIAPI EFIAPI
StrGetNewTokenLine ( StrGetNewTokenLine (
@ -96,12 +189,27 @@ StrGetNewTokenLine (
IN CHAR16 *CharSet IN CHAR16 *CharSet
); );
/**
Find the next token after one or more specified characters.
@param CharSet Point to the string to be found.
**/
CHAR16 * CHAR16 *
EFIAPI EFIAPI
StrGetNextTokenLine ( StrGetNextTokenLine (
IN CHAR16 *CharSet IN CHAR16 *CharSet
); );
/**
Find the next token after one specificed characters.
@param String Point to the string where to find the substring.
@param CharSet Point to the string to be found.
**/
CHAR16 * CHAR16 *
EFIAPI EFIAPI
StrGetNewTokenField ( StrGetNewTokenField (
@ -109,12 +217,27 @@ StrGetNewTokenField (
IN CHAR16 *CharSet IN CHAR16 *CharSet
); );
/**
Find the next token after one specificed characters.
@param CharSet Point to the string to be found.
**/
CHAR16 * CHAR16 *
EFIAPI EFIAPI
StrGetNextTokenField ( StrGetNextTokenField (
IN CHAR16 *CharSet IN CHAR16 *CharSet
); );
/**
Patch a character to the end of a string.
@param Buffer The string to be patched.
@param Patch The patch character.
**/
VOID VOID
EFIAPI EFIAPI
PatchForStrTokenAfter ( PatchForStrTokenAfter (
@ -122,6 +245,13 @@ PatchForStrTokenAfter (
IN CHAR16 Patch IN CHAR16 Patch
); );
/**
Patch a character at the beginning of a string.
@param Buffer The string to be patched.
@param Patch The patch character.
**/
VOID VOID
EFIAPI EFIAPI
PatchForStrTokenBefore ( PatchForStrTokenBefore (
@ -129,6 +259,14 @@ PatchForStrTokenBefore (
IN CHAR16 Patch IN CHAR16 Patch
); );
/**
Find the next token after one or more specified characters.
@param String Point to the string where to find the substring.
@param CharSet Point to the string to be found.
**/
CHAR8 * CHAR8 *
EFIAPI EFIAPI
AsciiStrGetNewTokenLine ( AsciiStrGetNewTokenLine (
@ -136,12 +274,27 @@ AsciiStrGetNewTokenLine (
IN CHAR8 *CharSet IN CHAR8 *CharSet
); );
/**
Find the next token after one or more specified characters.
@param CharSet Point to the string to be found.
**/
CHAR8 * CHAR8 *
EFIAPI EFIAPI
AsciiStrGetNextTokenLine ( AsciiStrGetNextTokenLine (
IN CHAR8 *CharSet IN CHAR8 *CharSet
); );
/**
Find the next token after one specificed characters.
@param String Point to the string where to find the substring.
@param CharSet Point to the string to be found.
**/
CHAR8 * CHAR8 *
EFIAPI EFIAPI
AsciiStrGetNewTokenField ( AsciiStrGetNewTokenField (
@ -149,12 +302,27 @@ AsciiStrGetNewTokenField (
IN CHAR8 *CharSet IN CHAR8 *CharSet
); );
/**
Find the next token after one specificed characters.
@param CharSet Point to the string to be found.
**/
CHAR8 * CHAR8 *
EFIAPI EFIAPI
AsciiStrGetNextTokenField ( AsciiStrGetNextTokenField (
IN CHAR8 *CharSet IN CHAR8 *CharSet
); );
/**
Patch a character to the end of a string.
@param Buffer The string to be patched.
@param Patch The patch character.
**/
VOID VOID
EFIAPI EFIAPI
PatchForAsciiStrTokenAfter ( PatchForAsciiStrTokenAfter (
@ -162,6 +330,13 @@ PatchForAsciiStrTokenAfter (
IN CHAR8 Patch IN CHAR8 Patch
); );
/**
Patch a character at the beginning of a string.
@param Buffer The string to be patched.
@param Patch The patch character.
**/
VOID VOID
EFIAPI EFIAPI
PatchForAsciiStrTokenBefore ( PatchForAsciiStrTokenBefore (
@ -170,7 +345,14 @@ PatchForAsciiStrTokenBefore (
); );
/** /**
Shell Library. Shell Library.
Get user input.
@param Prompt The prompt string.
@param InStr Point to the input string.
@param StrLen The max length of string user can input.
**/ **/
VOID VOID
EFIAPI EFIAPI
@ -180,12 +362,25 @@ Input (
IN UINTN StrLen IN UINTN StrLen
); );
/**
SetPageBreak.
**/
BOOLEAN BOOLEAN
EFIAPI EFIAPI
SetPageBreak ( SetPageBreak (
VOID VOID
); );
/**
Print a Unicode string to the output device.
@param Format A Null-terminated Unicode format string.
@param ... The variable argument list that contains pointers to Null-
terminated Unicode strings to be printed
**/
UINTN UINTN
EFIAPI EFIAPI
EDBPrint ( EDBPrint (
@ -193,6 +388,17 @@ EDBPrint (
... ...
); );
/**
Print a Unicode string to the output buffer.
@param Buffer A pointer to the output buffer for the produced Null-terminated
Unicode string.
@param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
@param Format A Null-terminated Unicode format string.
@param ... The variable argument list that contains pointers to Null-
terminated Unicode strings to be printed
**/
UINTN UINTN
EFIAPI EFIAPI
EDBSPrint ( EDBSPrint (
@ -202,6 +408,18 @@ EDBSPrint (
... ...
); );
/**
Print a Unicode string to the output buffer with specified offset..
@param Buffer A pointer to the output buffer for the produced Null-terminated
Unicode string.
@param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
@param Offset The offset of the buffer.
@param Format A Null-terminated Unicode format string.
@param ... The variable argument list that contains pointers to Null-
terminated Unicode strings to be printed
**/
UINTN UINTN
EFIAPI EFIAPI
EDBSPrintWithOffset ( EDBSPrintWithOffset (
@ -212,6 +430,25 @@ EDBSPrintWithOffset (
... ...
); );
/**
Read a file.
If ScanFs is FLASE, it will use DebuggerPrivate->Vol as default Fs.
If ScanFs is TRUE, it will scan all FS and check the file.
If there is only one file match the name, it will be read.
If there is more than one file match the name, it will return Error.
@param DebuggerPrivate - EBC Debugger private data structure
@param FileName - The file to be read.
@param BufferSize - The file buffer size
@param Buffer - The file buffer
@param ScanFs - Need Scan all FS
@retval EFI_SUCCESS - read file successfully
@retval EFI_NOT_FOUND - file not found
@retval EFI_NO_MAPPING - there is duplicated files found
**/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
ReadFileToBuffer ( ReadFileToBuffer (
@ -222,6 +459,18 @@ ReadFileToBuffer (
IN BOOLEAN ScanFs IN BOOLEAN ScanFs
); );
/**
Get file name under this dir with index
@param DebuggerPrivate - EBC Debugger private data structure
@param DirName - The dir to be read.
@param FileName - The file name pattern under this dir
@param Index - The file index under this dir
@return File Name which match the pattern and index.
**/
CHAR16 * CHAR16 *
EFIAPI EFIAPI
GetFileNameUnderDir ( GetFileNameUnderDir (

View File

@ -85,7 +85,6 @@ Xtoi (
@param Str - The string @param Str - The string
**/ **/
UINT64 UINT64
EFIAPI EFIAPI
LXtoi ( LXtoi (
@ -308,6 +307,13 @@ AsciiAtoi (
return RetVal; return RetVal;
} }
/**
Convert the character to upper case.
@param Chr the character to be converted.
**/
STATIC STATIC
CHAR16 CHAR16
UnicodeToUpper ( UnicodeToUpper (
@ -317,6 +323,13 @@ UnicodeToUpper (
return (Chr >= L'a' && Chr <= L'z') ? Chr - (L'a' - L'A') : Chr; return (Chr >= L'a' && Chr <= L'z') ? Chr - (L'a' - L'A') : Chr;
} }
/**
Convert the character to upper case.
@param Chr the character to be converted.
**/
STATIC STATIC
CHAR8 CHAR8
AsciiToUpper ( AsciiToUpper (
@ -520,7 +533,6 @@ StrSpn (
@param CharSet Point to the string to be found. @param CharSet Point to the string to be found.
**/ **/
CHAR16 * CHAR16 *
EFIAPI EFIAPI
StrBrk ( StrBrk (
@ -589,7 +601,6 @@ StrTokenLine (
@param CharSet Point to the string to be found. @param CharSet Point to the string to be found.
**/ **/
CHAR16 * CHAR16 *
EFIAPI EFIAPI
StrTokenField ( StrTokenField (
@ -621,6 +632,14 @@ StrTokenField (
return Begin; return Begin;
} }
/**
Find the next token after one or more specified characters.
@param String Point to the string where to find the substring.
@param CharSet Point to the string to be found.
**/
CHAR16 * CHAR16 *
EFIAPI EFIAPI
StrGetNewTokenLine ( StrGetNewTokenLine (
@ -631,6 +650,13 @@ StrGetNewTokenLine (
return StrTokenLine (String, CharSet); return StrTokenLine (String, CharSet);
} }
/**
Find the next token after one or more specified characters.
@param CharSet Point to the string to be found.
**/
CHAR16 * CHAR16 *
EFIAPI EFIAPI
StrGetNextTokenLine ( StrGetNextTokenLine (
@ -640,6 +666,14 @@ StrGetNextTokenLine (
return StrTokenLine (NULL, CharSet); return StrTokenLine (NULL, CharSet);
} }
/**
Find the next token after one specificed characters.
@param String Point to the string where to find the substring.
@param CharSet Point to the string to be found.
**/
CHAR16 * CHAR16 *
EFIAPI EFIAPI
StrGetNewTokenField ( StrGetNewTokenField (
@ -650,6 +684,13 @@ StrGetNewTokenField (
return StrTokenField (String, CharSet); return StrTokenField (String, CharSet);
} }
/**
Find the next token after one specificed characters.
@param CharSet Point to the string to be found.
**/
CHAR16 * CHAR16 *
EFIAPI EFIAPI
StrGetNextTokenField ( StrGetNextTokenField (
@ -659,6 +700,14 @@ StrGetNextTokenField (
return StrTokenField (NULL, CharSet); return StrTokenField (NULL, CharSet);
} }
/**
Patch a character to the end of a string.
@param Buffer The string to be patched.
@param Patch The patch character.
**/
VOID VOID
EFIAPI EFIAPI
PatchForStrTokenAfter ( PatchForStrTokenAfter (
@ -689,6 +738,13 @@ PatchForStrTokenAfter (
return ; return ;
} }
/**
Patch a character at the beginning of a string.
@param Buffer The string to be patched.
@param Patch The patch character.
**/
VOID VOID
EFIAPI EFIAPI
PatchForStrTokenBefore ( PatchForStrTokenBefore (
@ -831,7 +887,6 @@ AsciiStrTokenLine (
@param CharSet Point to the string to be found. @param CharSet Point to the string to be found.
**/ **/
CHAR8 * CHAR8 *
EFIAPI EFIAPI
AsciiStrTokenField ( AsciiStrTokenField (
@ -863,6 +918,14 @@ AsciiStrTokenField (
return Begin; return Begin;
} }
/**
Find the next token after one or more specified characters.
@param String Point to the string where to find the substring.
@param CharSet Point to the string to be found.
**/
CHAR8 * CHAR8 *
EFIAPI EFIAPI
AsciiStrGetNewTokenLine ( AsciiStrGetNewTokenLine (
@ -873,6 +936,13 @@ AsciiStrGetNewTokenLine (
return AsciiStrTokenLine (String, CharSet); return AsciiStrTokenLine (String, CharSet);
} }
/**
Find the next token after one or more specified characters.
@param CharSet Point to the string to be found.
**/
CHAR8 * CHAR8 *
EFIAPI EFIAPI
AsciiStrGetNextTokenLine ( AsciiStrGetNextTokenLine (
@ -882,6 +952,14 @@ AsciiStrGetNextTokenLine (
return AsciiStrTokenLine (NULL, CharSet); return AsciiStrTokenLine (NULL, CharSet);
} }
/**
Find the next token after one specificed characters.
@param String Point to the string where to find the substring.
@param CharSet Point to the string to be found.
**/
CHAR8 * CHAR8 *
EFIAPI EFIAPI
AsciiStrGetNewTokenField ( AsciiStrGetNewTokenField (
@ -892,6 +970,13 @@ AsciiStrGetNewTokenField (
return AsciiStrTokenField (String, CharSet); return AsciiStrTokenField (String, CharSet);
} }
/**
Find the next token after one specificed characters.
@param CharSet Point to the string to be found.
**/
CHAR8 * CHAR8 *
EFIAPI EFIAPI
AsciiStrGetNextTokenField ( AsciiStrGetNextTokenField (
@ -901,6 +986,14 @@ AsciiStrGetNextTokenField (
return AsciiStrTokenField (NULL, CharSet); return AsciiStrTokenField (NULL, CharSet);
} }
/**
Patch a character to the end of a string.
@param Buffer The string to be patched.
@param Patch The patch character.
**/
VOID VOID
EFIAPI EFIAPI
PatchForAsciiStrTokenAfter ( PatchForAsciiStrTokenAfter (
@ -931,6 +1024,13 @@ PatchForAsciiStrTokenAfter (
return ; return ;
} }
/**
Patch a character at the beginning of a string.
@param Buffer The string to be patched.
@param Patch The patch character.
**/
VOID VOID
EFIAPI EFIAPI
PatchForAsciiStrTokenBefore ( PatchForAsciiStrTokenBefore (

View File

@ -14,6 +14,19 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "Edb.h" #include "Edb.h"
/**
Set the current coordinates of the cursor position.
@param ConOut Point to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.
@param Column The position to set the cursor to.
@param Row The position to set the cursor to.
@param LineLength Length of a line.
@param TotalRow Total row of a screen.
@param Str Point to the string.
@param StrPos The position of the string.
@param Len The length of the string.
**/
VOID VOID
EFIAPI EFIAPI
SetCursorPosition ( SetCursorPosition (
@ -166,6 +179,15 @@ ConMoveCursorForward (
CHAR16 mBackupSpace[EFI_DEBUG_INPUS_BUFFER_SIZE]; CHAR16 mBackupSpace[EFI_DEBUG_INPUS_BUFFER_SIZE];
CHAR16 mInputBufferHistory[EFI_DEBUG_INPUS_BUFFER_SIZE]; CHAR16 mInputBufferHistory[EFI_DEBUG_INPUS_BUFFER_SIZE];
/**
Get user input.
@param Prompt The prompt string.
@param InStr Point to the input string.
@param StrLength The max length of string user can input.
**/
VOID VOID
EFIAPI EFIAPI
Input ( Input (
@ -514,6 +536,19 @@ Input (
return ; return ;
} }
/**
Set the current coordinates of the cursor position.
@param ConOut Point to EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL.
@param Column The position to set the cursor to.
@param Row The position to set the cursor to.
@param LineLength Length of a line.
@param TotalRow Total row of a screen.
@param Str Point to the string.
@param StrPos The position of the string.
@param Len The length of the string.
**/
VOID VOID
EFIAPI EFIAPI
SetCursorPosition ( SetCursorPosition (
@ -551,6 +586,11 @@ SetCursorPosition (
ConOut->SetCursorPosition (ConOut, 0, 0); ConOut->SetCursorPosition (ConOut, 0, 0);
} }
/**
SetPageBreak.
**/
BOOLEAN BOOLEAN
EFIAPI EFIAPI
SetPageBreak ( SetPageBreak (
@ -620,6 +660,14 @@ SetPageBreak (
return OmitPrint; return OmitPrint;
} }
/**
Print a Unicode string to the output device.
@param Format A Null-terminated Unicode format string.
@param ... The variable argument list that contains pointers to Null-
terminated Unicode strings to be printed
**/
UINTN UINTN
EFIAPI EFIAPI
EDBPrint ( EDBPrint (
@ -645,6 +693,17 @@ EDBPrint (
return Return; return Return;
} }
/**
Print a Unicode string to the output buffer.
@param Buffer A pointer to the output buffer for the produced Null-terminated
Unicode string.
@param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
@param Format A Null-terminated Unicode format string.
@param ... The variable argument list that contains pointers to Null-
terminated Unicode strings to be printed
**/
UINTN UINTN
EFIAPI EFIAPI
EDBSPrint ( EDBSPrint (
@ -666,6 +725,18 @@ EDBSPrint (
return Return; return Return;
} }
/**
Print a Unicode string to the output buffer with specified offset..
@param Buffer A pointer to the output buffer for the produced Null-terminated
Unicode string.
@param BufferSize The size, in bytes, of the output buffer specified by StartOfBuffer.
@param Offset The offset of the buffer.
@param Format A Null-terminated Unicode format string.
@param ... The variable argument list that contains pointers to Null-
terminated Unicode strings to be printed
**/
UINTN UINTN
EFIAPI EFIAPI
EDBSPrintWithOffset ( EDBSPrintWithOffset (

View File

@ -39,6 +39,18 @@ typedef enum {
EdbEbcImageRvaSearchTypeMax, EdbEbcImageRvaSearchTypeMax,
} EDB_EBC_IMAGE_RVA_SEARCH_TYPE; } EDB_EBC_IMAGE_RVA_SEARCH_TYPE;
/**
Find symbol by address.
@param Address - Symbol address
@param Type - Search type
@param RetObject - Symbol object
@param RetEntry - Symbol entry
@return Nearest symbol address
**/
UINTN UINTN
EbdFindSymbolAddress ( EbdFindSymbolAddress (
IN UINTN Address, IN UINTN Address,
@ -47,6 +59,18 @@ EbdFindSymbolAddress (
OUT EFI_DEBUGGER_SYMBOL_ENTRY **Entry OUT EFI_DEBUGGER_SYMBOL_ENTRY **Entry
); );
/**
Load symbol file by name.
@param DebuggerPrivate - EBC Debugger private data structure
@param FileName - Symbol file name
@param BufferSize - Symbol file buffer size
@param Buffer - Symbol file buffer
@retval EFI_SUCCESS - load symbol successfully
**/
EFI_STATUS EFI_STATUS
EdbLoadSymbol ( EdbLoadSymbol (
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
@ -55,12 +79,34 @@ EdbLoadSymbol (
IN VOID *Buffer IN VOID *Buffer
); );
/**
Unload symbol file by name.
@param DebuggerPrivate - EBC Debugger private data structure
@param FileName - Symbol file name
@retval EFI_SUCCESS - unload symbol successfully
**/
EFI_STATUS EFI_STATUS
EdbUnloadSymbol ( EdbUnloadSymbol (
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN CHAR16 *FileName IN CHAR16 *FileName
); );
/**
Patch symbol RVA.
@param DebuggerPrivate - EBC Debugger private data structure
@param FileName - Symbol file name
@param SearchType - Search type for Object
@retval EFI_SUCCESS - Patch symbol RVA successfully
@retval EFI_NOT_FOUND - Symbol RVA base not found
**/
EFI_STATUS EFI_STATUS
EdbPatchSymbolRVA ( EdbPatchSymbolRVA (
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
@ -68,6 +114,19 @@ EdbPatchSymbolRVA (
IN EDB_EBC_IMAGE_RVA_SEARCH_TYPE SearchType IN EDB_EBC_IMAGE_RVA_SEARCH_TYPE SearchType
); );
/**
Load code.
@param DebuggerPrivate - EBC Debugger private data structure
@param MapFileName - Symbol file name
@param FileName - Code file name
@param BufferSize - Code file buffer size
@param Buffer - Code file buffer
@retval EFI_SUCCESS - Code loaded successfully
**/
EFI_STATUS EFI_STATUS
EdbLoadCode ( EdbLoadCode (
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
@ -77,6 +136,18 @@ EdbLoadCode (
IN VOID *Buffer IN VOID *Buffer
); );
/**
Unload code.
@param DebuggerPrivate - EBC Debugger private data structure
@param MapFileName - Symbol file name
@param FileName - Code file name
@param Buffer - Code file buffer
@retval EFI_SUCCESS - Code unloaded successfully
**/
EFI_STATUS EFI_STATUS
EdbUnloadCode ( EdbUnloadCode (
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
@ -85,6 +156,19 @@ EdbUnloadCode (
OUT VOID **Buffer OUT VOID **Buffer
); );
/**
Add code buffer.
@param DebuggerPrivate - EBC Debugger private data structure
@param MapFileName - Symbol file name
@param CodeFileName - Code file name
@param SourceBufferSize- Code buffer size
@param SourceBuffer - Code buffer
@retval EFI_SUCCESS - CodeBuffer added successfully
**/
EFI_STATUS EFI_STATUS
EdbAddCodeBuffer ( EdbAddCodeBuffer (
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
@ -94,6 +178,18 @@ EdbAddCodeBuffer (
IN VOID *SourceBuffer IN VOID *SourceBuffer
); );
/**
Delete code buffer.
@param DebuggerPrivate - EBC Debugger private data structure
@param MapFileName - Symbol file name
@param CodeFileName - Code file name
@param SourceBuffer - Code buffer
@retval EFI_SUCCESS - CodeBuffer deleted successfully
**/
EFI_STATUS EFI_STATUS
EdbDeleteCodeBuffer ( EdbDeleteCodeBuffer (
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
@ -102,17 +198,49 @@ EdbDeleteCodeBuffer (
IN VOID *SourceBuffer IN VOID *SourceBuffer
); );
/**
Find the symbol string according to address.
@param Address - Symbol address
@return Symbol string
**/
CHAR8 * CHAR8 *
FindSymbolStr ( FindSymbolStr (
IN UINTN Address IN UINTN Address
); );
/**
Print source.
@param Address - Instruction address
@param IsPrint - Whether need to print
@retval 1 - find the source
@retval 0 - not find the source
**/
UINTN UINTN
EdbPrintSource ( EdbPrintSource (
IN UINTN Address, IN UINTN Address,
IN BOOLEAN IsPrint IN BOOLEAN IsPrint
); );
/**
Convert a symbol to an address.
@param Symbol - Symbol name
@param Address - Symbol address
@retval EFI_SUCCESS - symbol found and address returned.
@retval EFI_NOT_FOUND - symbol not found
@retval EFI_NO_MAPPING - duplicated symbol not found
**/
EFI_STATUS EFI_STATUS
Symboltoi ( Symboltoi (
IN CHAR16 *Symbol, IN CHAR16 *Symbol,

View File

@ -18,6 +18,14 @@
#include "EbcDebuggerHook.h" #include "EbcDebuggerHook.h"
/**
The hook in InitializeEbcDriver.
@param Handle - The EbcDebugProtocol handle.
@param EbcDebugProtocol - The EbcDebugProtocol interface.
**/
VOID VOID
EbcDebuggerHookInit ( EbcDebuggerHookInit (
IN EFI_HANDLE Handle, IN EFI_HANDLE Handle,
@ -27,6 +35,11 @@ EbcDebuggerHookInit (
return; return;
} }
/**
The hook in UnloadImage for EBC Interpreter.
**/
VOID VOID
EbcDebuggerHookUnload ( EbcDebuggerHookUnload (
VOID VOID
@ -35,6 +48,14 @@ EbcDebuggerHookUnload (
return; return;
} }
/**
The hook in EbcUnloadImage.
Currently do nothing here.
@param Handle The EbcImage handle.
**/
VOID VOID
EbcDebuggerHookEbcUnloadImage ( EbcDebuggerHookEbcUnloadImage (
IN EFI_HANDLE Handle IN EFI_HANDLE Handle
@ -43,6 +64,13 @@ EbcDebuggerHookEbcUnloadImage (
return; return;
} }
/**
The hook in ExecuteEbcImageEntryPoint.
@param VmPtr - pointer to VM context.
**/
VOID VOID
EbcDebuggerHookExecuteEbcImageEntryPoint ( EbcDebuggerHookExecuteEbcImageEntryPoint (
IN VM_CONTEXT *VmPtr IN VM_CONTEXT *VmPtr
@ -51,6 +79,13 @@ EbcDebuggerHookExecuteEbcImageEntryPoint (
return; return;
} }
/**
The hook in ExecuteEbcImageEntryPoint.
@param VmPtr - pointer to VM context.
**/
VOID VOID
EbcDebuggerHookEbcInterpret ( EbcDebuggerHookEbcInterpret (
IN VM_CONTEXT *VmPtr IN VM_CONTEXT *VmPtr
@ -59,6 +94,12 @@ EbcDebuggerHookEbcInterpret (
return; return;
} }
/**
The hook in EbcExecute, before ExecuteFunction.
@param VmPtr - pointer to VM context.
**/
VOID VOID
EbcDebuggerHookExecuteStart ( EbcDebuggerHookExecuteStart (
IN VM_CONTEXT *VmPtr IN VM_CONTEXT *VmPtr
@ -67,6 +108,12 @@ EbcDebuggerHookExecuteStart (
return; return;
} }
/**
The hook in EbcExecute, after ExecuteFunction.
@param VmPtr - pointer to VM context.
**/
VOID VOID
EbcDebuggerHookExecuteEnd ( EbcDebuggerHookExecuteEnd (
IN VM_CONTEXT *VmPtr IN VM_CONTEXT *VmPtr
@ -75,6 +122,13 @@ EbcDebuggerHookExecuteEnd (
return; return;
} }
/**
The hook in ExecuteCALL, before move IP.
@param VmPtr - pointer to VM context.
**/
VOID VOID
EbcDebuggerHookCALLStart ( EbcDebuggerHookCALLStart (
IN VM_CONTEXT *VmPtr IN VM_CONTEXT *VmPtr
@ -83,6 +137,13 @@ EbcDebuggerHookCALLStart (
return; return;
} }
/**
The hook in ExecuteCALL, after move IP.
@param VmPtr - pointer to VM context.
**/
VOID VOID
EbcDebuggerHookCALLEnd ( EbcDebuggerHookCALLEnd (
IN VM_CONTEXT *VmPtr IN VM_CONTEXT *VmPtr
@ -91,6 +152,13 @@ EbcDebuggerHookCALLEnd (
return; return;
} }
/**
The hook in ExecuteCALL, before call EbcLLCALLEX.
@param VmPtr - pointer to VM context.
**/
VOID VOID
EbcDebuggerHookCALLEXStart ( EbcDebuggerHookCALLEXStart (
IN VM_CONTEXT *VmPtr IN VM_CONTEXT *VmPtr
@ -99,6 +167,13 @@ EbcDebuggerHookCALLEXStart (
return; return;
} }
/**
The hook in ExecuteCALL, after call EbcLLCALLEX.
@param VmPtr - pointer to VM context.
**/
VOID VOID
EbcDebuggerHookCALLEXEnd ( EbcDebuggerHookCALLEXEnd (
IN VM_CONTEXT *VmPtr IN VM_CONTEXT *VmPtr
@ -107,6 +182,13 @@ EbcDebuggerHookCALLEXEnd (
return; return;
} }
/**
The hook in ExecuteRET, before move IP.
@param VmPtr - pointer to VM context.
**/
VOID VOID
EbcDebuggerHookRETStart ( EbcDebuggerHookRETStart (
IN VM_CONTEXT *VmPtr IN VM_CONTEXT *VmPtr
@ -115,6 +197,13 @@ EbcDebuggerHookRETStart (
return; return;
} }
/**
The hook in ExecuteRET, after move IP.
@param VmPtr - pointer to VM context.
**/
VOID VOID
EbcDebuggerHookRETEnd ( EbcDebuggerHookRETEnd (
IN VM_CONTEXT *VmPtr IN VM_CONTEXT *VmPtr
@ -123,6 +212,13 @@ EbcDebuggerHookRETEnd (
return; return;
} }
/**
The hook in ExecuteJMP, before move IP.
@param VmPtr - pointer to VM context.
**/
VOID VOID
EbcDebuggerHookJMPStart ( EbcDebuggerHookJMPStart (
IN VM_CONTEXT *VmPtr IN VM_CONTEXT *VmPtr
@ -131,6 +227,13 @@ EbcDebuggerHookJMPStart (
return; return;
} }
/**
The hook in ExecuteJMP, after move IP.
@param VmPtr - pointer to VM context.
**/
VOID VOID
EbcDebuggerHookJMPEnd ( EbcDebuggerHookJMPEnd (
IN VM_CONTEXT *VmPtr IN VM_CONTEXT *VmPtr
@ -139,6 +242,13 @@ EbcDebuggerHookJMPEnd (
return; return;
} }
/**
The hook in ExecuteJMP8, before move IP.
@param VmPtr - pointer to VM context.
**/
VOID VOID
EbcDebuggerHookJMP8Start ( EbcDebuggerHookJMP8Start (
IN VM_CONTEXT *VmPtr IN VM_CONTEXT *VmPtr
@ -147,6 +257,13 @@ EbcDebuggerHookJMP8Start (
return; return;
} }
/**
The hook in ExecuteJMP8, after move IP..
@param VmPtr - pointer to VM context.
**/
VOID VOID
EbcDebuggerHookJMP8End ( EbcDebuggerHookJMP8End (
IN VM_CONTEXT *VmPtr IN VM_CONTEXT *VmPtr

View File

@ -38,96 +38,207 @@ EbcDebugSignalException (
IN VM_CONTEXT *VmPtr IN VM_CONTEXT *VmPtr
); );
// /**
// Hooks in EbcInt.c
// The hook in InitializeEbcDriver.
@param Handle - The EbcDebugProtocol handle.
@param EbcDebugProtocol - The EbcDebugProtocol interface.
**/
VOID VOID
EbcDebuggerHookInit ( EbcDebuggerHookInit (
IN EFI_HANDLE Handle, IN EFI_HANDLE Handle,
IN EFI_DEBUG_SUPPORT_PROTOCOL *EbcDebugProtocol IN EFI_DEBUG_SUPPORT_PROTOCOL *EbcDebugProtocol
); );
/**
The hook in UnloadImage for EBC Interpreter.
**/
VOID VOID
EbcDebuggerHookUnload ( EbcDebuggerHookUnload (
VOID VOID
); );
/**
The hook in EbcUnloadImage.
Currently do nothing here.
@param Handle The EbcImage handle.
**/
VOID VOID
EbcDebuggerHookEbcUnloadImage ( EbcDebuggerHookEbcUnloadImage (
IN EFI_HANDLE Handle IN EFI_HANDLE Handle
); );
//
// Hooks in EbcSupport.c /**
//
Hooks in EbcSupport.c
@param VmPtr - pointer to VM context.
**/
VOID VOID
EbcDebuggerHookExecuteEbcImageEntryPoint ( EbcDebuggerHookExecuteEbcImageEntryPoint (
IN VM_CONTEXT *VmPtr IN VM_CONTEXT *VmPtr
); );
/**
The hook in ExecuteEbcImageEntryPoint.
@param VmPtr - pointer to VM context.
**/
VOID VOID
EbcDebuggerHookEbcInterpret ( EbcDebuggerHookEbcInterpret (
IN VM_CONTEXT *VmPtr IN VM_CONTEXT *VmPtr
); );
//
// Hooks in EbcExecute.c /**
// The hook in EbcExecute, before ExecuteFunction.
@param VmPtr - pointer to VM context.
**/
VOID VOID
EbcDebuggerHookExecuteStart ( EbcDebuggerHookExecuteStart (
IN VM_CONTEXT *VmPtr IN VM_CONTEXT *VmPtr
); );
/**
The hook in EbcExecute, after ExecuteFunction.
@param VmPtr - pointer to VM context.
**/
VOID VOID
EbcDebuggerHookExecuteEnd ( EbcDebuggerHookExecuteEnd (
IN VM_CONTEXT *VmPtr IN VM_CONTEXT *VmPtr
); );
/**
The hook in ExecuteCALL, before move IP.
@param VmPtr - pointer to VM context.
**/
VOID VOID
EbcDebuggerHookCALLStart ( EbcDebuggerHookCALLStart (
IN VM_CONTEXT *VmPtr IN VM_CONTEXT *VmPtr
); );
/**
The hook in ExecuteCALL, after move IP.
@param VmPtr - pointer to VM context.
**/
VOID VOID
EbcDebuggerHookCALLEnd ( EbcDebuggerHookCALLEnd (
IN VM_CONTEXT *VmPtr IN VM_CONTEXT *VmPtr
); );
/**
The hook in ExecuteCALL, before call EbcLLCALLEX.
@param VmPtr - pointer to VM context.
**/
VOID VOID
EbcDebuggerHookCALLEXStart ( EbcDebuggerHookCALLEXStart (
IN VM_CONTEXT *VmPtr IN VM_CONTEXT *VmPtr
); );
/**
The hook in ExecuteCALL, after call EbcLLCALLEX.
@param VmPtr - pointer to VM context.
**/
VOID VOID
EbcDebuggerHookCALLEXEnd ( EbcDebuggerHookCALLEXEnd (
IN VM_CONTEXT *VmPtr IN VM_CONTEXT *VmPtr
); );
/**
The hook in ExecuteRET, before move IP.
@param VmPtr - pointer to VM context.
**/
VOID VOID
EbcDebuggerHookRETStart ( EbcDebuggerHookRETStart (
IN VM_CONTEXT *VmPtr IN VM_CONTEXT *VmPtr
); );
/**
The hook in ExecuteRET, after move IP.
It will record trace information.
@param VmPtr - pointer to VM context.
**/
VOID VOID
EbcDebuggerHookRETEnd ( EbcDebuggerHookRETEnd (
IN VM_CONTEXT *VmPtr IN VM_CONTEXT *VmPtr
); );
/**
The hook in ExecuteJMP, before move IP.
@param VmPtr - pointer to VM context.
**/
VOID VOID
EbcDebuggerHookJMPStart ( EbcDebuggerHookJMPStart (
IN VM_CONTEXT *VmPtr IN VM_CONTEXT *VmPtr
); );
/**
The hook in ExecuteJMP, after move IP.
@param VmPtr - pointer to VM context.
**/
VOID VOID
EbcDebuggerHookJMPEnd ( EbcDebuggerHookJMPEnd (
IN VM_CONTEXT *VmPtr IN VM_CONTEXT *VmPtr
); );
/**
The hook in ExecuteJMP8, before move IP.
@param VmPtr - pointer to VM context.
**/
VOID VOID
EbcDebuggerHookJMP8Start ( EbcDebuggerHookJMP8Start (
IN VM_CONTEXT *VmPtr IN VM_CONTEXT *VmPtr
); );
/**
The hook in ExecuteJMP8, after move IP..
@param VmPtr - pointer to VM context.
**/
VOID VOID
EbcDebuggerHookJMP8End ( EbcDebuggerHookJMP8End (
IN VM_CONTEXT *VmPtr IN VM_CONTEXT *VmPtr