TianoCore EDK2 master
Loading...
Searching...
No Matches
EdbHook.c File Reference
#include "Edb.h"

Go to the source code of this file.

Functions

VOID EbcDebuggerCheckHookFlag (IN VM_CONTEXT *VmPtr, IN UINT32 Flag)
 
VOID EbcDebuggerPushCallstackSource (IN UINT64 SourceEntry, IN EFI_DEBUGGER_BRANCH_TYPE Type)
 
VOID EbcDebuggerPushCallstackParameter (IN UINT64 ParameterAddress, IN EFI_DEBUGGER_BRANCH_TYPE Type)
 
VOID EbcDebuggerPushCallstackDest (IN UINT64 DestEntry, IN EFI_DEBUGGER_BRANCH_TYPE Type)
 
VOID EbcDebuggerPopCallstack (VOID)
 
VOID EbcDebuggerPushTraceSourceEntry (IN UINT64 SourceEntry, IN EFI_DEBUGGER_BRANCH_TYPE Type)
 
VOID EbcDebuggerPushTraceDestEntry (IN UINT64 DestEntry, IN EFI_DEBUGGER_BRANCH_TYPE Type)
 
VOID EbcDebuggerPushStepEntry (IN UINT64 Entry, IN UINT64 FramePtr, IN UINT32 Flag)
 
VOID EFIAPI EbcDebuggerBreakEventFunc (IN EFI_EVENT Event, IN VOID *Context)
 
VOID EbcDebuggerHookInit (IN EFI_HANDLE Handle, IN EFI_DEBUG_SUPPORT_PROTOCOL *EbcDebugProtocol)
 
VOID EbcDebuggerHookUnload (VOID)
 
VOID EbcDebuggerHookEbcUnloadImage (IN EFI_HANDLE Handle)
 
VOID EbcDebuggerHookExecuteEbcImageEntryPoint (IN VM_CONTEXT *VmPtr)
 
VOID EbcDebuggerHookEbcInterpret (IN VM_CONTEXT *VmPtr)
 
VOID EbcDebuggerHookExecuteStart (IN VM_CONTEXT *VmPtr)
 
VOID EbcDebuggerHookExecuteEnd (IN VM_CONTEXT *VmPtr)
 
VOID EbcDebuggerHookCALLStart (IN VM_CONTEXT *VmPtr)
 
VOID EbcDebuggerHookCALLEnd (IN VM_CONTEXT *VmPtr)
 
VOID EbcDebuggerHookCALLEXStart (IN VM_CONTEXT *VmPtr)
 
VOID EbcDebuggerHookCALLEXEnd (IN VM_CONTEXT *VmPtr)
 
VOID EbcDebuggerHookRETStart (IN VM_CONTEXT *VmPtr)
 
VOID EbcDebuggerHookRETEnd (IN VM_CONTEXT *VmPtr)
 
VOID EbcDebuggerHookJMPStart (IN VM_CONTEXT *VmPtr)
 
VOID EbcDebuggerHookJMPEnd (IN VM_CONTEXT *VmPtr)
 
VOID EbcDebuggerHookJMP8Start (IN VM_CONTEXT *VmPtr)
 
VOID EbcDebuggerHookJMP8End (IN VM_CONTEXT *VmPtr)
 

Detailed Description

Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file EdbHook.c.

Function Documentation

◆ EbcDebuggerBreakEventFunc()

VOID EFIAPI EbcDebuggerBreakEventFunc ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Notify the callback function when an event is triggered.

Parameters
EventIndicates the event that invoke this function.
ContextIndicates the calling context.

Definition at line 302 of file EdbHook.c.

◆ EbcDebuggerCheckHookFlag()

VOID EbcDebuggerCheckHookFlag ( IN VM_CONTEXT VmPtr,
IN UINT32  Flag 
)

Check the Hook flag, and trigger exception if match.

Parameters
VmPtr- EbcDebuggerCheckHookFlag
Flag- Feature flag

Definition at line 20 of file EdbHook.c.

◆ EbcDebuggerHookCALLEnd()

VOID EbcDebuggerHookCALLEnd ( IN VM_CONTEXT VmPtr)

