TianoCore EDK2 master
Loading...
Searching...
No Matches
EdbCmdScope.c
Go to the documentation of this file.
1
9#include "Edb.h"
10
23EFI_DEBUG_STATUS
25 IN CHAR16 *CommandArg,
26 IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
27 IN EFI_EXCEPTION_TYPE ExceptionType,
28 IN OUT EFI_SYSTEM_CONTEXT SystemContext
29 )
30{
31 EFI_STATUS Status;
32 UINTN Address;
33
34 if (CommandArg == NULL) {
35 EDBPrint (L"Scope: invalid Address\n");
36 return EFI_DEBUG_CONTINUE;
37 }
38
39 //
40 // Load new scope
41 //
42 Status = Symboltoi (CommandArg, &Address);
43 if (EFI_ERROR (Status)) {
44 if (Status == EFI_NOT_FOUND) {
45 Address = Xtoi (CommandArg);
46 } else {
47 //
48 // Something wrong, let Symboltoi print error info.
49 //
50 EDBPrint (L"Command Argument error!\n");
51 return EFI_DEBUG_CONTINUE;
52 }
53 }
54
55 DebuggerPrivate->InstructionScope = Address;
56 EDBPrint (L"Scope: 0x%x\n", DebuggerPrivate->InstructionScope);
57 EdbShowDisasm (DebuggerPrivate, SystemContext);
58
59 //
60 // Done
61 //
62 return EFI_DEBUG_CONTINUE;
63}
64
77EFI_DEBUG_STATUS
79 IN CHAR16 *CommandArg,
80 IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
81 IN EFI_EXCEPTION_TYPE ExceptionType,
82 IN OUT EFI_SYSTEM_CONTEXT SystemContext
83 )
84{
85 if (CommandArg == NULL) {
86 EdbShowDisasm (DebuggerPrivate, SystemContext);
87 } else {
88 //
89 // Load new list number
90 //
91 DebuggerPrivate->InstructionNumber = Atoi (CommandArg);
92 EDBPrint (L"List Number: %d\n", DebuggerPrivate->InstructionNumber);
93 EdbShowDisasm (DebuggerPrivate, SystemContext);
94 }
95
96 //
97 // Done
98 //
99 return EFI_DEBUG_CONTINUE;
100}
UINT64 UINTN
EFI_DEBUG_STATUS DebuggerList(IN CHAR16 *CommandArg, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext)
Definition: EdbCmdScope.c:78
EFI_DEBUG_STATUS DebuggerScope(IN CHAR16 *CommandArg, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext)
Definition: EdbCmdScope.c:24
EFI_STATUS EdbShowDisasm(IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_SYSTEM_CONTEXT SystemContext)
UINTN EFIAPI Xtoi(CHAR16 *Str)
UINTN EFIAPI Atoi(CHAR16 *Str)
UINTN EFIAPI EDBPrint(IN CONST CHAR16 *Format,...)
Definition: EdbSupportUI.c:683
EFI_STATUS Symboltoi(IN CHAR16 *Symbol, OUT UINTN *Address)
Definition: EdbSymbol.c:2222
#define NULL
Definition: Base.h:319
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
INTN EFI_EXCEPTION_TYPE
Definition: DebugSupport.h:35
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29