]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdGo.c
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Universal / EbcDxe / EbcDebugger / EdbCmdGo.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
10 #include "Edb.h"
11
12 /**
13
14 DebuggerCommand - Go.
15
16 @param CommandArg - The argument for this command
17 @param DebuggerPrivate - EBC Debugger private data structure
18 @param ExceptionType - Interrupt type.
19 @param SystemContext - EBC system context.
20
21 @retval EFI_DEBUG_BREAK - formal return value
22 @retval EFI_DEBUG_CONTINUE - something wrong
23
24 **/
25 EFI_DEBUG_STATUS
26 DebuggerGo (
27 IN CHAR16 *CommandArg,
28 IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
29 IN EFI_EXCEPTION_TYPE ExceptionType,
30 IN OUT EFI_SYSTEM_CONTEXT SystemContext
31 )
32 {
33 UINTN Address;
34 CHAR16 *CommandStr;
35 EFI_STATUS Status;
36
37 //
38 // Check argument
39 //
40 if (CommandArg != NULL) {
41 if (StriCmp (CommandArg, L"til") == 0) {
42 CommandStr = StrGetNextTokenLine (L" ");
43 if (CommandStr != NULL) {
44 //
45 // Enable GoTil break now
46 // set BreakAddress, and set feature flag.
47 //
48 Status = Symboltoi (CommandStr, &Address);
49 if (EFI_ERROR (Status)) {
50 if (Status == EFI_NOT_FOUND) {
51 Address = Xtoi(CommandStr);
52 } else {
53 //
54 // Something wrong, let Symboltoi print error info.
55 //
56 EDBPrint (L"Command Argument error!\n");
57 return EFI_DEBUG_CONTINUE;
58 }
59 }
60 DebuggerPrivate->GoTilContext.BreakAddress = Address;
61 DebuggerPrivate->FeatureFlags |= EFI_DEBUG_FLAG_EBC_GT;
62 } else {
63 EDBPrint (L"Command Argument error!\n");
64 return EFI_DEBUG_CONTINUE;
65 }
66 } else {
67 EDBPrint (L"Command Argument error!\n");
68 return EFI_DEBUG_CONTINUE;
69 }
70 }
71
72 //
73 // Done
74 //
75 return EFI_DEBUG_BREAK;
76 }