]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdHelp.c
MdeModulePkg/EbcDxe: add EBC Debugger
[mirror_edk2.git] / MdeModulePkg / Universal / EbcDxe / EbcDebugger / EdbCmdHelp.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 EdbCmdHelp.c
15
16 Abstract:
17
18
19 --*/
20
21 #include "Edb.h"
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
32 Routine Description:
33
34 DebuggerCommand - Help
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_CONTINUE - formal return value
46
47 --*/
48 {
49 UINTN Index;
50
51 //
52 // if no argument, print all the command title
53 //
54 if (CommandArg == NULL) {
55 for (Index = 0; DebuggerPrivate->DebuggerCommandSet[Index].CommandName != NULL; Index++) {
56 EDBPrint (DebuggerPrivate->DebuggerCommandSet[Index].ClassName);
57 if (StrCmp (DebuggerPrivate->DebuggerCommandSet[Index].CommandTitle, L"") != 0) {
58 EDBPrint (L" ");
59 EDBPrint (DebuggerPrivate->DebuggerCommandSet[Index].CommandTitle);
60 }
61 }
62 return EFI_DEBUG_CONTINUE;
63 }
64
65 //
66 // If there is argument, the argument should be command name.
67 // Find the command and print the detail information.
68 //
69 for (Index = 0; DebuggerPrivate->DebuggerCommandSet[Index].CommandName != NULL; Index++) {
70 if (StriCmp (CommandArg, DebuggerPrivate->DebuggerCommandSet[Index].CommandName) == 0) {
71 EDBPrint (DebuggerPrivate->DebuggerCommandSet[Index].CommandHelp);
72 EDBPrint (DebuggerPrivate->DebuggerCommandSet[Index].CommandSyntax);
73 return EFI_DEBUG_CONTINUE;
74 }
75 }
76
77 //
78 // Command not found.
79 //
80 EDBPrint (L"No help info for this command\n");
81
82 //
83 // Done
84 //
85 return EFI_DEBUG_CONTINUE;
86 }