]> 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
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
65 /**
66
67 DebuggerCommand - List.
68
69 @param CommandArg - The argument for this command
70 @param DebuggerPrivate - EBC Debugger private data structure
71 @param ExceptionType - Exception type.
72 @param SystemContext - EBC system context.
73
74 @retval EFI_DEBUG_CONTINUE - formal return value
75
76 **/
77 EFI_DEBUG_STATUS
78 DebuggerList (
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 }