]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdScope.c
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdeModulePkg / Universal / EbcDxe / EbcDebugger / EdbCmdScope.c
1 /** @file
2
3 Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
4 SPDX-License-Identifier: BSD-2-Clause-Patent
5
6
7 **/
8
9 #include "Edb.h"
10
11 /**
12
13 DebuggerCommand - Scope.
14
15 @param CommandArg - The argument for this command
16 @param DebuggerPrivate - EBC Debugger private data structure
17 @param ExceptionType - Exception type.
18 @param SystemContext - EBC system context.
19
20 @retval EFI_DEBUG_CONTINUE - formal return value
21
22 **/
23 EFI_DEBUG_STATUS
24 DebuggerScope (
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 DebuggerPrivate->InstructionScope = Address;
55 EDBPrint (L"Scope: 0x%x\n", DebuggerPrivate->InstructionScope);
56 EdbShowDisasm (DebuggerPrivate, SystemContext);
57
58 //
59 // Done
60 //
61 return EFI_DEBUG_CONTINUE;
62 }
63
64 /**
65
66 DebuggerCommand - List.
67
68 @param CommandArg - The argument for this command
69 @param DebuggerPrivate - EBC Debugger private data structure
70 @param ExceptionType - Exception type.
71 @param SystemContext - EBC system context.
72
73 @retval EFI_DEBUG_CONTINUE - formal return value
74
75 **/
76 EFI_DEBUG_STATUS
77 DebuggerList (
78 IN CHAR16 *CommandArg,
79 IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
80 IN EFI_EXCEPTION_TYPE ExceptionType,
81 IN OUT EFI_SYSTEM_CONTEXT SystemContext
82 )
83 {
84 if (CommandArg == NULL) {
85 EdbShowDisasm (DebuggerPrivate, SystemContext);
86 } else {
87 //
88 // Load new list number
89 //
90 DebuggerPrivate->InstructionNumber = Atoi(CommandArg);
91 EDBPrint (L"List Number: %d\n", DebuggerPrivate->InstructionNumber);
92 EdbShowDisasm (DebuggerPrivate, SystemContext);
93 }
94
95 //
96 // Done
97 //
98 return EFI_DEBUG_CONTINUE;
99 }