TianoCore EDK2 master
Loading...
Searching...
No Matches
EdbHook.c
Go to the documentation of this file.
1
9#include "Edb.h"
10
19VOID
21 IN VM_CONTEXT *VmPtr,
22 IN UINT32 Flag
23 )
24{
25 if ((mDebuggerPrivate.FeatureFlags & Flag) == Flag) {
26 mDebuggerPrivate.StatusFlags = Flag;
28 EXCEPT_EBC_BREAKPOINT,
29 EXCEPTION_FLAG_NONE,
30 VmPtr
31 );
32 }
33
34 return;
35}
36
45VOID
47 IN UINT64 SourceEntry,
48 IN EFI_DEBUGGER_BRANCH_TYPE Type
49 )
50{
51 if (mDebuggerPrivate.CallStackEntryCount > EFI_DEBUGGER_CALLSTACK_MAX) {
52 ASSERT (FALSE);
53 mDebuggerPrivate.CallStackEntryCount = EFI_DEBUGGER_CALLSTACK_MAX;
54 }
55
56 //
57 // Record the new callstack entry
58 //
59 mDebuggerPrivate.CallStackEntry[mDebuggerPrivate.CallStackEntryCount].SourceAddress = SourceEntry;
60 mDebuggerPrivate.CallStackEntry[mDebuggerPrivate.CallStackEntryCount].Type = Type;
61
62 //
63 // Do not change CallStackEntryCount
64 //
65
66 return;
67}
68
77VOID
79 IN UINT64 ParameterAddress,
80 IN EFI_DEBUGGER_BRANCH_TYPE Type
81 )
82{
83 if (mDebuggerPrivate.CallStackEntryCount > EFI_DEBUGGER_CALLSTACK_MAX) {
84 ASSERT (FALSE);
85 mDebuggerPrivate.CallStackEntryCount = EFI_DEBUGGER_CALLSTACK_MAX;
86 }
87
88 //
89 // Record the new callstack parameter
90 //
91 mDebuggerPrivate.CallStackEntry[mDebuggerPrivate.CallStackEntryCount].ParameterAddr = (UINTN)ParameterAddress;
92 CopyMem (
93 mDebuggerPrivate.CallStackEntry[mDebuggerPrivate.CallStackEntryCount].Parameter,
94 (VOID *)(UINTN)ParameterAddress,
95 sizeof (mDebuggerPrivate.CallStackEntry[mDebuggerPrivate.CallStackEntryCount].Parameter)
96 );
97
98 //
99 // Do not change CallStackEntryCount
100 //
101
102 return;
103}
104
113VOID
115 IN UINT64 DestEntry,
116 IN EFI_DEBUGGER_BRANCH_TYPE Type
117 )
118{
119 UINTN Index;
120
121 if (mDebuggerPrivate.CallStackEntryCount < EFI_DEBUGGER_CALLSTACK_MAX) {
122 //
123 // If there is empty entry for callstack, add it
124 //
125 ASSERT (mDebuggerPrivate.CallStackEntry[mDebuggerPrivate.CallStackEntryCount].Type == Type);
126 mDebuggerPrivate.CallStackEntry[mDebuggerPrivate.CallStackEntryCount].DestAddress = DestEntry;
127 mDebuggerPrivate.CallStackEntryCount++;
128 } else {
129 //
130 // If there is no empty entry for callstack, throw the oldest one
131 //
132 ASSERT (mDebuggerPrivate.CallStackEntry[EFI_DEBUGGER_TRACE_MAX].Type == Type);
133 for (Index = 0; Index < EFI_DEBUGGER_CALLSTACK_MAX; Index++) {
134 CopyMem (
135 &mDebuggerPrivate.CallStackEntry[Index],
136 &mDebuggerPrivate.CallStackEntry[Index + 1],
137 sizeof (mDebuggerPrivate.CallStackEntry[Index])
138 );
139 }
140
141 mDebuggerPrivate.CallStackEntry[EFI_DEBUGGER_CALLSTACK_MAX - 1].DestAddress = DestEntry;
142 mDebuggerPrivate.CallStackEntryCount = EFI_DEBUGGER_CALLSTACK_MAX;
143 }
144
145 return;
146}
147
153VOID
155 VOID
156 )
157{
158 if ((mDebuggerPrivate.CallStackEntryCount > 0) &&
159 (mDebuggerPrivate.CallStackEntryCount <= EFI_DEBUGGER_CALLSTACK_MAX))
160 {
161 //
162 // Throw the newest one
163 //
164 mDebuggerPrivate.CallStackEntryCount--;
165 mDebuggerPrivate.CallStackEntry[mDebuggerPrivate.CallStackEntryCount].SourceAddress = 0;
166 mDebuggerPrivate.CallStackEntry[mDebuggerPrivate.CallStackEntryCount].DestAddress = 0;
167 } else if (mDebuggerPrivate.CallStackEntryCount == 0) {
168 //
169 // NOT assert here because it is reasonable, because when we start to build
170 // callstack, we do not know how many function already called.
171 //
172 } else {
173 ASSERT (FALSE);
174 }
175
176 return;
177}
178
187VOID
189 IN UINT64 SourceEntry,
190 IN EFI_DEBUGGER_BRANCH_TYPE Type
191 )
192{
193 if (mDebuggerPrivate.TraceEntryCount > EFI_DEBUGGER_TRACE_MAX) {
194 ASSERT (FALSE);
195 mDebuggerPrivate.TraceEntryCount = EFI_DEBUGGER_TRACE_MAX;
196 }
197
198 //
199 // Record the new trace entry
200 //
201 mDebuggerPrivate.TraceEntry[mDebuggerPrivate.TraceEntryCount].SourceAddress = SourceEntry;
202 mDebuggerPrivate.TraceEntry[mDebuggerPrivate.TraceEntryCount].Type = Type;
203
204 //
205 // Do not change TraceEntryCount
206 //
207
208 return;
209}
210
219VOID
221 IN UINT64 DestEntry,
222 IN EFI_DEBUGGER_BRANCH_TYPE Type
223 )
224{
225 UINTN Index;
226
227 if (mDebuggerPrivate.TraceEntryCount < EFI_DEBUGGER_TRACE_MAX) {
228 //
229 // If there is empty entry for trace, add it
230 //
231 ASSERT (mDebuggerPrivate.TraceEntry[mDebuggerPrivate.TraceEntryCount].Type == Type);
232 mDebuggerPrivate.TraceEntry[mDebuggerPrivate.TraceEntryCount].DestAddress = DestEntry;
233 mDebuggerPrivate.TraceEntryCount++;
234 } else {
235 //
236 // If there is no empty entry for trace, throw the oldest one
237 //
238 ASSERT (mDebuggerPrivate.TraceEntry[EFI_DEBUGGER_TRACE_MAX].Type == Type);
239 for (Index = 0; Index < EFI_DEBUGGER_TRACE_MAX; Index++) {
240 CopyMem (
241 &mDebuggerPrivate.TraceEntry[Index],
242 &mDebuggerPrivate.TraceEntry[Index + 1],
243 sizeof (mDebuggerPrivate.TraceEntry[Index])
244 );
245 }
246
247 mDebuggerPrivate.TraceEntry[EFI_DEBUGGER_CALLSTACK_MAX - 1].DestAddress = DestEntry;
248 mDebuggerPrivate.TraceEntryCount = EFI_DEBUGGER_TRACE_MAX;
249 }
250
251 return;
252}
253
263VOID
265 IN UINT64 Entry,
266 IN UINT64 FramePtr,
267 IN UINT32 Flag
268 )
269{
270 //
271 // Check StepOver
272 //
273 if ((Flag == EFI_DEBUG_FLAG_EBC_STEPOVER) &&
274 ((mDebuggerPrivate.FeatureFlags & EFI_DEBUG_FLAG_EBC_STEPOVER) == EFI_DEBUG_FLAG_EBC_STEPOVER))
275 {
276 mDebuggerPrivate.StepContext.BreakAddress = Entry;
277 mDebuggerPrivate.StepContext.FramePointer = FramePtr;
278 mDebuggerPrivate.FeatureFlags &= ~EFI_DEBUG_FLAG_EBC_B_STEPOVER;
279 }
280
281 //
282 // Check StepOut
283 //
284 if ((Flag == EFI_DEBUG_FLAG_EBC_STEPOUT) &&
285 ((mDebuggerPrivate.FeatureFlags & EFI_DEBUG_FLAG_EBC_STEPOUT) == EFI_DEBUG_FLAG_EBC_STEPOUT))
286 {
287 mDebuggerPrivate.StepContext.BreakAddress = Entry;
288 mDebuggerPrivate.StepContext.FramePointer = FramePtr;
289 mDebuggerPrivate.FeatureFlags &= ~EFI_DEBUG_FLAG_EBC_B_STEPOUT;
290 }
291}
292
300VOID
301EFIAPI
303 IN EFI_EVENT Event,
304 IN VOID *Context
305 )
306{
307 EFI_STATUS Status;
308
309 if ((mDebuggerPrivate.FeatureFlags & EFI_DEBUG_FLAG_EBC_BOK) != EFI_DEBUG_FLAG_EBC_BOK) {
310 return;
311 }
312
313 Status = gBS->CheckEvent (gST->ConIn->WaitForKey);
314 if (Status == EFI_SUCCESS) {
315 mDebuggerPrivate.StatusFlags = EFI_DEBUG_FLAG_EBC_BOK;
316 }
317}
318
328VOID
330 IN EFI_HANDLE Handle,
331 IN EFI_DEBUG_SUPPORT_PROTOCOL *EbcDebugProtocol
332 )
333{
334 EFI_STATUS Status;
335 UINTN Index;
338
339 //
340 // Register all exception handler
341 //
342 for (Index = EXCEPT_EBC_UNDEFINED; Index <= EXCEPT_EBC_STEP; Index++) {
343 EbcDebugProtocol->RegisterExceptionCallback (
344 EbcDebugProtocol,
345 0,
346 NULL,
347 Index
348 );
349 EbcDebugProtocol->RegisterExceptionCallback (
350 EbcDebugProtocol,
351 0,
353 Index
354 );
355 }
356
357 //
358 // Init Symbol
359 //
360 Object = AllocateZeroPool (sizeof (EFI_DEBUGGER_SYMBOL_OBJECT) * EFI_DEBUGGER_SYMBOL_OBJECT_MAX);
361 ASSERT (Object != NULL);
362 mDebuggerPrivate.DebuggerSymbolContext.Object = Object;
363 mDebuggerPrivate.DebuggerSymbolContext.ObjectCount = 0;
364 mDebuggerPrivate.DebuggerSymbolContext.MaxObjectCount = EFI_DEBUGGER_SYMBOL_OBJECT_MAX;
365 for (Index = 0; Index < EFI_DEBUGGER_SYMBOL_OBJECT_MAX; Index++) {
366 Entry = AllocateZeroPool (sizeof (EFI_DEBUGGER_SYMBOL_ENTRY) * EFI_DEBUGGER_SYMBOL_ENTRY_MAX);
367 ASSERT (Entry != NULL);
368 Object[Index].Entry = Entry;
369 Object[Index].MaxEntryCount = EFI_DEBUGGER_SYMBOL_ENTRY_MAX;
370 Object[Index].SourceBuffer = AllocateZeroPool (sizeof (VOID *) * (EFI_DEBUGGER_SYMBOL_ENTRY_MAX + 1));
371 ASSERT (Object[Index].SourceBuffer != NULL);
372 }
373
374 //
375 // locate PciRootBridgeIo
376 //
377 Status = gBS->LocateProtocol (
378 &gEfiPciRootBridgeIoProtocolGuid,
379 NULL,
380 (VOID **)&mDebuggerPrivate.PciRootBridgeIo
381 );
382
383 //
384 // locate DebugImageInfoTable
385 //
387 &gEfiDebugImageInfoTableGuid,
388 (VOID **)&mDebuggerPrivate.DebugImageInfoTableHeader
389 );
390
391 //
392 // Register Debugger Configuration Protocol, for config in shell
393 //
394 Status = gBS->InstallProtocolInterface (
395 &Handle,
396 &gEfiDebuggerConfigurationProtocolGuid,
398 &mDebuggerPrivate.DebuggerConfiguration
399 );
400
401 //
402 //
403 // Create break event
404 //
405 Status = gBS->CreateEvent (
406 EVT_TIMER | EVT_NOTIFY_SIGNAL,
407 TPL_CALLBACK,
409 NULL,
410 &mDebuggerPrivate.BreakEvent
411 );
412 if (!EFI_ERROR (Status)) {
413 Status = gBS->SetTimer (
414 mDebuggerPrivate.BreakEvent,
416 EFI_DEBUG_BREAK_TIMER_INTERVAL
417 );
418 }
419
420 return;
421}
422
429VOID
431 VOID
432 )
433{
434 UINTN Index;
435 UINTN SubIndex;
437
438 //
439 // Close the break event
440 //
441 if (mDebuggerPrivate.BreakEvent != NULL) {
442 gBS->CloseEvent (mDebuggerPrivate.BreakEvent);
443 }
444
445 //
446 // Clean up the symbol
447 //
448 Object = mDebuggerPrivate.DebuggerSymbolContext.Object;
449 for (Index = 0; Index < EFI_DEBUGGER_SYMBOL_OBJECT_MAX; Index++) {
450 //
451 // Clean up Entry
452 //
453 gBS->FreePool (Object[Index].Entry);
454 Object[Index].Entry = NULL;
455 Object[Index].EntryCount = 0;
456 //
457 // Clean up source buffer
458 //
459 for (SubIndex = 0; Object[Index].SourceBuffer[SubIndex] != NULL; SubIndex++) {
460 gBS->FreePool (Object[Index].SourceBuffer[SubIndex]);
461 Object[Index].SourceBuffer[SubIndex] = NULL;
462 }
463
464 gBS->FreePool (Object[Index].SourceBuffer);
465 Object[Index].SourceBuffer = NULL;
466 }
467
468 //
469 // Clean up Object
470 //
471 gBS->FreePool (Object);
472 mDebuggerPrivate.DebuggerSymbolContext.Object = NULL;
473 mDebuggerPrivate.DebuggerSymbolContext.ObjectCount = 0;
474
475 //
476 // Done
477 //
478 return;
479}
480
489VOID
491 IN EFI_HANDLE Handle
492 )
493{
494 return;
495}
496
507VOID
509 IN VM_CONTEXT *VmPtr
510 )
511{
512 EbcDebuggerPushCallstackSource ((UINT64)(UINTN)-1, EfiDebuggerBranchTypeEbcCall);
513 EbcDebuggerPushCallstackParameter ((UINT64)(UINTN)VmPtr->Gpr[0], EfiDebuggerBranchTypeEbcCall);
514 EbcDebuggerPushCallstackDest ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcCall);
515 EbcDebuggerCheckHookFlag (VmPtr, EFI_DEBUG_FLAG_EBC_BOE);
516 return;
517}
518
528VOID
530 IN VM_CONTEXT *VmPtr
531 )
532{
533 EbcDebuggerPushCallstackSource ((UINT64)(UINTN)-2, EfiDebuggerBranchTypeEbcCall);
534 EbcDebuggerPushCallstackParameter ((UINT64)(UINTN)VmPtr->Gpr[0], EfiDebuggerBranchTypeEbcCall);
535 EbcDebuggerPushCallstackDest ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcCall);
536 EbcDebuggerCheckHookFlag (VmPtr, EFI_DEBUG_FLAG_EBC_BOT);
537 return;
538}
539
548VOID
550 IN VM_CONTEXT *VmPtr
551 )
552{
553 EFI_TPL CurrentTpl;
554
555 //
556 // Check Ip for GoTil
557 //
558 if (mDebuggerPrivate.GoTilContext.BreakAddress == (UINT64)(UINTN)VmPtr->Ip) {
559 mDebuggerPrivate.StatusFlags = EFI_DEBUG_FLAG_EBC_GT;
560 mDebuggerPrivate.GoTilContext.BreakAddress = 0;
562 EXCEPT_EBC_BREAKPOINT,
563 EXCEPTION_FLAG_NONE,
564 VmPtr
565 );
566 mDebuggerPrivate.StatusFlags &= ~EFI_DEBUG_FLAG_EBC_B_GT;
567 return;
568 }
569
570 //
571 // Check ReturnAddress for StepOver
572 //
573 if ((mDebuggerPrivate.StepContext.BreakAddress == (UINT64)(UINTN)VmPtr->Ip) &&
574 (mDebuggerPrivate.StepContext.FramePointer == (UINT64)(UINTN)VmPtr->FramePtr))
575 {
576 mDebuggerPrivate.StatusFlags = EFI_DEBUG_FLAG_EBC_STEPOVER;
577 mDebuggerPrivate.StepContext.BreakAddress = 0;
578 mDebuggerPrivate.StepContext.FramePointer = 0;
580 EXCEPT_EBC_BREAKPOINT,
581 EXCEPTION_FLAG_NONE,
582 VmPtr
583 );
584 mDebuggerPrivate.StatusFlags &= ~EFI_DEBUG_FLAG_EBC_B_STEPOVER;
585 }
586
587 //
588 // Check FramePtr for StepOut
589 //
590 if (mDebuggerPrivate.StepContext.BreakAddress == (UINT64)(UINTN)VmPtr->FramePtr) {
591 mDebuggerPrivate.StatusFlags = EFI_DEBUG_FLAG_EBC_STEPOUT;
592 mDebuggerPrivate.StepContext.BreakAddress = 0;
593 mDebuggerPrivate.StepContext.FramePointer = 0;
595 EXCEPT_EBC_BREAKPOINT,
596 EXCEPTION_FLAG_NONE,
597 VmPtr
598 );
599 mDebuggerPrivate.StatusFlags &= ~EFI_DEBUG_FLAG_EBC_B_STEPOUT;
600 }
601
602 //
603 // Check Flags for BreakOnKey
604 //
605 if (mDebuggerPrivate.StatusFlags == EFI_DEBUG_FLAG_EBC_BOK) {
606 //
607 // Only break when the current TPL <= TPL_APPLICATION
608 //
609 CurrentTpl = gBS->RaiseTPL (TPL_HIGH_LEVEL);
610 gBS->RestoreTPL (CurrentTpl);
611 if (CurrentTpl <= TPL_APPLICATION) {
613 EXCEPT_EBC_BREAKPOINT,
614 EXCEPTION_FLAG_NONE,
615 VmPtr
616 );
617 mDebuggerPrivate.StatusFlags &= ~EFI_DEBUG_FLAG_EBC_B_BOK;
618 }
619 }
620
621 return;
622}
623
632VOID
634 IN VM_CONTEXT *VmPtr
635 )
636{
637 UINTN Address;
638
639 //
640 // Use FramePtr as checkpoint for StepOut
641 //
642 CopyMem (&Address, (VOID *)((UINTN)VmPtr->FramePtr), sizeof (Address));
643 EbcDebuggerPushStepEntry (Address, (UINT64)(UINTN)VmPtr->FramePtr, EFI_DEBUG_FLAG_EBC_STEPOUT);
644
645 return;
646}
647
657VOID
659 IN VM_CONTEXT *VmPtr
660 )
661{
662 EbcDebuggerCheckHookFlag (VmPtr, EFI_DEBUG_FLAG_EBC_BOC);
663 EbcDebuggerPushCallstackSource ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcCall);
664 EbcDebuggerPushCallstackParameter ((UINT64)(UINTN)VmPtr->Gpr[0], EfiDebuggerBranchTypeEbcCall);
665 EbcDebuggerPushTraceSourceEntry ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcCall);
666 return;
667}
668
678VOID
680 IN VM_CONTEXT *VmPtr
681 )
682{
683 UINT64 Address;
684 UINTN FramePtr;
685
686 EbcDebuggerPushCallstackDest ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcCall);
687 EbcDebuggerPushTraceDestEntry ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcCall);
688
689 //
690 // Get Old FramePtr
691 //
692 CopyMem (&FramePtr, (VOID *)((UINTN)VmPtr->FramePtr), sizeof (FramePtr));
693
694 //
695 // Use ReturnAddress as checkpoint for StepOver
696 //
697 CopyMem (&Address, (VOID *)(UINTN)VmPtr->Gpr[0], sizeof (Address));
698 EbcDebuggerPushStepEntry (Address, FramePtr, EFI_DEBUG_FLAG_EBC_STEPOVER);
699
700 //
701 // Use FramePtr as checkpoint for StepOut
702 //
703 Address = 0;
704 CopyMem (&Address, (VOID *)(FramePtr), sizeof (UINTN));
705 EbcDebuggerPushStepEntry (Address, FramePtr, EFI_DEBUG_FLAG_EBC_STEPOUT);
706
707 return;
708}
709
719VOID
721 IN VM_CONTEXT *VmPtr
722 )
723{
724 EbcDebuggerCheckHookFlag (VmPtr, EFI_DEBUG_FLAG_EBC_BOCX);
725 // EbcDebuggerPushCallstackSource ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcCallEx);
726 // EbcDebuggerPushCallstackParameter ((UINT64)(UINTN)VmPtr->R[0], EfiDebuggerBranchTypeEbcCallEx);
727 EbcDebuggerPushTraceSourceEntry ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcCallEx);
728 return;
729}
730
739VOID
741 IN VM_CONTEXT *VmPtr
742 )
743{
744 // EbcDebuggerPushCallstackDest ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcCallEx);
745 EbcDebuggerPushTraceDestEntry ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcCallEx);
746 return;
747}
748
758VOID
760 IN VM_CONTEXT *VmPtr
761 )
762{
763 EbcDebuggerCheckHookFlag (VmPtr, EFI_DEBUG_FLAG_EBC_BOR);
765 EbcDebuggerPushTraceSourceEntry ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcRet);
766 return;
767}
768
777VOID
779 IN VM_CONTEXT *VmPtr
780 )
781{
782 EbcDebuggerPushTraceDestEntry ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcRet);
783 return;
784}
785
794VOID
796 IN VM_CONTEXT *VmPtr
797 )
798{
799 EbcDebuggerPushTraceSourceEntry ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcJmp);
800 return;
801}
802
811VOID
813 IN VM_CONTEXT *VmPtr
814 )
815{
816 EbcDebuggerPushTraceDestEntry ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcJmp);
817 return;
818}
819
828VOID
830 IN VM_CONTEXT *VmPtr
831 )
832{
833 EbcDebuggerPushTraceSourceEntry ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcJmp8);
834 return;
835}
836
845VOID
847 IN VM_CONTEXT *VmPtr
848 )
849{
850 EbcDebuggerPushTraceDestEntry ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcJmp8);
851 return;
852}
UINT64 UINTN
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
EFI_STATUS EbcDebugSignalException(IN EFI_EXCEPTION_TYPE ExceptionType, IN EXCEPTION_FLAGS ExceptionFlags, IN VM_CONTEXT *VmPtr)
Definition: EbcInt.c:860
VOID EFIAPI EdbExceptionHandler(IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext)
Definition: Edb.c:489
VOID EbcDebuggerPushTraceSourceEntry(IN UINT64 SourceEntry, IN EFI_DEBUGGER_BRANCH_TYPE Type)
Definition: EdbHook.c:188
VOID EbcDebuggerHookJMPStart(IN VM_CONTEXT *VmPtr)
Definition: EdbHook.c:795
VOID EbcDebuggerHookExecuteStart(IN VM_CONTEXT *VmPtr)
Definition: EdbHook.c:549
VOID EFIAPI EbcDebuggerBreakEventFunc(IN EFI_EVENT Event, IN VOID *Context)
Definition: EdbHook.c:302
VOID EbcDebuggerPushTraceDestEntry(IN UINT64 DestEntry, IN EFI_DEBUGGER_BRANCH_TYPE Type)
Definition: EdbHook.c:220
VOID EbcDebuggerHookCALLEnd(IN VM_CONTEXT *VmPtr)
Definition: EdbHook.c:679
VOID EbcDebuggerPushCallstackSource(IN UINT64 SourceEntry, IN EFI_DEBUGGER_BRANCH_TYPE Type)
Definition: EdbHook.c:46
VOID EbcDebuggerHookEbcInterpret(IN VM_CONTEXT *VmPtr)
Definition: EdbHook.c:529
VOID EbcDebuggerPushStepEntry(IN UINT64 Entry, IN UINT64 FramePtr, IN UINT32 Flag)
Definition: EdbHook.c:264
VOID EbcDebuggerHookCALLStart(IN VM_CONTEXT *VmPtr)
Definition: EdbHook.c:658
VOID EbcDebuggerPushCallstackParameter(IN UINT64 ParameterAddress, IN EFI_DEBUGGER_BRANCH_TYPE Type)
Definition: EdbHook.c:78
VOID EbcDebuggerHookCALLEXStart(IN VM_CONTEXT *VmPtr)
Definition: EdbHook.c:720
VOID EbcDebuggerHookRETEnd(IN VM_CONTEXT *VmPtr)
Definition: EdbHook.c:778
VOID EbcDebuggerHookInit(IN EFI_HANDLE Handle, IN EFI_DEBUG_SUPPORT_PROTOCOL *EbcDebugProtocol)
Definition: EdbHook.c:329
VOID EbcDebuggerPopCallstack(VOID)
Definition: EdbHook.c:154
VOID EbcDebuggerHookCALLEXEnd(IN VM_CONTEXT *VmPtr)
Definition: EdbHook.c:740
VOID EbcDebuggerHookJMPEnd(IN VM_CONTEXT *VmPtr)
Definition: EdbHook.c:812
VOID EbcDebuggerCheckHookFlag(IN VM_CONTEXT *VmPtr, IN UINT32 Flag)
Definition: EdbHook.c:20
VOID EbcDebuggerPushCallstackDest(IN UINT64 DestEntry, IN EFI_DEBUGGER_BRANCH_TYPE Type)
Definition: EdbHook.c:114
VOID EbcDebuggerHookEbcUnloadImage(IN EFI_HANDLE Handle)
Definition: EdbHook.c:490
VOID EbcDebuggerHookExecuteEbcImageEntryPoint(IN VM_CONTEXT *VmPtr)
Definition: EdbHook.c:508
VOID EbcDebuggerHookUnload(VOID)
Definition: EdbHook.c:430
VOID EbcDebuggerHookJMP8Start(IN VM_CONTEXT *VmPtr)
Definition: EdbHook.c:829
VOID EbcDebuggerHookExecuteEnd(IN VM_CONTEXT *VmPtr)
Definition: EdbHook.c:633
VOID EbcDebuggerHookRETStart(IN VM_CONTEXT *VmPtr)
Definition: EdbHook.c:759
VOID EbcDebuggerHookJMP8End(IN VM_CONTEXT *VmPtr)
Definition: EdbHook.c:846
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
#define NULL
Definition: Base.h:319
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
#define EXCEPT_EBC_UNDEFINED
Definition: DebugSupport.h:437
#define EXCEPT_EBC_STEP
Definition: DebugSupport.h:447
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_EVENT
Definition: UefiBaseType.h:37
UINTN EFI_TPL
Definition: UefiBaseType.h:41
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
#define EFI_SUCCESS
Definition: UefiBaseType.h:112
EFI_SYSTEM_TABLE * gST
EFI_BOOT_SERVICES * gBS
EFI_STATUS EFIAPI EfiGetSystemConfigurationTable(IN EFI_GUID *TableGuid, OUT VOID **Table)
Definition: UefiLib.c:82
@ EFI_NATIVE_INTERFACE
Definition: UefiSpec.h:1193
@ TimerPeriodic
Definition: UefiSpec.h:535
EFI_SIMPLE_TEXT_INPUT_PROTOCOL * ConIn
Definition: UefiSpec.h:2053