The hook in ExecuteCALL, after move IP. It will record Callstack, trace information and record StepOver/StepOut Entry if need.

Parameters
VmPtr- pointer to VM context.

Definition at line 679 of file EdbHook.c.

◆ EbcDebuggerHookCALLEXEnd()

VOID EbcDebuggerHookCALLEXEnd ( IN VM_CONTEXT VmPtr)

The hook in ExecuteCALL, after call EbcLLCALLEX. It will record trace information.

Parameters
VmPtr- pointer to VM context.

Definition at line 740 of file EdbHook.c.

◆ EbcDebuggerHookCALLEXStart()

VOID EbcDebuggerHookCALLEXStart ( IN VM_CONTEXT VmPtr)

The hook in ExecuteCALL, before call EbcLLCALLEX. It will trigger Exception if BOCX enabled, and record Callstack information.

Parameters
VmPtr- pointer to VM context.

Definition at line 720 of file EdbHook.c.

◆ EbcDebuggerHookCALLStart()

VOID EbcDebuggerHookCALLStart ( IN VM_CONTEXT VmPtr)

The hook in ExecuteCALL, before move IP. It will trigger Exception if BOC enabled, and record Callstack, and trace information.

Parameters
VmPtr- pointer to VM context.

Definition at line 658 of file EdbHook.c.

◆ EbcDebuggerHookEbcInterpret()

VOID EbcDebuggerHookEbcInterpret ( IN VM_CONTEXT VmPtr)

The hook in ExecuteEbcImageEntryPoint. It will record the call-stack entry. (-2 means EbcInterpret call) and trigger Exception if BOT enabled.

Parameters
VmPtr- pointer to VM context.

Definition at line 529 of file EdbHook.c.

◆ EbcDebuggerHookEbcUnloadImage()

VOID EbcDebuggerHookEbcUnloadImage ( IN EFI_HANDLE  Handle)

The hook in EbcUnloadImage. Currently do nothing here.

Parameters
Handle- The EbcImage handle.

Definition at line 490 of file EdbHook.c.

◆ EbcDebuggerHookExecuteEbcImageEntryPoint()

VOID EbcDebuggerHookExecuteEbcImageEntryPoint ( IN VM_CONTEXT VmPtr)

The hook in ExecuteEbcImageEntryPoint. It will record the call-stack entry. (-1 means EbcImageEntryPoint call) and trigger Exception if BOE enabled.

Parameters
VmPtr- pointer to VM context.

Definition at line 508 of file EdbHook.c.

◆ EbcDebuggerHookExecuteEnd()

VOID EbcDebuggerHookExecuteEnd ( IN VM_CONTEXT VmPtr)

The hook in EbcExecute, after ExecuteFunction. It will record StepOut Entry if need.

Parameters
VmPtr- pointer to VM context.

Definition at line 633 of file EdbHook.c.

◆ EbcDebuggerHookExecuteStart()

VOID EbcDebuggerHookExecuteStart ( IN VM_CONTEXT VmPtr)

The hook in EbcExecute, before ExecuteFunction. It will trigger Exception if GoTil, StepOver, or StepOut hit.

Parameters
VmPtr- pointer to VM context.

Definition at line 549 of file EdbHook.c.

◆ EbcDebuggerHookInit()

VOID EbcDebuggerHookInit ( IN EFI_HANDLE  Handle,
IN EFI_DEBUG_SUPPORT_PROTOCOL EbcDebugProtocol 
)

The hook in InitializeEbcDriver. It will init the EbcDebuggerPrivate data structure.

Parameters
Handle- The EbcDebugProtocol handle.
EbcDebugProtocol- The EbcDebugProtocol interface.

Definition at line 329 of file EdbHook.c.

◆ EbcDebuggerHookJMP8End()

VOID EbcDebuggerHookJMP8End ( IN VM_CONTEXT VmPtr)

The hook in ExecuteJMP8, after move IP. It will record trace information.

Parameters
VmPtr- pointer to VM context.

Definition at line 846 of file EdbHook.c.

◆ EbcDebuggerHookJMP8Start()

VOID EbcDebuggerHookJMP8Start ( IN VM_CONTEXT VmPtr)

