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