]>
Commit | Line | Data |
---|---|---|
e8a5ac7c | 1 | /** @file\r |
748edcd5 | 2 | \r |
e8a5ac7c DB |
3 | Copyright (c) 2007, Intel Corporation.All rights reserved.<BR>\r |
4 | This program and the accompanying materials\r | |
748edcd5 PB |
5 | are licensed and made available under the terms and conditions of the BSD License\r |
6 | which accompanies this distribution. The full text of the license may be found at\r | |
7 | http://opensource.org/licenses/bsd-license.php\r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
11 | \r | |
748edcd5 | 12 | \r |
e8a5ac7c | 13 | **/\r |
748edcd5 | 14 | \r |
e8a5ac7c | 15 | #include "Edb.h"\r |
748edcd5 | 16 | \r |
e8a5ac7c | 17 | /**\r |
748edcd5 | 18 | \r |
e8a5ac7c | 19 | DebuggerCommand - Register.\r |
748edcd5 | 20 | \r |
e8a5ac7c DB |
21 | @param CommandArg - The argument for this command\r |
22 | @param DebuggerPrivate - EBC Debugger private data structure\r | |
23 | @param ExceptionType - Exception type.\r | |
24 | @param SystemContext - EBC system context.\r | |
25 | \r | |
26 | @retval EFI_DEBUG_CONTINUE - formal return value\r | |
748edcd5 | 27 | \r |
e8a5ac7c | 28 | **/\r |
748edcd5 PB |
29 | EFI_DEBUG_STATUS\r |
30 | DebuggerRegister (\r | |
31 | IN CHAR16 *CommandArg,\r | |
32 | IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,\r | |
33 | IN EFI_EXCEPTION_TYPE ExceptionType,\r | |
34 | IN OUT EFI_SYSTEM_CONTEXT SystemContext\r | |
35 | )\r | |
748edcd5 PB |
36 | {\r |
37 | CHAR16 *RegName;\r | |
38 | CHAR16 *RegValStr;\r | |
39 | UINT64 RegVal;\r | |
40 | \r | |
41 | //\r | |
42 | // Check Argument, NULL means print all register\r | |
43 | //\r | |
44 | if (CommandArg == 0) {\r | |
45 | EDBPrint (\r | |
46 | L" R0 - 0x%016lx, R1 - 0x%016lx\n",\r | |
47 | SystemContext.SystemContextEbc->R0,\r | |
48 | SystemContext.SystemContextEbc->R1\r | |
49 | );\r | |
50 | EDBPrint (\r | |
51 | L" R2 - 0x%016lx, R3 - 0x%016lx\n",\r | |
52 | SystemContext.SystemContextEbc->R2,\r | |
53 | SystemContext.SystemContextEbc->R3\r | |
54 | );\r | |
55 | EDBPrint (\r | |
56 | L" R4 - 0x%016lx, R5 - 0x%016lx\n",\r | |
57 | SystemContext.SystemContextEbc->R4,\r | |
58 | SystemContext.SystemContextEbc->R5\r | |
59 | );\r | |
60 | EDBPrint (\r | |
61 | L" R6 - 0x%016lx, R7 - 0x%016lx\n",\r | |
62 | SystemContext.SystemContextEbc->R6,\r | |
63 | SystemContext.SystemContextEbc->R7\r | |
64 | );\r | |
65 | EDBPrint (\r | |
66 | L" Flags - 0x%016lx, ControlFlags - 0x%016lx\n",\r | |
67 | SystemContext.SystemContextEbc->Flags,\r | |
68 | SystemContext.SystemContextEbc->ControlFlags\r | |
69 | );\r | |
70 | EDBPrint (\r | |
71 | L" Ip - 0x%016lx\n",\r | |
72 | SystemContext.SystemContextEbc->Ip\r | |
73 | );\r | |
74 | return EFI_DEBUG_CONTINUE;\r | |
75 | }\r | |
76 | \r | |
77 | //\r | |
78 | // Get register name\r | |
79 | //\r | |
80 | RegName = CommandArg;\r | |
81 | //\r | |
82 | // Get register value\r | |
83 | //\r | |
84 | RegValStr = StrGetNextTokenLine (L" ");\r | |
85 | if (RegValStr == NULL) {\r | |
86 | EDBPrint (L"Invalid Register Value\n");\r | |
87 | return EFI_DEBUG_CONTINUE;\r | |
88 | }\r | |
89 | RegVal = LXtoi (RegValStr);\r | |
90 | \r | |
91 | //\r | |
92 | // Assign register value\r | |
93 | //\r | |
94 | if (StriCmp (RegName, L"R0") == 0) {\r | |
95 | SystemContext.SystemContextEbc->R0 = RegVal;\r | |
96 | } else if (StriCmp (RegName, L"R1") == 0) {\r | |
97 | SystemContext.SystemContextEbc->R1 = RegVal;\r | |
98 | } else if (StriCmp (RegName, L"R2") == 0) {\r | |
99 | SystemContext.SystemContextEbc->R2 = RegVal;\r | |
100 | } else if (StriCmp (RegName, L"R3") == 0) {\r | |
101 | SystemContext.SystemContextEbc->R3 = RegVal;\r | |
102 | } else if (StriCmp (RegName, L"R4") == 0) {\r | |
103 | SystemContext.SystemContextEbc->R4 = RegVal;\r | |
104 | } else if (StriCmp (RegName, L"R5") == 0) {\r | |
105 | SystemContext.SystemContextEbc->R5 = RegVal;\r | |
106 | } else if (StriCmp (RegName, L"R6") == 0) {\r | |
107 | SystemContext.SystemContextEbc->R6 = RegVal;\r | |
108 | } else if (StriCmp (RegName, L"R7") == 0) {\r | |
109 | SystemContext.SystemContextEbc->R7 = RegVal;\r | |
110 | } else if (StriCmp (RegName, L"Flags") == 0) {\r | |
111 | SystemContext.SystemContextEbc->Flags = RegVal;\r | |
112 | } else if (StriCmp (RegName, L"ControlFlags") == 0) {\r | |
113 | SystemContext.SystemContextEbc->ControlFlags = RegVal;\r | |
114 | } else if (StriCmp (RegName, L"Ip") == 0) {\r | |
115 | SystemContext.SystemContextEbc->Ip = RegVal;\r | |
116 | } else {\r | |
117 | EDBPrint (L"Invalid Register - %s\n", RegName);\r | |
118 | }\r | |
119 | \r | |
120 | //\r | |
121 | // Done\r | |
122 | //\r | |
123 | return EFI_DEBUG_CONTINUE;\r | |
124 | }\r |