]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdHelp.c
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Universal / EbcDxe / EbcDebugger / EdbCmdHelp.c
CommitLineData
e8a5ac7c 1/** @file\r
748edcd5 2\r
e8a5ac7c 3Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
9d510e61 4SPDX-License-Identifier: BSD-2-Clause-Patent\r
748edcd5 5\r
748edcd5 6\r
e8a5ac7c 7**/\r
748edcd5 8\r
e8a5ac7c 9#include "Edb.h"\r
748edcd5 10\r
e8a5ac7c 11/**\r
748edcd5 12\r
e8a5ac7c 13 DebuggerCommand - Help.\r
748edcd5 14\r
e8a5ac7c
DB
15 @param CommandArg - The argument for this command\r
16 @param DebuggerPrivate - EBC Debugger private data structure\r
17 @param ExceptionType - Interrupt type.\r
18 @param SystemContext - EBC system context.\r
19\r
20 @retval EFI_DEBUG_CONTINUE - formal return value\r
748edcd5 21\r
e8a5ac7c 22**/\r
748edcd5
PB
23EFI_DEBUG_STATUS\r
24DebuggerHelp (\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
748edcd5
PB
30{\r
31 UINTN Index;\r
32\r
33 //\r
34 // if no argument, print all the command title\r
35 //\r
36 if (CommandArg == NULL) {\r
37 for (Index = 0; DebuggerPrivate->DebuggerCommandSet[Index].CommandName != NULL; Index++) {\r
38 EDBPrint (DebuggerPrivate->DebuggerCommandSet[Index].ClassName);\r
39 if (StrCmp (DebuggerPrivate->DebuggerCommandSet[Index].CommandTitle, L"") != 0) {\r
40 EDBPrint (L" ");\r
41 EDBPrint (DebuggerPrivate->DebuggerCommandSet[Index].CommandTitle);\r
42 }\r
43 }\r
44 return EFI_DEBUG_CONTINUE;\r
45 }\r
46\r
47 //\r
48 // If there is argument, the argument should be command name.\r
49 // Find the command and print the detail information.\r
50 //\r
51 for (Index = 0; DebuggerPrivate->DebuggerCommandSet[Index].CommandName != NULL; Index++) {\r
52 if (StriCmp (CommandArg, DebuggerPrivate->DebuggerCommandSet[Index].CommandName) == 0) {\r
53 EDBPrint (DebuggerPrivate->DebuggerCommandSet[Index].CommandHelp);\r
54 EDBPrint (DebuggerPrivate->DebuggerCommandSet[Index].CommandSyntax);\r
55 return EFI_DEBUG_CONTINUE;\r
56 }\r
57 }\r
58\r
59 //\r
60 // Command not found.\r
61 //\r
62 EDBPrint (L"No help info for this command\n");\r
63\r
64 //\r
65 // Done\r
66 //\r
67 return EFI_DEBUG_CONTINUE;\r
68}\r