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