]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdGo.c
8c68879863c67fde0826a5c3f0767ba8ec32191c
[mirror_edk2.git] / MdeModulePkg / Universal / EbcDxe / EbcDebugger / EdbCmdGo.c
1 /** @file
2
3 Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
4 This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12
13
14 **/
15
16 #include "Edb.h"
17
18 /**
19
20 DebuggerCommand - Go.
21
22 @param CommandArg - The argument for this command
23 @param DebuggerPrivate - EBC Debugger private data structure
24 @param ExceptionType - Interrupt type.
25 @param SystemContext - EBC system context.
26
27 @retval EFI_DEBUG_BREAK - formal return value
28 @retval EFI_DEBUG_CONTINUE - something wrong
29
30 **/
31 EFI_DEBUG_STATUS
32 DebuggerGo (
33 IN CHAR16 *CommandArg,
34 IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
35 IN EFI_EXCEPTION_TYPE ExceptionType,
36 IN OUT EFI_SYSTEM_CONTEXT SystemContext
37 )
38 {
39 UINTN Address;
40 CHAR16 *CommandStr;
41 EFI_STATUS Status;
42
43 //
44 // Check argument
45 //
46 if (CommandArg != NULL) {
47 if (StriCmp (CommandArg, L"til") == 0) {
48 CommandStr = StrGetNextTokenLine (L" ");
49 if (CommandStr != NULL) {
50 //
51 // Enable GoTil break now
52 // set BreakAddress, and set feature flag.
53 //
54 Status = Symboltoi (CommandStr, &Address);
55 if (EFI_ERROR (Status)) {
56 if (Status == EFI_NOT_FOUND) {
57 Address = Xtoi(CommandStr);
58 } else {
59 //
60 // Something wrong, let Symboltoi print error info.
61 //
62 EDBPrint (L"Command Argument error!\n");
63 return EFI_DEBUG_CONTINUE;
64 }
65 }
66 DebuggerPrivate->GoTilContext.BreakAddress = Address;
67 DebuggerPrivate->FeatureFlags |= EFI_DEBUG_FLAG_EBC_GT;
68 } else {
69 EDBPrint (L"Command Argument error!\n");
70 return EFI_DEBUG_CONTINUE;
71 }
72 } else {
73 EDBPrint (L"Command Argument error!\n");
74 return EFI_DEBUG_CONTINUE;
75 }
76 }
77
78 //
79 // Done
80 //
81 return EFI_DEBUG_BREAK;
82 }