The hook in ExecuteJMP8, before move IP. It will record trace information.

Parameters
VmPtr- pointer to VM context.

Definition at line 829 of file EdbHook.c.

◆ EbcDebuggerHookJMPEnd()

VOID EbcDebuggerHookJMPEnd ( IN VM_CONTEXT VmPtr)

The hook in ExecuteJMP, after move IP. It will record trace information.

Parameters
VmPtr- pointer to VM context.

Definition at line 812 of file EdbHook.c.

◆ EbcDebuggerHookJMPStart()

VOID EbcDebuggerHookJMPStart ( IN VM_CONTEXT VmPtr)

The hook in ExecuteJMP, before move IP. It will record trace information.

Parameters
VmPtr- pointer to VM context.

Definition at line 795 of file EdbHook.c.

◆ EbcDebuggerHookRETEnd()

VOID EbcDebuggerHookRETEnd ( IN VM_CONTEXT VmPtr)

The hook in ExecuteRET, after move IP. It will record trace information.

Parameters
VmPtr- pointer to VM context.

Definition at line 778 of file EdbHook.c.

◆ EbcDebuggerHookRETStart()

VOID EbcDebuggerHookRETStart ( IN VM_CONTEXT VmPtr)

The hook in ExecuteRET, before move IP. It will trigger Exception if BOR enabled, and record Callstack, and trace information.

Parameters
VmPtr- pointer to VM context.

Definition at line 759 of file EdbHook.c.

◆ EbcDebuggerHookUnload()

VOID EbcDebuggerHookUnload ( VOID  )

The hook in UnloadImage for EBC Interpreter. It clean up the environment.

Definition at line 430 of file EdbHook.c.

◆ EbcDebuggerPopCallstack()

VOID EbcDebuggerPopCallstack ( VOID  )

It will throw the newest Callstack entry.

Definition at line 154 of file EdbHook.c.

◆ EbcDebuggerPushCallstackDest()

VOID EbcDebuggerPushCallstackDest ( IN UINT64  DestEntry,
IN EFI_DEBUGGER_BRANCH_TYPE  Type 
)

It will record source address for callstack entry.

Parameters
DestEntry- Source address
Type- Branch type

Definition at line 114 of file EdbHook.c.

◆ EbcDebuggerPushCallstackParameter()

VOID EbcDebuggerPushCallstackParameter ( IN UINT64  ParameterAddress,
IN EFI_DEBUGGER_BRANCH_TYPE  Type 
)

It will record parameter for Callstack entry.

Parameters
ParameterAddress- The address for the parameter
Type- Branch type

Definition at line 78 of file EdbHook.c.

◆ EbcDebuggerPushCallstackSource()

VOID EbcDebuggerPushCallstackSource ( IN UINT64  SourceEntry,
IN EFI_DEBUGGER_BRANCH_TYPE  Type 
)

It will record soruce address for Callstack entry.

Parameters
SourceEntry- Source address
Type- Branch type

Definition at line 46 of file EdbHook.c.

◆ EbcDebuggerPushStepEntry()

VOID EbcDebuggerPushStepEntry ( IN UINT64  Entry,
IN UINT64  FramePtr,
IN UINT32  Flag 
)

It will record address for StepEntry, if STEPOVER or STEPOUT is enabled.

Parameters
Entry- Break Address
FramePtr- Break Frame pointer
Flag- for STEPOVER or STEPOUT

Definition at line 264 of file EdbHook.c.

◆ EbcDebuggerPushTraceDestEntry()

VOID EbcDebuggerPushTraceDestEntry ( IN UINT64  DestEntry,
IN EFI_DEBUGGER_BRANCH_TYPE  Type 
)

It will record destination address for trace entry.

Parameters
DestEntry- Destination address
Type- Branch type

Definition at line 220 of file EdbHook.c.

◆ EbcDebuggerPushTraceSourceEntry()

VOID EbcDebuggerPushTraceSourceEntry ( IN UINT64  SourceEntry,
IN EFI_DEBUGGER_BRANCH_TYPE  Type 
)

It will record source address for trace entry.

Parameters
SourceEntry- Source address
Type- Branch type

Definition at line 188 of file EdbHook.c.