TianoCore EDK2 master
Loading...
Searching...
No Matches
EdbCmdStep.c
Go to the documentation of this file.
1
9#include "Edb.h"
10
21BOOLEAN
23 IN UINTN Address
24 )
25{
26 if (GET_OPCODE (Address) != OPCODE_CALL) {
27 return FALSE;
28 }
29
30 if (GET_OPERANDS (Address) & OPERAND_M_NATIVE_CALL) {
31 return FALSE;
32 } else {
33 return TRUE;
34 }
35}
36
47BOOLEAN
49 IN UINTN Address
50 )
51{
52 if (GET_OPCODE (Address) != OPCODE_RET) {
53 return FALSE;
54 }
55
56 if (GET_OPERANDS (Address) != 0) {
57 return FALSE;
58 } else {
59 return TRUE;
60 }
61}
62
75EFI_DEBUG_STATUS
77 IN CHAR16 *CommandArg,
78 IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
79 IN EFI_EXCEPTION_TYPE ExceptionType,
80 IN OUT EFI_SYSTEM_CONTEXT SystemContext
81 )
82{
83 SystemContext.SystemContextEbc->Flags |= VMFLAGS_STEP;
84
85 return EFI_DEBUG_BREAK;
86}
87
100EFI_DEBUG_STATUS
102 IN CHAR16 *CommandArg,
103 IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
104 IN EFI_EXCEPTION_TYPE ExceptionType,
105 IN OUT EFI_SYSTEM_CONTEXT SystemContext
106 )
107{
108 if (IsEBCCALL ((UINTN)SystemContext.SystemContextEbc->Ip)) {
109 //
110 // Check CALL (NOTE: CALLEX is exclusive)
111 //
112 DebuggerPrivate->FeatureFlags |= EFI_DEBUG_FLAG_EBC_STEPOVER;
113 } else {
114 //
115 // Other instruction including CALLEX
116 //
117 SystemContext.SystemContextEbc->Flags |= VMFLAGS_STEP;
118 }
119
120 return EFI_DEBUG_BREAK;
121}
122
135EFI_DEBUG_STATUS
137 IN CHAR16 *CommandArg,
138 IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
139 IN EFI_EXCEPTION_TYPE ExceptionType,
140 IN OUT EFI_SYSTEM_CONTEXT SystemContext
141 )
142{
143 if (IsEBCRET ((UINTN)SystemContext.SystemContextEbc->Ip)) {
144 //
145 // Check RET
146 //
147 SystemContext.SystemContextEbc->Flags |= VMFLAGS_STEP;
148 } else {
149 //
150 // Other instruction
151 //
152 DebuggerPrivate->FeatureFlags |= EFI_DEBUG_FLAG_EBC_STEPOUT;
153 }
154
155 return EFI_DEBUG_BREAK;
156}
UINT64 UINTN
BOOLEAN IsEBCCALL(IN UINTN Address)
Definition: EdbCmdStep.c:22
EFI_DEBUG_STATUS DebuggerStepOut(IN CHAR16 *CommandArg, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext)
Definition: EdbCmdStep.c:136
EFI_DEBUG_STATUS DebuggerStepOver(IN CHAR16 *CommandArg, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext)
Definition: EdbCmdStep.c:101
BOOLEAN IsEBCRET(IN UINTN Address)
Definition: EdbCmdStep.c:48
EFI_DEBUG_STATUS DebuggerStepInto(IN CHAR16 *CommandArg, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext)
Definition: EdbCmdStep.c:76
#define TRUE
Definition: Base.h:301
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
INTN EFI_EXCEPTION_TYPE
Definition: DebugSupport.h:35