]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdGo.c
MdeModulePkg/EbcDebugger: Add ASSERT to ensure FieldBuffer is not NULL
[mirror_edk2.git] / MdeModulePkg / Universal / EbcDxe / EbcDebugger / EdbCmdGo.c
1 /*++
2
3 Copyright (c) 2007, Intel Corporation
4 All rights reserved. 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 Module Name:
13
14 EdbCmdGo.c
15
16 Abstract:
17
18
19 --*/
20
21 #include "Edb.h"
22
23 EFI_DEBUG_STATUS
24 DebuggerGo (
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
32 Routine Description:
33
34 DebuggerCommand - Go
35
36 Arguments:
37
38 CommandArg - The argument for this command
39 DebuggerPrivate - EBC Debugger private data structure
40 InterruptType - Interrupt type.
41 SystemContext - EBC system context.
42
43 Returns:
44
45 EFI_DEBUG_BREAK - formal return value
46 EFI_DEBUG_CONTINUE - something wrong
47
48 --*/
49 {
50 UINTN Address;
51 CHAR16 *CommandStr;
52 EFI_STATUS Status;
53
54 //
55 // Check argument
56 //
57 if (CommandArg != NULL) {
58 if (StriCmp (CommandArg, L"til") == 0) {
59 CommandStr = StrGetNextTokenLine (L" ");
60 if (CommandStr != NULL) {
61 //
62 // Enable GoTil break now
63 // set BreakAddress, and set feature flag.
64 //
65 Status = Symboltoi (CommandStr, &Address);
66 if (EFI_ERROR (Status)) {
67 if (Status == EFI_NOT_FOUND) {
68 Address = Xtoi(CommandStr);
69 } else {
70 //
71 // Something wrong, let Symboltoi print error info.
72 //
73 EDBPrint (L"Command Argument error!\n");
74 return EFI_DEBUG_CONTINUE;
75 }
76 }
77 DebuggerPrivate->GoTilContext.BreakAddress = Address;
78 DebuggerPrivate->FeatureFlags |= EFI_DEBUG_FLAG_EBC_GT;
79 } else {
80 EDBPrint (L"Command Argument error!\n");
81 return EFI_DEBUG_CONTINUE;
82 }
83 } else {
84 EDBPrint (L"Command Argument error!\n");
85 return EFI_DEBUG_CONTINUE;
86 }
87 }
88
89 //
90 // Done
91 //
92 return EFI_DEBUG_BREAK;
93 }