From e8a5ac7c4991825deb4e2e5cf060c3e90f68e8e5 Mon Sep 17 00:00:00 2001 From: Dandan Bi Date: Tue, 29 Nov 2016 11:01:00 +0800 Subject: [PATCH] MdeModulePkg/EbcDxe: Make the comments align with EDKII coding style Cc: Jiewen Yao Cc: Pete Batard Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi Reviewed-by: Jiewen.yao@intel.com --- .../Universal/EbcDxe/EbcDebugger/Edb.c | 219 ++-- .../Universal/EbcDxe/EbcDebugger/Edb.h | 34 +- .../EbcDxe/EbcDebugger/EdbCmdBranch.c | 98 +- .../EbcDxe/EbcDebugger/EdbCmdBreak.c | 199 ++-- .../EbcDxe/EbcDebugger/EdbCmdBreakpoint.c | 327 ++---- .../EbcDxe/EbcDebugger/EdbCmdExtIo.c | 195 ++- .../EbcDxe/EbcDebugger/EdbCmdExtPci.c | 161 +-- .../Universal/EbcDxe/EbcDebugger/EdbCmdGo.c | 43 +- .../Universal/EbcDxe/EbcDebugger/EdbCmdHelp.c | 40 +- .../EbcDxe/EbcDebugger/EdbCmdMemory.c | 427 +++---- .../Universal/EbcDxe/EbcDebugger/EdbCmdQuit.c | 38 +- .../EbcDxe/EbcDebugger/EdbCmdRegister.c | 40 +- .../EbcDxe/EbcDebugger/EdbCmdScope.c | 70 +- .../Universal/EbcDxe/EbcDebugger/EdbCmdStep.c | 152 +-- .../EbcDxe/EbcDebugger/EdbCmdSymbol.c | 374 +++--- .../Universal/EbcDxe/EbcDebugger/EdbCommand.c | 68 +- .../Universal/EbcDxe/EbcDebugger/EdbCommand.h | 35 +- .../Universal/EbcDxe/EbcDebugger/EdbCommon.h | 15 +- .../Universal/EbcDxe/EbcDebugger/EdbDisasm.c | 603 ++++------ .../Universal/EbcDxe/EbcDebugger/EdbDisasm.h | 14 +- .../EbcDxe/EbcDebugger/EdbDisasmSupport.c | 946 ++++++--------- .../EbcDxe/EbcDebugger/EdbDisasmSupport.h | 14 +- .../Universal/EbcDxe/EbcDebugger/EdbHook.c | 557 +++------ .../Universal/EbcDxe/EbcDebugger/EdbHook.h | 15 +- .../Universal/EbcDxe/EbcDebugger/EdbSupport.h | 20 +- .../EbcDxe/EbcDebugger/EdbSupportFile.c | 115 +- .../EbcDxe/EbcDebugger/EdbSupportString.c | 332 +++--- .../EbcDxe/EbcDebugger/EdbSupportUI.c | 87 +- .../Universal/EbcDxe/EbcDebugger/EdbSymbol.c | 1046 +++++------------ .../Universal/EbcDxe/EbcDebugger/EdbSymbol.h | 14 +- 30 files changed, 2319 insertions(+), 3979 deletions(-) diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/Edb.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/Edb.c index 6485060068..6953f1627f 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/Edb.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/Edb.c @@ -1,7 +1,7 @@ -/*++ +/** @file -Copyright (c) 2007 - 2016, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -9,13 +9,7 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: - - Ebc.c - -Abstract: - ---*/ +**/ #include #include "Edb.h" @@ -66,27 +60,19 @@ CHAR16 *mExceptionStr[] = { L"EXCEPT_EBC_SINGLE_STEP", }; +/** + + Clear all the breakpoint. + + @param DebuggerPrivate EBC Debugger private data structure + @param NeedRemove Whether need to remove all the breakpoint + +**/ VOID EdbClearAllBreakpoint ( IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN BOOLEAN NeedRemove ) -/*++ - -Routine Description: - - Clear all the breakpoint - -Arguments: - - DebuggerPrivate - EBC Debugger private data structure - NeedRemove - Whether need to remove all the breakpoint - -Returns: - - None - ---*/ { UINTN Index; @@ -117,25 +103,17 @@ Returns: return ; } +/** + + Set all the breakpoint. + + @param DebuggerPrivate EBC Debugger private data structure + +**/ VOID EdbSetAllBreakpoint ( IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate ) -/*++ - -Routine Description: - - Set all the breakpoint - -Arguments: - - DebuggerPrivate - EBC Debugger private data structure - -Returns: - - None - ---*/ { UINTN Index; UINT16 Data16; @@ -173,28 +151,20 @@ Returns: return ; } -VOID -EdbCheckBreakpoint ( - IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, - IN EFI_SYSTEM_CONTEXT SystemContext - ) -/*++ - -Routine Description: +/** Check all the breakpoint, if match, then set status flag, and record current breakpoint. Then clear all breakpoint to let user see a clean memory -Arguments: - - DebuggerPrivate - EBC Debugger private data structure - SystemContext - EBC system context. + @param DebuggerPrivate EBC Debugger private data structure + @param SystemContext EBC system context. -Returns: - - None - ---*/ +**/ +VOID +EdbCheckBreakpoint ( + IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, + IN EFI_SYSTEM_CONTEXT SystemContext + ) { UINT64 Address; UINTN Index; @@ -277,25 +247,16 @@ Returns: return ; } +/** + clear all the symbol. + + @param DebuggerPrivate EBC Debugger private data structure + +**/ VOID EdbClearSymbol ( IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate ) -/*++ - -Routine Description: - - clear all the symbol - -Arguments: - - DebuggerPrivate - EBC Debugger private data structure - -Returns: - - None - ---*/ { EFI_DEBUGGER_SYMBOL_CONTEXT *DebuggerSymbolContext; EFI_DEBUGGER_SYMBOL_OBJECT *Object; @@ -332,6 +293,16 @@ Returns: return ; } +/** + + Initialize Debugger private data structure + + @param DebuggerPrivate EBC Debugger private data structure + @param ExceptionType Exception type. + @param SystemContext EBC system context. + @param Initialized Whether the DebuggerPrivate data is initialized. + +**/ EFI_STATUS InitDebuggerPrivateData ( IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, @@ -339,24 +310,6 @@ InitDebuggerPrivateData ( IN EFI_SYSTEM_CONTEXT SystemContext, IN BOOLEAN Initialized ) -/*++ - -Routine Description: - - Initialize Debugger private data structure - -Arguments: - - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - Initialized - Whether the DebuggerPrivate data is initialized. - -Returns: - - None - ---*/ { // // clear STEP flag in any condition. @@ -404,6 +357,16 @@ Returns: return EFI_SUCCESS; } +/** + + De-initialize Debugger private data structure. + + @param DebuggerPrivate EBC Debugger private data structure + @param ExceptionType Exception type. + @param SystemContext EBC system context. + @param Initialized Whether the DebuggerPrivate data is initialized. + +**/ EFI_STATUS DeinitDebuggerPrivateData ( IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, @@ -411,24 +374,6 @@ DeinitDebuggerPrivateData ( IN EFI_SYSTEM_CONTEXT SystemContext, IN BOOLEAN Initialized ) -/*++ - -Routine Description: - - De-initialize Debugger private data structure - -Arguments: - - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - Initialized - Whether the DebuggerPrivate data is initialized. - -Returns: - - None - ---*/ { if (!Initialized) { // @@ -468,6 +413,16 @@ Returns: return EFI_SUCCESS; } +/** + + Print the reason of current break to EbcDebugger. + + @param DebuggerPrivate EBC Debugger private data structure + @param ExceptionType Exception type. + @param SystemContext EBC system context. + @param Initialized Whether the DebuggerPrivate data is initialized. + +**/ VOID PrintExceptionReason ( IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, @@ -475,24 +430,6 @@ PrintExceptionReason ( IN EFI_SYSTEM_CONTEXT SystemContext, IN BOOLEAN Initialized ) -/*++ - -Routine Description: - - Print the reason of current break to EbcDebugger. - -Arguments: - - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - Initialized - Whether the DebuggerPrivate data is initialized. - -Returns: - - None - ---*/ { // // Print break status @@ -529,30 +466,22 @@ Returns: return ; } -VOID -EFIAPI -EdbExceptionHandler ( - IN EFI_EXCEPTION_TYPE ExceptionType, - IN OUT EFI_SYSTEM_CONTEXT SystemContext - ) -/*++ - -Routine Description: +/** The default Exception Callback for the VM interpreter. In this function, we report status code, and print debug information about EBC_CONTEXT, then dead loop. -Arguments: - - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - None + @param ExceptionType Exception type. + @param SystemContext EBC system context. ---*/ +**/ +VOID +EFIAPI +EdbExceptionHandler ( + IN EFI_EXCEPTION_TYPE ExceptionType, + IN OUT EFI_SYSTEM_CONTEXT SystemContext + ) { CHAR16 InputBuffer[EFI_DEBUG_INPUS_BUFFER_SIZE]; CHAR16 *CommandArg; diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/Edb.h b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/Edb.h index 91b507e3a1..a08b1b03b1 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/Edb.h +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/Edb.h @@ -1,7 +1,7 @@ -/*++ +/** @file -Copyright (c) 2007, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -9,14 +9,8 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: - Edb.h - -Abstract: - - ---*/ +**/ #ifndef _EFI_EDB_H_ #define _EFI_EDB_H_ @@ -30,15 +24,29 @@ Abstract: #define EFI_DEBUG_BREAK 2 #define EFI_DEBUG_CONTINUE 3 -// -// Function -// +/** + Driver Entry point. + + @param ImageHandle ImageHandle of the loaded driver. + @param SystemTable Pointer to the EFI System Table. + +**/ EFI_STATUS EfiDebuggerEntrypoint ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable ); +/** + + The default Exception Callback for the VM interpreter. + In this function, we report status code, and print debug information + about EBC_CONTEXT, then dead loop. + + @param ExceptionType Exception type. + @param SystemContext EBC system context. + +**/ VOID EFIAPI EdbExceptionHandler ( diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdBranch.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdBranch.c index ab07f72aad..e47bea1167 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdBranch.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdBranch.c @@ -1,7 +1,7 @@ -/*++ +/** @file -Copyright (c) 2007, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -9,14 +9,8 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: - EdbCmdBranch.c - -Abstract: - - ---*/ +**/ #include "Edb.h" @@ -28,25 +22,19 @@ CHAR16 *mBranchTypeStr[] = { L"(JMP8)", }; -CHAR16 * -EdbBranchTypeToStr ( - IN EFI_DEBUGGER_BRANCH_TYPE Type - ) -/*++ - -Routine Description: - - Comvert Branch Type to string +/** -Arguments: + Comvert Branch Type to string. - Type - Branch Type + @param Type Branch Type -Returns: + @retval String string of Branch Type. - String - ---*/ +**/ +CHAR16 * +EdbBranchTypeToStr ( + IN EFI_DEBUGGER_BRANCH_TYPE Type + ) { if (Type < 0 || Type >= EfiDebuggerBranchTypeEbcMax) { return L"(Unknown Type)"; @@ -55,6 +43,18 @@ Returns: return mBranchTypeStr [Type]; } +/** + + DebuggerCommand - CallStack. + + @param CommandArg The argument for this command + @param DebuggerPrivate EBC Debugger private data structure + @param ExceptionType Exception type. + @param SystemContext EBC system context. + + @retval EFI_DEBUG_CONTINUE formal return value + +**/ EFI_DEBUG_STATUS DebuggerCallStack ( IN CHAR16 *CommandArg, @@ -62,24 +62,6 @@ DebuggerCallStack ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - CallStack - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { INTN Index; UINTN SubIndex; @@ -256,6 +238,18 @@ Returns: return EFI_DEBUG_CONTINUE; } +/** + + DebuggerCommand - InstructionBranch. + + @param CommandArg The argument for this command + @param DebuggerPrivate EBC Debugger private data structure + @param ExceptionType Exception type. + @param SystemContext EBC system context. + + @retval EFI_DEBUG_CONTINUE formal return value + +**/ EFI_DEBUG_STATUS DebuggerInstructionBranch ( IN CHAR16 *CommandArg, @@ -263,24 +257,6 @@ DebuggerInstructionBranch ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - InstructionBranch - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { UINTN Index; diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdBreak.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdBreak.c index ab3c7d8fd6..5759a3b9f9 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdBreak.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdBreak.c @@ -1,7 +1,7 @@ -/*++ +/** @file -Copyright (c) 2007, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -9,17 +9,24 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: - EdbCmdBreak.c +**/ -Abstract: +#include "Edb.h" ---*/ +/** -#include "Edb.h" + DebuggerCommand - BreakOnCALL. + + @param CommandArg The argument for this command + @param DebuggerPrivate EBC Debugger private data structure + @param ExceptionType Exception type. + @param SystemContext EBC system context. + @retval EFI_DEBUG_CONTINUE formal return value + +**/ EFI_DEBUG_STATUS DebuggerBreakOnCALL ( IN CHAR16 *CommandArg, @@ -27,24 +34,6 @@ DebuggerBreakOnCALL ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - BreakOnCALL - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { // // Check argument @@ -71,6 +60,19 @@ Returns: return EFI_DEBUG_CONTINUE; } +/** + + DebuggerCommand BreakOnCALLEX. + + + @param CommandArg The argument for this command + @param DebuggerPrivate EBC Debugger private data structure + @param ExceptionType Exceptiont type. + @param SystemContext EBC system context. + + @retval EFI_DEBUG_CONTINUE formal return value + +**/ EFI_DEBUG_STATUS DebuggerBreakOnCALLEX ( IN CHAR16 *CommandArg, @@ -78,24 +80,6 @@ DebuggerBreakOnCALLEX ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - BreakOnCALLEX - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { // // Check argument @@ -122,6 +106,19 @@ Returns: return EFI_DEBUG_CONTINUE; } +/** + + DebuggerCommand - BreakOnRET. + + + @param CommandArg The argument for this command + @param DebuggerPrivate EBC Debugger private data structure + @param ExceptionType Exception type. + @param SystemContext EBC system context. + + @retval EFI_DEBUG_CONTINUE formal return value + +**/ EFI_DEBUG_STATUS DebuggerBreakOnRET ( IN CHAR16 *CommandArg, @@ -129,24 +126,6 @@ DebuggerBreakOnRET ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - BreakOnRET - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { // // Check argument @@ -173,6 +152,19 @@ Returns: return EFI_DEBUG_CONTINUE; } +/** + + DebuggerCommand - BreakOnEntrypoint. + + + @param CommandArg The argument for this command + @param DebuggerPrivate EBC Debugger private data structure + @param ExceptionType Exception type. + @param SystemContext EBC system context. + + @retval EFI_DEBUG_CONTINUE formal return value + +**/ EFI_DEBUG_STATUS DebuggerBreakOnEntrypoint ( IN CHAR16 *CommandArg, @@ -180,24 +172,6 @@ DebuggerBreakOnEntrypoint ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - BreakOnEntrypoint - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { // // Check argument @@ -224,31 +198,28 @@ Returns: return EFI_DEBUG_CONTINUE; } -EFI_DEBUG_STATUS -DebuggerBreakOnThunk ( - IN CHAR16 *CommandArg, - IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, - IN EFI_EXCEPTION_TYPE ExceptionType, - IN OUT EFI_SYSTEM_CONTEXT SystemContext - ) -/*++ +/** -Routine Description: - DebuggerCommand - BreakOnThunk + DebuggerCommand - BreakOnThunk. -Arguments: - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. + @param CommandArg The argument for this command + @param DebuggerPrivate EBC Debugger private data structure + @param ExceptionType Exception type. + @param SystemContext EBC system context. -Returns: - EFI_DEBUG_CONTINUE - formal return value + @retval EFI_DEBUG_CONTINUE formal return value ---*/ +**/ +EFI_DEBUG_STATUS +DebuggerBreakOnThunk ( + IN CHAR16 *CommandArg, + IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, + IN EFI_EXCEPTION_TYPE ExceptionType, + IN OUT EFI_SYSTEM_CONTEXT SystemContext + ) { // // Check argument @@ -275,6 +246,20 @@ Returns: return EFI_DEBUG_CONTINUE; } +/** + + DebuggerCommand - BreakOnKey. + + + @param CommandArg The argument for this command + @param DebuggerPrivate EBC Debugger private data structure + @param ExceptionType Exception type. + @param SystemContext EBC system context. + + + @retval EFI_DEBUG_CONTINUE formal return value + +**/ EFI_DEBUG_STATUS DebuggerBreakOnKey ( IN CHAR16 *CommandArg, @@ -282,24 +267,6 @@ DebuggerBreakOnKey ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - BreakOnKey - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { // // Check argument diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdBreakpoint.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdBreakpoint.c index 7c0122e75c..090c647720 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdBreakpoint.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdBreakpoint.c @@ -1,7 +1,7 @@ -/*++ +/** @file -Copyright (c) 2007 - 2016, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -9,37 +9,25 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: - EdbCmdBreakpoint.c +**/ -Abstract: +#include "Edb.h" +/** ---*/ + Check whether current IP is EBC BREAK3 instruction. -#include "Edb.h" + @param Address EBC IP address. + @retval TRUE Current IP is EBC BREAK3 instruction + @retval FALSE Current IP is not EBC BREAK3 instruction + +**/ BOOLEAN IsEBCBREAK3 ( IN UINTN Address ) -/*++ - -Routine Description: - - Check whether current IP is EBC BREAK3 instruction - -Arguments: - - Address - EBC IP address. - -Returns: - - TRUE - Current IP is EBC BREAK3 instruction - FALSE - Current IP is not EBC BREAK3 instruction - ---*/ { if (GET_OPCODE(Address) != OPCODE_BREAK) { return FALSE; @@ -52,28 +40,22 @@ Returns: } } +/** + + Check whether the Address is already set in breakpoint. + + @param DebuggerPrivate EBC Debugger private data structure + @param Address Breakpoint Address + + @retval TRUE breakpoint is found + @retval FALSE breakpoint is not found + +**/ BOOLEAN DebuggerBreakpointIsDuplicated ( IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN UINTN Address ) -/*++ - -Routine Description: - - Check whether the Address is already set in breakpoint - -Arguments: - - DebuggerPrivate - EBC Debugger private data structure - Address - Breakpoint Address - -Returns: - - TRUE - breakpoint is found - FALSE - breakpoint is not found - ---*/ { UINTN Index; @@ -95,29 +77,23 @@ Returns: return FALSE; } +/** + + Add this breakpoint. + + @param DebuggerPrivate EBC Debugger private data structure + @param Address Breakpoint Address + + @retval EFI_SUCCESS breakpoint added successfully + @retval EFI_ALREADY_STARTED breakpoint is already added + @retval EFI_OUT_OF_RESOURCES all the breakpoint entries are used + +**/ EFI_STATUS DebuggerBreakpointAdd ( IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN UINTN Address ) -/*++ - -Routine Description: - - Add this breakpoint - -Arguments: - - DebuggerPrivate - EBC Debugger private data structure - Address - Breakpoint Address - -Returns: - - EFI_SUCCESS - breakpoint added successfully - EFI_ALREADY_STARTED - breakpoint is already added - EFI_OUT_OF_RESOURCES - all the breakpoint entries are used - ---*/ { // // Check duplicated breakpoint @@ -160,28 +136,22 @@ Returns: return EFI_SUCCESS; } +/** + + Delete this breakpoint. + + @param DebuggerPrivate EBC Debugger private data structure + @param Index Breakpoint Index + + @retval EFI_SUCCESS breakpoint deleted successfully + @retval EFI_NOT_FOUND breakpoint not found + +**/ EFI_STATUS DebuggerBreakpointDel ( IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN UINTN Index ) -/*++ - -Routine Description: - - Delete this breakpoint - -Arguments: - - DebuggerPrivate - EBC Debugger private data structure - Index - Breakpoint Index - -Returns: - - EFI_SUCCESS - breakpoint deleted successfully - EFI_NOT_FOUND - breakpoint not found - ---*/ { UINTN BpIndex; @@ -209,28 +179,22 @@ Returns: return EFI_SUCCESS; } +/** + + Disable this breakpoint. + + @param DebuggerPrivate EBC Debugger private data structure + @param Index Breakpoint Index + + @retval EFI_SUCCESS breakpoint disabled successfully + @retval EFI_NOT_FOUND breakpoint not found + +**/ EFI_STATUS DebuggerBreakpointDis ( IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN UINTN Index ) -/*++ - -Routine Description: - - Disable this breakpoint - -Arguments: - - DebuggerPrivate - EBC Debugger private data structure - Index - Breakpoint Index - -Returns: - - EFI_SUCCESS - breakpoint disabled successfully - EFI_NOT_FOUND - breakpoint not found - ---*/ { if ((Index >= EFI_DEBUGGER_BREAKPOINT_MAX) || (Index >= DebuggerPrivate->DebuggerBreakpointCount)) { @@ -245,28 +209,22 @@ Returns: return EFI_SUCCESS; } +/** + + Enable this breakpoint. + + @param DebuggerPrivate - EBC Debugger private data structure + @param Index - Breakpoint Index + + @retval EFI_SUCCESS - breakpoint enabled successfully + @retval EFI_NOT_FOUND - breakpoint not found + +**/ EFI_STATUS DebuggerBreakpointEn ( IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN UINTN Index ) -/*++ - -Routine Description: - - Enable this breakpoint - -Arguments: - - DebuggerPrivate - EBC Debugger private data structure - Index - Breakpoint Index - -Returns: - - EFI_SUCCESS - breakpoint enabled successfully - EFI_NOT_FOUND - breakpoint not found - ---*/ { if ((Index >= EFI_DEBUGGER_BREAKPOINT_MAX) || (Index >= DebuggerPrivate->DebuggerBreakpointCount)) { @@ -281,6 +239,18 @@ Returns: return EFI_SUCCESS; } +/** + + DebuggerCommand - BreakpointList. + + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Exception type. + @param SystemContext - EBC system context. + + @retval EFI_DEBUG_CONTINUE - formal return value + +**/ EFI_DEBUG_STATUS DebuggerBreakpointList ( IN CHAR16 *CommandArg, @@ -288,24 +258,6 @@ DebuggerBreakpointList ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - BreakpointList - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { UINTN Index; @@ -347,6 +299,18 @@ Returns: return EFI_DEBUG_CONTINUE; } +/** + + DebuggerCommand - BreakpointSet. + + @param CommandArg The argument for this command + @param DebuggerPrivate EBC Debugger private data structure + @param ExceptionType Exception type. + @param SystemContext EBC system context. + + @retval EFI_DEBUG_CONTINUE - formal return value + +**/ EFI_DEBUG_STATUS DebuggerBreakpointSet ( IN CHAR16 *CommandArg, @@ -354,24 +318,6 @@ DebuggerBreakpointSet ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - BreakpointSet - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { UINTN Address; EFI_STATUS Status; @@ -411,6 +357,18 @@ Returns: return EFI_DEBUG_CONTINUE; } +/** + + DebuggerCommand - BreakpointClear + + @param CommandArg The argument for this command + @param DebuggerPrivate EBC Debugger private data structure + @param ExceptionType Exception type. + @param SystemContext EBC system context. + + @retval EFI_DEBUG_CONTINUE formal return value + +**/ EFI_DEBUG_STATUS DebuggerBreakpointClear ( IN CHAR16 *CommandArg, @@ -418,24 +376,6 @@ DebuggerBreakpointClear ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - BreakpointClear - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { UINTN Index; EFI_STATUS Status; @@ -484,6 +424,18 @@ Returns: return EFI_DEBUG_CONTINUE; } +/** + + DebuggerCommand - BreakpointDisable + + @param CommandArg The argument for this command + @param DebuggerPrivate EBC Debugger private data structure + @param ExceptionType Exception type. + @param SystemContext EBC system context. + + @retval EFI_DEBUG_CONTINUE formal return value + +**/ EFI_DEBUG_STATUS DebuggerBreakpointDisable ( IN CHAR16 *CommandArg, @@ -491,24 +443,6 @@ DebuggerBreakpointDisable ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - BreakpointDisable - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { UINTN Index; EFI_STATUS Status; @@ -552,6 +486,17 @@ Returns: return EFI_DEBUG_CONTINUE; } +/** + DebuggerCommand - BreakpointEnable. + + @param CommandArg The argument for this command + @param DebuggerPrivate EBC Debugger private data structure + @param ExceptionType Exception type. + @param SystemContext EBC system context. + + @retval EFI_DEBUG_CONTINUE formal return value + +**/ EFI_DEBUG_STATUS DebuggerBreakpointEnable ( IN CHAR16 *CommandArg, @@ -559,24 +504,6 @@ DebuggerBreakpointEnable ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - BreakpointEnable - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { UINTN Index; EFI_STATUS Status; diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdExtIo.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdExtIo.c index 5a3fe57185..a263d23ef6 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdExtIo.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdExtIo.c @@ -1,7 +1,7 @@ -/*++ +/** @file -Copyright (c) 2007, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -9,17 +9,23 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: - EdbCmdExtIo.c +**/ -Abstract: +#include "Edb.h" +/** ---*/ + DebuggerCommand - IB. -#include "Edb.h" + @param CommandArg The argument for this command + @param DebuggerPrivate EBC Debugger private data structure + @param ExceptionType Exception type. + @param SystemContext EBC system context. + + @retval EFI_DEBUG_CONTINUE formal return value +**/ EFI_DEBUG_STATUS DebuggerExtIoIB ( IN CHAR16 *CommandArg, @@ -27,24 +33,6 @@ DebuggerExtIoIB ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - IB - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { EDBPrint (L"Unsupported\n"); // @@ -53,6 +41,20 @@ Returns: return EFI_DEBUG_CONTINUE; } + +/** + + DebuggerCommand - IW. + + + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Exception type. + @param SystemContext - EBC system context. + + @retval EFI_DEBUG_CONTINUE - formal return value + +**/ EFI_DEBUG_STATUS DebuggerExtIoIW ( IN CHAR16 *CommandArg, @@ -60,24 +62,6 @@ DebuggerExtIoIW ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - IW - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { EDBPrint (L"Unsupported\n"); // @@ -86,6 +70,19 @@ Returns: return EFI_DEBUG_CONTINUE; } +/** + + DebuggerCommand - ID. + + + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Exception type. + @param SystemContext - EBC system context. + + @retval EFI_DEBUG_CONTINUE - formal return value + +**/ EFI_DEBUG_STATUS DebuggerExtIoID ( IN CHAR16 *CommandArg, @@ -93,24 +90,6 @@ DebuggerExtIoID ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - ID - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { EDBPrint (L"Unsupported\n"); // @@ -119,6 +98,18 @@ Returns: return EFI_DEBUG_CONTINUE; } +/** + + DebuggerCommand - OB. + + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Interrupt type. + @param SystemContext - EBC system context. + + @retval EFI_DEBUG_CONTINUE - formal return value + +**/ EFI_DEBUG_STATUS DebuggerExtIoOB ( IN CHAR16 *CommandArg, @@ -126,24 +117,6 @@ DebuggerExtIoOB ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - OB - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { EDBPrint (L"Unsupported\n"); // @@ -152,6 +125,19 @@ Returns: return EFI_DEBUG_CONTINUE; } + +/** + + DebuggerCommand - OW. + + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Interrupt type. + @param SystemContext - EBC system context. + + @retval EFI_DEBUG_CONTINUE - formal return value + +**/ EFI_DEBUG_STATUS DebuggerExtIoOW ( IN CHAR16 *CommandArg, @@ -159,24 +145,6 @@ DebuggerExtIoOW ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - OW - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { EDBPrint (L"Unsupported\n"); // @@ -185,6 +153,19 @@ Returns: return EFI_DEBUG_CONTINUE; } + +/** + + DebuggerCommand - OD. + + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Interrupt type. + @param SystemContext - EBC system context. + + @retval EFI_DEBUG_CONTINUE - formal return value + +**/ EFI_DEBUG_STATUS DebuggerExtIoOD ( IN CHAR16 *CommandArg, @@ -192,24 +173,6 @@ DebuggerExtIoOD ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - OD - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { EDBPrint (L"Unsupported\n"); // diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdExtPci.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdExtPci.c index adb29f8c34..07b5e4854a 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdExtPci.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdExtPci.c @@ -1,7 +1,7 @@ -/*++ +/** @file -Copyright (c) 2007, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -9,17 +9,23 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: - EdbCmdExtPci.c +**/ -Abstract: +#include "Edb.h" +/** ---*/ + DebuggerCommand - PCIL. -#include "Edb.h" + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Interrupt type. + @param SystemContext - EBC system context. + @retval EFI_DEBUG_CONTINUE - formal return value + +**/ EFI_DEBUG_STATUS DebuggerExtPciPCIL ( IN CHAR16 *CommandArg, @@ -27,24 +33,6 @@ DebuggerExtPciPCIL ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - PCIL - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { EDBPrint (L"Unsupported\n"); // @@ -53,6 +41,18 @@ Returns: return EFI_DEBUG_CONTINUE; } +/** + + DebuggerCommand - PCID. + + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Interrupt type. + @param SystemContext - EBC system context. + + @retval EFI_DEBUG_CONTINUE - formal return value + +**/ EFI_DEBUG_STATUS DebuggerExtPciPCID ( IN CHAR16 *CommandArg, @@ -60,24 +60,6 @@ DebuggerExtPciPCID ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - PCID - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { EDBPrint (L"Unsupported\n"); // @@ -86,6 +68,18 @@ Returns: return EFI_DEBUG_CONTINUE; } +/** + + DebuggerCommand - CFGB. + + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Interrupt type. + @param SystemContext - EBC system context. + + @retval EFI_DEBUG_CONTINUE - formal return value + +**/ EFI_DEBUG_STATUS DebuggerExtPciCFGB ( IN CHAR16 *CommandArg, @@ -93,24 +87,6 @@ DebuggerExtPciCFGB ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - CFGB - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { EDBPrint (L"Unsupported\n"); // @@ -119,6 +95,19 @@ Returns: return EFI_DEBUG_CONTINUE; } + +/** + + DebuggerCommand - CFGW. + + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Interrupt type. + @param SystemContext - EBC system context. + + @retval EFI_DEBUG_CONTINUE - formal return value + +**/ EFI_DEBUG_STATUS DebuggerExtPciCFGW ( IN CHAR16 *CommandArg, @@ -126,24 +115,6 @@ DebuggerExtPciCFGW ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - CFGW - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { EDBPrint (L"Unsupported\n"); // @@ -152,6 +123,18 @@ Returns: return EFI_DEBUG_CONTINUE; } +/** + + DebuggerCommand - CFGD. + + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Interrupt type. + @param SystemContext - EBC system context. + + @retval EFI_DEBUG_CONTINUE - formal return value + +**/ EFI_DEBUG_STATUS DebuggerExtPciCFGD ( IN CHAR16 *CommandArg, @@ -159,24 +142,6 @@ DebuggerExtPciCFGD ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - CFGD - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { EDBPrint (L"Unsupported\n"); // diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdGo.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdGo.c index d5dee8a471..8c68879863 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdGo.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdGo.c @@ -1,7 +1,7 @@ -/*++ +/** @file -Copyright (c) 2007, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -9,17 +9,25 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: - EdbCmdGo.c -Abstract: +**/ +#include "Edb.h" ---*/ +/** -#include "Edb.h" + DebuggerCommand - Go. + + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Interrupt type. + @param SystemContext - EBC system context. + @retval EFI_DEBUG_BREAK - formal return value + @retval EFI_DEBUG_CONTINUE - something wrong + +**/ EFI_DEBUG_STATUS DebuggerGo ( IN CHAR16 *CommandArg, @@ -27,25 +35,6 @@ DebuggerGo ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - Go - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_BREAK - formal return value - EFI_DEBUG_CONTINUE - something wrong - ---*/ { UINTN Address; CHAR16 *CommandStr; diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdHelp.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdHelp.c index ae5acd7147..5cbed02f19 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdHelp.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdHelp.c @@ -1,7 +1,7 @@ -/*++ +/** @file -Copyright (c) 2007, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -9,17 +9,23 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: - EdbCmdHelp.c +**/ -Abstract: +#include "Edb.h" +/** ---*/ + DebuggerCommand - Help. -#include "Edb.h" + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Interrupt type. + @param SystemContext - EBC system context. + + @retval EFI_DEBUG_CONTINUE - formal return value +**/ EFI_DEBUG_STATUS DebuggerHelp ( IN CHAR16 *CommandArg, @@ -27,24 +33,6 @@ DebuggerHelp ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - Help - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { UINTN Index; diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c index 65b220a06c..74c17bd248 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdMemory.c @@ -1,7 +1,7 @@ -/*++ +/** @file -Copyright (c) 2007, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -9,38 +9,27 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: - EdbCmdMemory.c +**/ -Abstract: +#include "Edb.h" ---*/ +/** -#include "Edb.h" + Display memory unit. + + @param Address - Memory Address + @param Width - Memory Width + @return Length of the memory unit + +**/ UINTN EdbDisplayMemoryUnit ( IN UINTN Address, IN EDB_DATA_WIDTH Width ) -/*++ - -Routine Description: - - Display memory unit - -Arguments: - - Address - Memory Address - Width - Memory Width - -Returns: - - Length of the memory unit - ---*/ { UINT8 Data8; UINT16 Data16; @@ -78,29 +67,21 @@ Returns: return 0; } +/** + + Display memory. + + @param Address - Memory Address + @param Count - Memory Count + @param Width - Memory Width + +**/ VOID EdbDisplayMemory ( IN UINTN Address, IN UINTN Count, IN EDB_DATA_WIDTH Width ) -/*++ - -Routine Description: - - Display memory - -Arguments: - - Address - Memory Address - Count - Memory Count - Width - Memory Width - -Returns: - - None - ---*/ { UINTN LineNumber; UINTN ByteNumber; @@ -182,29 +163,21 @@ Returns: return ; } +/** + + Entry memory. + + @param Address - Memory Address + @param Value - Memory Value + @param Width - Memory Width + +**/ VOID EdbEnterMemory ( IN UINTN Address, IN VOID *Value, IN EDB_DATA_WIDTH Width ) -/*++ - -Routine Description: - - Entry memory - -Arguments: - - Address - Memory Address - Value - Memory Value - Width - Memory Width - -Returns: - - None - ---*/ { switch (Width) { case EdbWidthUint8: @@ -226,30 +199,24 @@ Returns: return ; } +/** + + Get memory address and count. + + @param CommandArg - The argument for this command + @param Address - Memory Address + @param Count - Memory Count + + @retval EFI_SUCCESS - memory address and count are got + @retval EFI_INVALID_PARAMETER - something wrong + +**/ EFI_STATUS EdbGetMemoryAddressCount ( IN CHAR16 *CommandArg, IN UINTN *Address, IN UINTN *Count ) -/*++ - -Routine Description: - - Get memory address and count - -Arguments: - - CommandArg - The argument for this command - Address - Memory Address - Count - Memory Count - -Returns: - - EFI_SUCCESS - memory address and count are got - EFI_INVALID_PARAMETER - something wrong - ---*/ { CHAR16 *CommandStr; UINTN MemAddress; @@ -293,30 +260,24 @@ Returns: return EFI_SUCCESS; } +/** + + Get memory address and value. + + @param CommandArg - The argument for this command + @param Address - Memory Address + @param Value - Memory Value + + @retval EFI_SUCCESS - memory address and value are got + @retval EFI_INVALID_PARAMETER - something wrong + +**/ EFI_STATUS EdbGetMemoryAddressValue ( IN CHAR16 *CommandArg, IN UINTN *Address, IN UINT64 *Value ) -/*++ - -Routine Description: - - Get memory address and value - -Arguments: - - CommandArg - The argument for this command - Address - Memory Address - Value - Memory Value - -Returns: - - EFI_SUCCESS - memory address and value are got - EFI_INVALID_PARAMETER - something wrong - ---*/ { CHAR16 *CommandStr; UINTN MemAddress; @@ -360,27 +321,21 @@ Returns: return EFI_SUCCESS; } +/** + + Display memory. + + @param CommandArg - The argument for this command + @param Width - Memory Width + + @retval EFI_DEBUG_RETURN - formal return value + +**/ EFI_DEBUG_STATUS DebuggerMemoryDisplay ( IN CHAR16 *CommandArg, IN EDB_DATA_WIDTH Width ) -/*++ - -Routine Description: - - Display memory - -Arguments: - - CommandArg - The argument for this command - Width - Memory Width - -Returns: - - EFI_DEBUG_RETURN - formal return value - ---*/ { EFI_STATUS Status; UINTN Address; @@ -405,27 +360,21 @@ Returns: return EFI_DEBUG_CONTINUE; } +/** + + Enter memory. + + @param CommandArg - The argument for this command + @param Width - Memory Width + + @retval EFI_DEBUG_RETURN - formal return value + +**/ EFI_DEBUG_STATUS DebuggerMemoryEnter ( IN CHAR16 *CommandArg, IN EDB_DATA_WIDTH Width ) -/*++ - -Routine Description: - - Enter memory - -Arguments: - - CommandArg - The argument for this command - Width - Memory Width - -Returns: - - EFI_DEBUG_RETURN - formal return value - ---*/ { EFI_STATUS Status; UINTN Address; @@ -450,6 +399,18 @@ Returns: return EFI_DEBUG_CONTINUE; } +/** + + DebuggerCommand - DB. + + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Interrupt type. + @param SystemContext - EBC system context. + + @retval EFI_DEBUG_RETURN - formal return value + +**/ EFI_DEBUG_STATUS DebuggerMemoryDB ( IN CHAR16 *CommandArg, @@ -457,28 +418,22 @@ DebuggerMemoryDB ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - DB +{ + return DebuggerMemoryDisplay (CommandArg, EdbWidthUint8); +} -Arguments: +/** - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. + DebuggerCommand - DW. -Returns: + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Interrupt type. + @param SystemContext - EBC system context. - EFI_DEBUG_RETURN - formal return value - ---*/ -{ - return DebuggerMemoryDisplay (CommandArg, EdbWidthUint8); -} + @retval EFI_DEBUG_RETURN - formal return value +**/ EFI_DEBUG_STATUS DebuggerMemoryDW ( IN CHAR16 *CommandArg, @@ -486,28 +441,22 @@ DebuggerMemoryDW ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - DW +{ + return DebuggerMemoryDisplay (CommandArg, EdbWidthUint16); +} -Arguments: +/** - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. + DebuggerCommand - DD. -Returns: + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Interrupt type. + @param SystemContext - EBC system context. - EFI_DEBUG_RETURN - formal return value - ---*/ -{ - return DebuggerMemoryDisplay (CommandArg, EdbWidthUint16); -} + @retval EFI_DEBUG_RETURN - formal return value +**/ EFI_DEBUG_STATUS DebuggerMemoryDD ( IN CHAR16 *CommandArg, @@ -515,28 +464,22 @@ DebuggerMemoryDD ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - DD - -Arguments: +{ + return DebuggerMemoryDisplay (CommandArg, EdbWidthUint32); +} - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. +/** -Returns: + DebuggerCommand - DQ. - EFI_DEBUG_RETURN - formal return value + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Exception type. + @param SystemContext - EBC system context. ---*/ -{ - return DebuggerMemoryDisplay (CommandArg, EdbWidthUint32); -} + @retval EFI_DEBUG_RETURN - formal return value +**/ EFI_DEBUG_STATUS DebuggerMemoryDQ ( IN CHAR16 *CommandArg, @@ -544,28 +487,22 @@ DebuggerMemoryDQ ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - DQ - -Arguments: +{ + return DebuggerMemoryDisplay (CommandArg, EdbWidthUint64); +} - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. +/** -Returns: + DebuggerCommand - EB. - EFI_DEBUG_RETURN - formal return value + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Exception type. + @param SystemContext - EBC system context. ---*/ -{ - return DebuggerMemoryDisplay (CommandArg, EdbWidthUint64); -} + @retval EFI_DEBUG_RETURN - formal return value +**/ EFI_DEBUG_STATUS DebuggerMemoryEB ( IN CHAR16 *CommandArg, @@ -573,28 +510,22 @@ DebuggerMemoryEB ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - EB +{ + return DebuggerMemoryEnter (CommandArg, EdbWidthUint8); +} -Arguments: +/** - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. + DebuggerCommand - EW. -Returns: + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Interrupt type. + @param SystemContext - EBC system context. - EFI_DEBUG_RETURN - formal return value - ---*/ -{ - return DebuggerMemoryEnter (CommandArg, EdbWidthUint8); -} + @retval EFI_DEBUG_RETURN - formal return value +**/ EFI_DEBUG_STATUS DebuggerMemoryEW ( IN CHAR16 *CommandArg, @@ -602,28 +533,22 @@ DebuggerMemoryEW ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - EW +{ + return DebuggerMemoryEnter (CommandArg, EdbWidthUint16); +} -Arguments: +/** - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. + DebuggerCommand - ED. -Returns: + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Exception type. + @param SystemContext - EBC system context. - EFI_DEBUG_RETURN - formal return value - ---*/ -{ - return DebuggerMemoryEnter (CommandArg, EdbWidthUint16); -} + @retval EFI_DEBUG_RETURN - formal return value +**/ EFI_DEBUG_STATUS DebuggerMemoryED ( IN CHAR16 *CommandArg, @@ -631,28 +556,22 @@ DebuggerMemoryED ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - ED - -Arguments: +{ + return DebuggerMemoryEnter (CommandArg, EdbWidthUint32); +} - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. +/** -Returns: + DebuggerCommand - EQ. - EFI_DEBUG_RETURN - formal return value + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Exception type. + @param SystemContext - EBC system context. ---*/ -{ - return DebuggerMemoryEnter (CommandArg, EdbWidthUint32); -} + @retval EFI_DEBUG_RETURN - formal return value +**/ EFI_DEBUG_STATUS DebuggerMemoryEQ ( IN CHAR16 *CommandArg, @@ -660,24 +579,6 @@ DebuggerMemoryEQ ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - EQ - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_RETURN - formal return value - ---*/ { return DebuggerMemoryEnter (CommandArg, EdbWidthUint64); } diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdQuit.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdQuit.c index d3a7a6deba..fa53eb8bc0 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdQuit.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdQuit.c @@ -1,7 +1,7 @@ -/*++ +/** @file -Copyright (c) 2007, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007, Intel Corporation.All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -16,10 +16,22 @@ Module Name: Abstract: ---*/ +**/ #include "Edb.h" +/** + + DebuggerCommand - Quit + + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Exception type. + @param SystemContext - EBC system context. + + @retval EFI_DEBUG_RETURN - formal return value + +**/ EFI_DEBUG_STATUS DebuggerQuit ( IN CHAR16 *CommandArg, @@ -27,24 +39,6 @@ DebuggerQuit ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - Quit - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_RETURN - formal return value - ---*/ { return EFI_DEBUG_RETURN; } diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdRegister.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdRegister.c index 3d9fdae5b5..7755024a64 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdRegister.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdRegister.c @@ -1,7 +1,7 @@ -/*++ +/** @file -Copyright (c) 2007, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007, Intel Corporation.All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -9,17 +9,23 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: - EdbCmdRegister.c +**/ -Abstract: +#include "Edb.h" +/** ---*/ + DebuggerCommand - Register. -#include "Edb.h" + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Exception type. + @param SystemContext - EBC system context. + + @retval EFI_DEBUG_CONTINUE - formal return value +**/ EFI_DEBUG_STATUS DebuggerRegister ( IN CHAR16 *CommandArg, @@ -27,24 +33,6 @@ DebuggerRegister ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - Register - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { CHAR16 *RegName; CHAR16 *RegValStr; diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdScope.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdScope.c index 9b62c523a8..49a21bd2d1 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdScope.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdScope.c @@ -1,7 +1,7 @@ -/*++ +/** @file -Copyright (c) 2007, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -9,17 +9,23 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: - EdbCmdScope.c +**/ -Abstract: +#include "Edb.h" +/** ---*/ + DebuggerCommand - Scope. -#include "Edb.h" + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Exception type. + @param SystemContext - EBC system context. + + @retval EFI_DEBUG_CONTINUE - formal return value +**/ EFI_DEBUG_STATUS DebuggerScope ( IN CHAR16 *CommandArg, @@ -27,24 +33,6 @@ DebuggerScope ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - Scope - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { EFI_STATUS Status; UINTN Address; @@ -79,6 +67,18 @@ Returns: return EFI_DEBUG_CONTINUE; } +/** + + DebuggerCommand - List. + + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Exception type. + @param SystemContext - EBC system context. + + @retval EFI_DEBUG_CONTINUE - formal return value + +**/ EFI_DEBUG_STATUS DebuggerList ( IN CHAR16 *CommandArg, @@ -86,24 +86,6 @@ DebuggerList ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - List - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { if (CommandArg == NULL) { EdbShowDisasm (DebuggerPrivate, SystemContext); diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdStep.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdStep.c index 186c88d1a4..f4ecf5dd89 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdStep.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdStep.c @@ -1,7 +1,7 @@ -/*++ +/** @file -Copyright (c) 2007, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -9,37 +9,25 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: - EdbCmdStep.c +**/ -Abstract: +#include "Edb.h" + +/** + Check whether current IP is EBC CALL instruction (NOTE: CALLEX is exclusive) ---*/ + @param Address - EBC IP address. -#include "Edb.h" + @retval TRUE - Current IP is EBC CALL instruction + @retval FALSE - Current IP is not EBC CALL instruction +**/ BOOLEAN IsEBCCALL ( IN UINTN Address ) -/*++ - -Routine Description: - - Check whether current IP is EBC CALL instruction (NOTE: CALLEX is exclusive) - -Arguments: - - Address - EBC IP address. - -Returns: - - TRUE - Current IP is EBC CALL instruction - FALSE - Current IP is not EBC CALL instruction - ---*/ { if (GET_OPCODE(Address) != OPCODE_CALL) { return FALSE; @@ -52,26 +40,20 @@ Returns: } } -BOOLEAN -IsEBCRET ( - IN UINTN Address - ) -/*++ - -Routine Description: - - Check whether current IP is EBC RET instruction +/** -Arguments: + Check whether current IP is EBC RET instruction. - Address - EBC IP address. + @param Address - EBC IP address. -Returns: + @retval TRUE - Current IP is EBC RET instruction + @retval FALSE - Current IP is not EBC RET instruction - TRUE - Current IP is EBC RET instruction - FALSE - Current IP is not EBC RET instruction - ---*/ +**/ +BOOLEAN +IsEBCRET ( + IN UINTN Address + ) { if (GET_OPCODE(Address) != OPCODE_RET) { return FALSE; @@ -84,6 +66,18 @@ Returns: } } +/** + + DebuggerCommand - StepInto. + + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Exception type. + @param SystemContext - EBC system context. + + @retval EFI_DEBUG_CONTINUE - formal return value + +**/ EFI_DEBUG_STATUS DebuggerStepInto ( IN CHAR16 *CommandArg, @@ -91,30 +85,24 @@ DebuggerStepInto ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - StepInto - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { SystemContext.SystemContextEbc->Flags |= VMFLAGS_STEP; return EFI_DEBUG_BREAK; } +/** + + DebuggerCommand - StepOver. + + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Exception type. + @param SystemContext - EBC system context. + + @retval EFI_DEBUG_CONTINUE - formal return value + +**/ EFI_DEBUG_STATUS DebuggerStepOver ( IN CHAR16 *CommandArg, @@ -122,24 +110,6 @@ DebuggerStepOver ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - StepOver - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { if (IsEBCCALL((UINTN)SystemContext.SystemContextEbc->Ip)) { // @@ -156,6 +126,18 @@ Returns: return EFI_DEBUG_BREAK; } +/** + + DebuggerCommand - StepOut. + + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Exception type. + @param SystemContext - EBC system context. + + @retval EFI_DEBUG_CONTINUE - formal return value + +**/ EFI_DEBUG_STATUS DebuggerStepOut ( IN CHAR16 *CommandArg, @@ -163,24 +145,6 @@ DebuggerStepOut ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - StepOut - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { if (IsEBCRET((UINTN)SystemContext.SystemContextEbc->Ip)) { // diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c index 8a418d5190..9c5707ecf3 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c @@ -1,7 +1,7 @@ -/*++ +/** @file -Copyright (c) 2007 - 2016, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -9,36 +9,24 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: - EdbCmdSymbol.c +**/ -Abstract: +#include "Edb.h" +/** ---*/ + Get file name from full path. -#include "Edb.h" + @param FullPath - full file path + + @return file name +**/ CHAR16 * GetFileNameFromFullPath ( IN CHAR16 *FullPath ) -/*++ - -Routine Description: - - Get file name from full path - -Arguments: - - FullPath - full file path - -Returns: - - file name - ---*/ { CHAR16 *FileName; CHAR16 *TempFileName; @@ -55,25 +43,19 @@ Returns: return FileName; } -CHAR16 * -GetDirNameFromFullPath ( - IN CHAR16 *FullPath - ) -/*++ +/** -Routine Description: + Get dir name from full path. - Get dir name from full path + @param FullPath - full file path -Arguments: + @return dir name - FullPath - full file path - -Returns: - - dir name - ---*/ +**/ +CHAR16 * +GetDirNameFromFullPath ( + IN CHAR16 *FullPath + ) { CHAR16 *FileName; @@ -86,29 +68,23 @@ Returns: return L""; } +/** + + Construct full path accroding to dir and file path. + + @param DirPath - dir path + @param FilePath - file path + @param Size - dir max size + + @return Full file name + +**/ CHAR16 * ConstructFullPath ( IN CHAR16 *DirPath, IN CHAR16 *FilePath, IN UINTN Size ) -/*++ - -Routine Description: - - Construct full path accroding to dir and file path - -Arguments: - - DirPath - dir path - FilePath - file path - Size - dir max size - -Returns: - - Full file name - ---*/ { UINTN DirPathSize; @@ -128,25 +104,19 @@ CHAR16 *mSymbolTypeStr[] = { L"(SV)", }; -CHAR16 * -EdbSymbolTypeToStr ( - IN EFI_DEBUGGER_SYMBOL_TYPE Type - ) -/*++ - -Routine Description: - - Comvert Symbol Type to string - -Arguments: +/** - Type - Symbol Type + Comvert Symbol Type to string. -Returns: + @param Type - Symbol Type - String + @return String ---*/ +**/ +CHAR16 * +EdbSymbolTypeToStr ( + IN EFI_DEBUGGER_SYMBOL_TYPE Type + ) { if (Type < 0 || Type >= EfiDebuggerSymbolTypeMax) { return L"(?)"; @@ -155,27 +125,21 @@ Returns: return mSymbolTypeStr [Type]; } +/** + + Find the symbol accroding to address and display symbol. + + @param Address - SymbolAddress + @param DebuggerPrivate - EBC Debugger private data structure + + @retval EFI_DEBUG_CONTINUE - formal return value + +**/ EFI_DEBUG_STATUS DebuggerDisplaySymbolAccrodingToAddress ( IN UINTN Address, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate ) -/*++ - -Routine Description: - - Find the symbol accroding to address and display symbol - -Arguments: - - Address - SymbolAddress - DebuggerPrivate - EBC Debugger private data structure - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { EFI_DEBUGGER_SYMBOL_OBJECT *Object; EFI_DEBUGGER_SYMBOL_ENTRY *Entry; @@ -224,29 +188,23 @@ Returns: return EFI_DEBUG_CONTINUE; } +/** + + Find the symbol accroding to name and display symbol. + + @param SymbolFileName - The Symbol File Name, NULL means for all + @param SymbolName - The Symbol Name, NULL means for all + @param DebuggerPrivate - EBC Debugger private data structure + + @retval EFI_DEBUG_CONTINUE - formal return value + +**/ EFI_DEBUG_STATUS DebuggerDisplaySymbolAccrodingToName ( IN CHAR16 *SymbolFileName, IN CHAR16 *SymbolName, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate ) -/*++ - -Routine Description: - - Find the symbol accroding to name and display symbol - -Arguments: - - SymbolFileName - The Symbol File Name, NULL means for all - SymbolName - The Symbol Name, NULL means for all - DebuggerPrivate - EBC Debugger private data structure - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { UINTN Index; UINTN SubIndex; @@ -338,6 +296,18 @@ Returns: return EFI_DEBUG_CONTINUE; } +/** + + DebuggerCommand - ListSymbol. + + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Exception type. + @param SystemContext - EBC system context. + + @retval EFI_DEBUG_CONTINUE - formal return value + +**/ EFI_DEBUG_STATUS DebuggerListSymbol ( IN CHAR16 *CommandArg, @@ -345,24 +315,6 @@ DebuggerListSymbol ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - ListSymbol - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { CHAR16 *SymbolFileName; CHAR16 *SymbolName; @@ -425,6 +377,18 @@ Returns: return DebuggerDisplaySymbolAccrodingToName (SymbolFileName, SymbolName, DebuggerPrivate); } +/** + + DebuggerCommand - LoadSymbol. + + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Exception type. + @param SystemContext - EBC system context. + + @retval EFI_DEBUG_CONTINUE - formal return value + +**/ EFI_DEBUG_STATUS DebuggerLoadSymbol ( IN CHAR16 *CommandArg, @@ -432,24 +396,6 @@ DebuggerLoadSymbol ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - LoadSymbol - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { UINTN BufferSize; VOID *Buffer; @@ -590,6 +536,18 @@ Returns: return EFI_DEBUG_CONTINUE; } +/** + + DebuggerCommand - UnloadSymbol + + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Exception type. + @param SystemContext - EBC system context. + + @retval EFI_DEBUG_CONTINUE - formal return value + +**/ EFI_DEBUG_STATUS DebuggerUnloadSymbol ( IN CHAR16 *CommandArg, @@ -597,24 +555,6 @@ DebuggerUnloadSymbol ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - UnloadSymbol - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { EFI_STATUS Status; CHAR16 *FileName; @@ -696,6 +636,18 @@ Returns: return EFI_DEBUG_CONTINUE; } +/** + + DebuggerCommand - DisplaySymbol. + + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Exception type. + @param SystemContext - EBC system context. + + @retval EFI_DEBUG_CONTINUE - formal return value + +**/ EFI_DEBUG_STATUS DebuggerDisplaySymbol ( IN CHAR16 *CommandArg, @@ -703,24 +655,6 @@ DebuggerDisplaySymbol ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - DisplaySymbol - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { if (CommandArg == NULL) { DebuggerPrivate->DebuggerSymbolContext.DisplaySymbol = !DebuggerPrivate->DebuggerSymbolContext.DisplaySymbol; @@ -738,6 +672,18 @@ Returns: return EFI_DEBUG_CONTINUE; } +/** + + DebuggerCommand - LoadCode. + + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Exception type. + @param SystemContext - EBC system context. + + @retval EFI_DEBUG_CONTINUE - formal return value + +**/ EFI_DEBUG_STATUS DebuggerLoadCode ( IN CHAR16 *CommandArg, @@ -745,24 +691,6 @@ DebuggerLoadCode ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - LoadCode - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { UINTN BufferSize; VOID *Buffer; @@ -838,6 +766,18 @@ Returns: return EFI_DEBUG_CONTINUE; } +/** + + DebuggerCommand - UnloadCode. + + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Exception type. + @param SystemContext - EBC system context. + + @retval EFI_DEBUG_CONTINUE - formal return value + +**/ EFI_DEBUG_STATUS DebuggerUnloadCode ( IN CHAR16 *CommandArg, @@ -845,24 +785,6 @@ DebuggerUnloadCode ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - UnloadCode - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { CHAR16 *CommandArg2; CHAR16 *FileName; @@ -909,6 +831,18 @@ Returns: return EFI_DEBUG_CONTINUE; } +/** + + DebuggerCommand - DisplayCode. + + @param CommandArg - The argument for this command + @param DebuggerPrivate - EBC Debugger private data structure + @param ExceptionType - Exception type. + @param SystemContext - EBC system context. + + @retval EFI_DEBUG_CONTINUE - formal return value + +**/ EFI_DEBUG_STATUS DebuggerDisplayCode ( IN CHAR16 *CommandArg, @@ -916,24 +850,6 @@ DebuggerDisplayCode ( IN EFI_EXCEPTION_TYPE ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - DebuggerCommand - DisplayCode - -Arguments: - - CommandArg - The argument for this command - DebuggerPrivate - EBC Debugger private data structure - InterruptType - Interrupt type. - SystemContext - EBC system context. - -Returns: - - EFI_DEBUG_CONTINUE - formal return value - ---*/ { if (CommandArg == NULL) { DebuggerPrivate->DebuggerSymbolContext.DisplayCodeOnly = !DebuggerPrivate->DebuggerSymbolContext.DisplayCodeOnly; diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCommand.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCommand.c index b72e2bf5ae..a59b2566fa 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCommand.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCommand.c @@ -1,7 +1,7 @@ -/*++ +/** @file -Copyright (c) 2007, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007, Intel Corporation All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -9,14 +9,8 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: - EdbCommand.c - -Abstract: - - ---*/ +**/ #include "Edb.h" @@ -578,28 +572,22 @@ EFI_DEBUGGER_COMMAND_SET mDebuggerCommandSet[] = { }, }; +/** + + Find the command according to name. + + @param CommandName - Command Name + @param CommandArg - Command Argument + + @return Not NULL - The DebuggerCommand is found successfully + @return NULL - not found + +**/ EFI_DEBUGGER_COMMAND MatchDebuggerCommand ( IN CHAR16 *CommandName, IN CHAR16 **CommandArg ) -/*++ - -Routine Description: - - Find the command according to name - -Arguments: - - CommandName - Command Name - CommandArg - Command Argument - -Returns: - - Not NULL - The DebuggerCommand is found successfully - NULL - not found - ---*/ { UINTN Index; CHAR16 *Temp; @@ -637,26 +625,20 @@ Returns: return NULL; } -CHAR16 * -GetCommandNameByKey ( - IN EFI_INPUT_KEY CommandKey - ) -/*++ - -Routine Description: +/** - Find the command name according to the function key + Find the command name according to the function key. -Arguments: + @param CommandKey - Command Function Key - CommandKey - Command Function Key + @return Not NULL - The DebuggerName is found successfully + @return NULL - not found -Returns: - - Not NULL - The DebuggerName is found successfully - NULL - not found - ---*/ +**/ +CHAR16 * +GetCommandNameByKey ( + IN EFI_INPUT_KEY CommandKey + ) { UINTN Index; diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCommand.h b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCommand.h index 7acf4deb86..141879f433 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCommand.h +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCommand.h @@ -1,7 +1,7 @@ -/*++ +/** @file -Copyright (c) 2007, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -9,14 +9,8 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: - EdbCommand.h - -Abstract: - - ---*/ +**/ #ifndef _EFI_EDB_COMMAND_H_ #define _EFI_EDB_COMMAND_H_ @@ -29,12 +23,33 @@ typedef enum { EdbWidthMax } EDB_DATA_WIDTH; +/** + + Find the command according to name. + + @param CommandName - Command Name + @param CommandArg - Command Argument + + @return Not NULL - The DebuggerCommand is found successfully + @return NULL - not found + +**/ EFI_DEBUGGER_COMMAND MatchDebuggerCommand ( IN CHAR16 *CommandName, IN CHAR16 **CommandArg ); +/** + + Find the command name according to the function key. + + @param CommandKey - Command Function Key + + @return Not NULL - The DebuggerName is found successfully + @return NULL - not found + +**/ CHAR16 * GetCommandNameByKey ( IN EFI_INPUT_KEY CommandKey diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCommon.h b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCommon.h index 616c369253..2a54be1605 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCommon.h +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCommon.h @@ -1,7 +1,7 @@ -/*++ +/** @file -Copyright (c) 2007, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -9,14 +9,7 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: - - EdbCommon.h - -Abstract: - - ---*/ +**/ #ifndef _EFI_EDB_COMMON_H_ #define _EFI_EDB_COMMON_H_ diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasm.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasm.c index 52800f7fd1..dab53a02cf 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasm.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasm.c @@ -1,7 +1,7 @@ -/*++ +/** @file -Copyright (c) 2007, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -9,14 +9,8 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: - EdbDisasm.c - -Abstract: - - ---*/ +**/ #include "Edb.h" @@ -117,29 +111,23 @@ EDB_DISASM_INSTRUCTION mEdbDisasmInstructionTable[] = { EdbDisasmMOVREL, // opcode 0x39 MOVREL }; +/** + + Disasm instruction - BREAK. + + @param InstructionAddress - The instruction address + @param SystemContext - EBC system context. + @param DisasmString - The instruction string + + @return Instruction length + +**/ UINTN EdbDisasmBREAK ( IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_SYSTEM_CONTEXT SystemContext, OUT CHAR16 **DisasmString ) -/*++ - -Routine Description: - - Disasm instruction - BREAK - -Arguments: - - InstructionAddress - The instruction address - SystemContext - EBC system context. - DisasmString - The instruction string - -Returns: - - Instruction length - ---*/ { ASSERT (GET_OPCODE(InstructionAddress) == OPCODE_BREAK); @@ -164,29 +152,23 @@ Returns: extern CONST UINT8 mJMPLen[]; +/** + + Disasm instruction - JMP. + + @param InstructionAddress - The instruction address + @param SystemContext - EBC system context. + @param DisasmString - The instruction string + + @return Instruction length + +**/ UINTN EdbDisasmJMP ( IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_SYSTEM_CONTEXT SystemContext, OUT CHAR16 **DisasmString ) -/*++ - -Routine Description: - - Disasm instruction - JMP - -Arguments: - - InstructionAddress - The instruction address - SystemContext - EBC system context. - DisasmString - The instruction string - -Returns: - - Instruction length - ---*/ { UINT8 Modifiers; UINT8 Operands; @@ -248,29 +230,23 @@ Returns: return Size; } +/** + + Disasm instruction - JMP8. + + @param InstructionAddress - The instruction address + @param SystemContext - EBC system context. + @param DisasmString - The instruction string + + @return Instruction length + +**/ UINTN EdbDisasmJMP8 ( IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_SYSTEM_CONTEXT SystemContext, OUT CHAR16 **DisasmString ) -/*++ - -Routine Description: - - Disasm instruction - JMP8 - -Arguments: - - InstructionAddress - The instruction address - SystemContext - EBC system context. - DisasmString - The instruction string - -Returns: - - Instruction length - ---*/ { UINT8 Modifiers; @@ -300,29 +276,23 @@ Returns: return 2; } +/** + + Disasm instruction - CALL. + + @param InstructionAddress - The instruction address + @param SystemContext - EBC system context. + @param DisasmString - The instruction string + + @return Instruction length + +**/ UINTN EdbDisasmCALL ( IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_SYSTEM_CONTEXT SystemContext, OUT CHAR16 **DisasmString ) -/*++ - -Routine Description: - - Disasm instruction - CALL - -Arguments: - - InstructionAddress - The instruction address - SystemContext - EBC system context. - DisasmString - The instruction string - -Returns: - - Instruction length - ---*/ { UINT8 Modifiers; UINT8 Operands; @@ -410,29 +380,23 @@ Returns: return Size; } +/** + + Disasm instruction - RET. + + @param InstructionAddress - The instruction address + @param SystemContext - EBC system context. + @param DisasmString - The instruction string + + @return Instruction length + +**/ UINTN EdbDisasmRET ( IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_SYSTEM_CONTEXT SystemContext, OUT CHAR16 **DisasmString ) -/*++ - -Routine Description: - - Disasm instruction - RET - -Arguments: - - InstructionAddress - The instruction address - SystemContext - EBC system context. - DisasmString - The instruction string - -Returns: - - Instruction length - ---*/ { ASSERT (GET_OPCODE(InstructionAddress) == OPCODE_RET); @@ -454,29 +418,23 @@ Returns: return 2; } +/** + + Disasm instruction - CMP. + + @param InstructionAddress - The instruction address + @param SystemContext - EBC system context. + @param DisasmString - The instruction string + + @return Instruction length + +**/ UINTN EdbDisasmCMP ( IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_SYSTEM_CONTEXT SystemContext, OUT CHAR16 **DisasmString ) -/*++ - -Routine Description: - - Disasm instruction - CMP - -Arguments: - - InstructionAddress - The instruction address - SystemContext - EBC system context. - DisasmString - The instruction string - -Returns: - - Instruction length - ---*/ { UINT8 Opcode; UINT8 Modifiers; @@ -552,29 +510,23 @@ Returns: return Size; } +/** + + Disasm instruction - Unsigned Data Manipulate. + + @param InstructionAddress - The instruction address + @param SystemContext - EBC system context. + @param DisasmString - The instruction string + + @return Instruction length + +**/ UINTN EdbDisasmUnsignedDataManip ( IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_SYSTEM_CONTEXT SystemContext, OUT CHAR16 **DisasmString ) -/*++ - -Routine Description: - - Disasm instruction - Unsigned Data Manipulate - -Arguments: - - InstructionAddress - The instruction address - SystemContext - EBC system context. - DisasmString - The instruction string - -Returns: - - Instruction length - ---*/ { UINT8 Modifiers; UINT8 Opcode; @@ -676,29 +628,23 @@ Returns: return Size; } +/** + + Disasm instruction - Signed Data Manipulate, + + @param InstructionAddress - The instruction address + @param SystemContext - EBC system context. + @param DisasmString - The instruction string + + @return Instruction length + +**/ UINTN EdbDisasmSignedDataManip ( IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_SYSTEM_CONTEXT SystemContext, OUT CHAR16 **DisasmString ) -/*++ - -Routine Description: - - Disasm instruction - Signed Data Manipulate - -Arguments: - - InstructionAddress - The instruction address - SystemContext - EBC system context. - DisasmString - The instruction string - -Returns: - - Instruction length - ---*/ { UINT8 Modifiers; UINT8 Opcode; @@ -780,29 +726,23 @@ Returns: return Size; } +/** + + Disasm instruction - MOVxx. + + @param InstructionAddress - The instruction address + @param SystemContext - EBC system context. + @param DisasmString - The instruction string + + @return Instruction length + +**/ UINTN EdbDisasmMOVxx ( IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_SYSTEM_CONTEXT SystemContext, OUT CHAR16 **DisasmString ) -/*++ - -Routine Description: - - Disasm instruction - MOVxx - -Arguments: - - InstructionAddress - The instruction address - SystemContext - EBC system context. - DisasmString - The instruction string - -Returns: - - Instruction length - ---*/ { UINT8 Modifiers; UINT8 Opcode; @@ -939,29 +879,23 @@ Returns: return Size; } +/** + + Disasm instruction - MOVsnw. + + @param InstructionAddress - The instruction address + @param SystemContext - EBC system context. + @param DisasmString - The instruction string + + @return Instruction length + +**/ UINTN EdbDisasmMOVsnw ( IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_SYSTEM_CONTEXT SystemContext, OUT CHAR16 **DisasmString ) -/*++ - -Routine Description: - - Disasm instruction - MOVsnw - -Arguments: - - InstructionAddress - The instruction address - SystemContext - EBC system context. - DisasmString - The instruction string - -Returns: - - Instruction length - ---*/ { UINT8 Modifiers; UINT8 Operands; @@ -1015,29 +949,23 @@ Returns: return Size; } +/** + + Disasm instruction - MOVsnd. + + @param InstructionAddress - The instruction address + @param SystemContext - EBC system context. + @param DisasmString - The instruction string + + @return Instruction length + +**/ UINTN EdbDisasmMOVsnd ( IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_SYSTEM_CONTEXT SystemContext, OUT CHAR16 **DisasmString ) -/*++ - -Routine Description: - - Disasm instruction - MOVsnd - -Arguments: - - InstructionAddress - The instruction address - SystemContext - EBC system context. - DisasmString - The instruction string - -Returns: - - Instruction length - ---*/ { UINT8 Modifiers; UINT8 Operands; @@ -1091,29 +1019,23 @@ Returns: return Size; } +/** + + Disasm instruction - LOADSP. + + @param InstructionAddress - The instruction address + @param SystemContext - EBC system context. + @param DisasmString - The instruction string + + @return Instruction length + +**/ UINTN EdbDisasmLOADSP ( IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_SYSTEM_CONTEXT SystemContext, OUT CHAR16 **DisasmString ) -/*++ - -Routine Description: - - Disasm instruction - LOADSP - -Arguments: - - InstructionAddress - The instruction address - SystemContext - EBC system context. - DisasmString - The instruction string - -Returns: - - Instruction length - ---*/ { UINT8 Operands; @@ -1139,29 +1061,23 @@ Returns: return 2; } +/** + + Disasm instruction - STORESP. + + @param InstructionAddress - The instruction address + @param SystemContext - EBC system context. + @param DisasmString - The instruction string + + @return Instruction length + +**/ UINTN EdbDisasmSTORESP ( IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_SYSTEM_CONTEXT SystemContext, OUT CHAR16 **DisasmString ) -/*++ - -Routine Description: - - Disasm instruction - STORESP - -Arguments: - - InstructionAddress - The instruction address - SystemContext - EBC system context. - DisasmString - The instruction string - -Returns: - - Instruction length - ---*/ { UINT8 Operands; @@ -1187,29 +1103,24 @@ Returns: return 2; } + +/** + + Disasm instruction - PUSH. + + @param InstructionAddress - The instruction address + @param SystemContext - EBC system context. + @param DisasmString - The instruction string + + @return Instruction length + +**/ UINTN EdbDisasmPUSH ( IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_SYSTEM_CONTEXT SystemContext, OUT CHAR16 **DisasmString ) -/*++ - -Routine Description: - - Disasm instruction - PUSH - -Arguments: - - InstructionAddress - The instruction address - SystemContext - EBC system context. - DisasmString - The instruction string - -Returns: - - Instruction length - ---*/ { UINT8 Modifiers; UINT8 Operands; @@ -1257,29 +1168,23 @@ Returns: return Size; } +/** + + Disasm instruction - POP. + + @param InstructionAddress - The instruction address + @param SystemContext - EBC system context. + @param DisasmString - The instruction string + + @return Instruction length + +**/ UINTN EdbDisasmPOP ( IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_SYSTEM_CONTEXT SystemContext, OUT CHAR16 **DisasmString ) -/*++ - -Routine Description: - - Disasm instruction - POP - -Arguments: - - InstructionAddress - The instruction address - SystemContext - EBC system context. - DisasmString - The instruction string - -Returns: - - Instruction length - ---*/ { UINT8 Modifiers; UINT8 Operands; @@ -1327,29 +1232,23 @@ Returns: return Size; } +/** + + Disasm instruction - CMPI. + + @param InstructionAddress - The instruction address + @param SystemContext - EBC system context. + @param DisasmString - The instruction string + + @return Instruction length + +**/ UINTN EdbDisasmCMPI ( IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_SYSTEM_CONTEXT SystemContext, OUT CHAR16 **DisasmString ) -/*++ - -Routine Description: - - Disasm instruction - CMPI - -Arguments: - - InstructionAddress - The instruction address - SystemContext - EBC system context. - DisasmString - The instruction string - -Returns: - - Instruction length - ---*/ { UINT8 Modifiers; UINT8 Opcode; @@ -1444,29 +1343,23 @@ Returns: return Size; } +/** + + Disasm instruction - PUSHn. + + @param InstructionAddress - The instruction address + @param SystemContext - EBC system context. + @param DisasmString - The instruction string + + @return Instruction length + +**/ UINTN EdbDisasmPUSHn ( IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_SYSTEM_CONTEXT SystemContext, OUT CHAR16 **DisasmString ) -/*++ - -Routine Description: - - Disasm instruction - PUSHn - -Arguments: - - InstructionAddress - The instruction address - SystemContext - EBC system context. - DisasmString - The instruction string - -Returns: - - Instruction length - ---*/ { UINT8 Modifiers; UINT8 Operands; @@ -1509,29 +1402,23 @@ Returns: return Size; } +/** + + Disasm instruction - POPn. + + @param InstructionAddress - The instruction address + @param SystemContext - EBC system context. + @param DisasmString - The instruction string + + @return Instruction length + +**/ UINTN EdbDisasmPOPn ( IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_SYSTEM_CONTEXT SystemContext, OUT CHAR16 **DisasmString ) -/*++ - -Routine Description: - - Disasm instruction - POPn - -Arguments: - - InstructionAddress - The instruction address - SystemContext - EBC system context. - DisasmString - The instruction string - -Returns: - - Instruction length - ---*/ { UINT8 Modifiers; UINT8 Operands; @@ -1574,29 +1461,23 @@ Returns: return Size; } +/** + + Disasm instruction - MOVI. + + @param InstructionAddress - The instruction address + @param SystemContext - EBC system context. + @param DisasmString - The instruction string + + @return Instruction length + +**/ UINTN EdbDisasmMOVI ( IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_SYSTEM_CONTEXT SystemContext, OUT CHAR16 **DisasmString ) -/*++ - -Routine Description: - - Disasm instruction - MOVI - -Arguments: - - InstructionAddress - The instruction address - SystemContext - EBC system context. - DisasmString - The instruction string - -Returns: - - Instruction length - ---*/ { UINT8 Modifiers; UINT8 Operands; @@ -1688,29 +1569,23 @@ Returns: return Size; } +/** + + Disasm instruction - MOVIn. + + @param InstructionAddress - The instruction address + @param SystemContext - EBC system context. + @param DisasmString - The instruction string + + @return Instruction length + +**/ UINTN EdbDisasmMOVIn ( IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_SYSTEM_CONTEXT SystemContext, OUT CHAR16 **DisasmString ) -/*++ - -Routine Description: - - Disasm instruction - MOVIn - -Arguments: - - InstructionAddress - The instruction address - SystemContext - EBC system context. - DisasmString - The instruction string - -Returns: - - Instruction length - ---*/ { UINT8 Modifiers; UINT8 Operands; @@ -1788,29 +1663,23 @@ Returns: return Size; } +/** + + Disasm instruction - MOVREL. + + @param InstructionAddress - The instruction address + @param SystemContext - EBC system context. + @param DisasmString - The instruction string + + @return Instruction length + +**/ UINTN EdbDisasmMOVREL ( IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_SYSTEM_CONTEXT SystemContext, OUT CHAR16 **DisasmString ) -/*++ - -Routine Description: - - Disasm instruction - MOVREL - -Arguments: - - InstructionAddress - The instruction address - SystemContext - EBC system context. - DisasmString - The instruction string - -Returns: - - Instruction length - ---*/ { UINT8 Modifiers; UINT8 Operands; diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasm.h b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasm.h index 1897e1ce15..911b0f9b6d 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasm.h +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasm.h @@ -1,7 +1,7 @@ -/*++ +/** @file -Copyright (c) 2007, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007, Intel Corporation All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -9,14 +9,8 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: - EdbDisasm.h - -Abstract: - - ---*/ +**/ #ifndef _EFI_EDB_DISASM_H_ #define _EFI_EDB_DISASM_H_ diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasmSupport.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasmSupport.c index 81e970ea92..0108870e22 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasmSupport.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasmSupport.c @@ -1,7 +1,7 @@ -/*++ +/** @file -Copyright (c) 2007, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007, Intel Corporation All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -9,14 +9,8 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: - EdbDisasmSupport.c - -Abstract: - - ---*/ +**/ #include "Edb.h" @@ -32,27 +26,19 @@ EDB_INSTRUCTION_STRING mInstructionString; UINTN mInstructionNameOffset; UINTN mInstructionContentOffset; +/** + + Set offset for Instruction name and content. + + @param InstructionNameOffset - Instruction name offset + @param InstructionContentOffset - Instruction content offset + +**/ VOID EdbSetOffset ( IN UINTN InstructionNameOffset, IN UINTN InstructionContentOffset ) -/*++ - -Routine Description: - - Set offset for Instruction name and content - -Arguments: - - InstructionNameOffset - Instruction name offset - InstructionContentOffset - Instruction content offset - -Returns: - - None - ---*/ { mInstructionNameOffset = InstructionNameOffset; mInstructionContentOffset = InstructionContentOffset; @@ -60,25 +46,17 @@ Returns: return ; } +/** + + Pre instruction string construction. + + @return Instruction string + +**/ CHAR16 * EdbPreInstructionString ( VOID ) -/*++ - -Routine Description: - - Pre instruction string construction - -Arguments: - - None - -Returns: - - Instruction string - ---*/ { ZeroMem (&mInstructionString, sizeof(mInstructionString)); mInstructionNameOffset = 0; @@ -87,25 +65,17 @@ Returns: return (CHAR16 *)&mInstructionString; } +/** + + Post instruction string construction. + + @return Instruction string + +**/ CHAR16 * EdbPostInstructionString ( VOID ) -/*++ - -Routine Description: - - Post instruction string construction - -Arguments: - - None - -Returns: - - Instruction string - ---*/ { CHAR16 *Char; @@ -122,29 +92,23 @@ Returns: return (CHAR16 *)&mInstructionString; } +/** + + Get Sign, NaturalUnits, and ConstantUnits of the WORD data. + + @param Data16 - WORD data + @param NaturalUnits - Natural Units of the WORD + @param ConstantUnits - Constant Units of the WORD + + @return Sign value of WORD + +**/ BOOLEAN EdbGetNaturalIndex16 ( IN UINT16 Data16, OUT UINTN *NaturalUnits, OUT UINTN *ConstantUnits ) -/*++ - -Routine Description: - - Get Sign, NaturalUnits, and ConstantUnits of the WORD data - -Arguments: - - Data16 - WORD data - NaturalUnits - Natural Units of the WORD - ConstantUnits - Constant Units of the WORD - -Returns: - - Sign value of WORD - ---*/ { BOOLEAN Sign; UINTN NaturalUnitBit; @@ -159,29 +123,23 @@ Returns: return Sign; } +/** + + Get Sign, NaturalUnits, and ConstantUnits of the DWORD data. + + @param Data32 - DWORD data + @param NaturalUnits - Natural Units of the DWORD + @param ConstantUnits - Constant Units of the DWORD + + @return Sign value of DWORD + +**/ BOOLEAN EdbGetNaturalIndex32 ( IN UINT32 Data32, OUT UINTN *NaturalUnits, OUT UINTN *ConstantUnits ) -/*++ - -Routine Description: - - Get Sign, NaturalUnits, and ConstantUnits of the DWORD data - -Arguments: - - Data32 - DWORD data - NaturalUnits - Natural Units of the DWORD - ConstantUnits - Constant Units of the DWORD - -Returns: - - Sign value of DWORD - ---*/ { BOOLEAN Sign; UINTN NaturalUnitBit; @@ -196,29 +154,23 @@ Returns: return Sign; } +/** + + Get Sign, NaturalUnits, and ConstantUnits of the QWORD data. + + @param Data64 - QWORD data + @param NaturalUnits - Natural Units of the QWORD + @param ConstantUnits - Constant Units of the QWORD + + @return Sign value of QWORD + +**/ BOOLEAN EdbGetNaturalIndex64 ( IN UINT64 Data64, OUT UINT64 *NaturalUnits, OUT UINT64 *ConstantUnits ) -/*++ - -Routine Description: - - Get Sign, NaturalUnits, and ConstantUnits of the QWORD data - -Arguments: - - Data64 - QWORD data - NaturalUnits - Natural Units of the QWORD - ConstantUnits - Constant Units of the QWORD - -Returns: - - Sign value of QWORD - ---*/ { BOOLEAN Sign; UINTN NaturalUnitBit; @@ -233,25 +185,19 @@ Returns: return Sign; } -UINT8 -EdbGetBitWidth ( - IN UINT64 Value - ) -/*++ - -Routine Description: - - Get Bit Width of the value +/** -Arguments: + Get Bit Width of the value. - Value - data + @param Value - data -Returns: + @return Bit width - Bit width - ---*/ +**/ +UINT8 +EdbGetBitWidth ( + IN UINT64 Value + ) { if (Value >= 10000000000000) { return 14; @@ -284,25 +230,19 @@ Returns: } } -UINTN -EdbPrintInstructionName ( - IN CHAR16 *Name - ) -/*++ - -Routine Description: +/** - Print the instruction name + Print the instruction name. -Arguments: + @param Name - instruction name - Name - instruction name + @return Instruction name offset -Returns: - - Instruction name offset - ---*/ +**/ +UINTN +EdbPrintInstructionName ( + IN CHAR16 *Name + ) { EDBSPrintWithOffset ( mInstructionString.Name, @@ -316,25 +256,19 @@ Returns: return mInstructionNameOffset; } -UINTN -EdbPrintRegister1 ( - IN UINT8 Operands - ) -/*++ - -Routine Description: - - Print register 1 in operands - -Arguments: +/** - Operands - instruction operands + Print register 1 in operands. -Returns: + @param Operands - instruction operands - Instruction content offset + @return Instruction content offset ---*/ +**/ +UINTN +EdbPrintRegister1 ( + IN UINT8 Operands + ) { if (Operands & OPERAND_M_INDIRECT1) { EDBSPrintWithOffset ( @@ -357,25 +291,19 @@ Returns: return mInstructionContentOffset; } -UINTN -EdbPrintRegister2 ( - IN UINT8 Operands - ) -/*++ - -Routine Description: +/** - Print register 2 in operands + Print register 2 in operands. -Arguments: + @param Operands - instruction operands - Operands - instruction operands + @return Instruction content offset -Returns: - - Instruction content offset - ---*/ +**/ +UINTN +EdbPrintRegister2 ( + IN UINT8 Operands + ) { if (Operands & OPERAND_M_INDIRECT2) { EDBSPrintWithOffset ( @@ -398,25 +326,19 @@ Returns: return mInstructionContentOffset; } -UINTN -EdbPrintDedicatedRegister1 ( - IN UINT8 Operands - ) -/*++ - -Routine Description: - - Print dedicated register 1 in operands - -Arguments: +/** - Operands - instruction operands + Print dedicated register 1 in operands. -Returns: + @param Operands - instruction operands - Instruction content offset + @return Instruction content offset ---*/ +**/ +UINTN +EdbPrintDedicatedRegister1 ( + IN UINT8 Operands + ) { switch (Operands & OPERAND_M_OP1) { case 0: @@ -442,25 +364,19 @@ Returns: return mInstructionContentOffset; } -UINTN -EdbPrintDedicatedRegister2 ( - IN UINT8 Operands - ) -/*++ - -Routine Description: - - Print dedicated register 2 in operands +/** -Arguments: + Print dedicated register 2 in operands. - Operands - instruction operands + @param Operands - instruction operands -Returns: + @return Instruction content offset - Instruction content offset - ---*/ +**/ +UINTN +EdbPrintDedicatedRegister2 ( + IN UINT8 Operands + ) { switch ((Operands & OPERAND_M_OP2) >> 4) { case 0: @@ -486,29 +402,23 @@ Returns: return mInstructionContentOffset; } +/** + + Print the hexical UINTN index data to instruction content. + + @param Sign - Signed bit of UINTN data + @param NaturalUnits - natural units of UINTN data + @param ConstantUnits - natural units of UINTN data + + @return Instruction content offset + +**/ UINTN EdbPrintIndexData ( IN BOOLEAN Sign, IN UINTN NaturalUnits, IN UINTN ConstantUnits ) -/*++ - -Routine Description: - - Print the hexical UINTN index data to instruction content - -Arguments: - - Sign - Signed bit of UINTN data - NaturalUnits - natural units of UINTN data - ConstantUnits - natural units of UINTN data - -Returns: - - Instruction content offset - ---*/ { EDBSPrintWithOffset ( mInstructionString.Content, @@ -525,29 +435,23 @@ Returns: return mInstructionContentOffset; } +/** + + Print the hexical QWORD index data to instruction content. + + @param Sign - Signed bit of QWORD data + @param NaturalUnits - natural units of QWORD data + @param ConstantUnits - natural units of QWORD data + + @return Instruction content offset + +**/ UINTN EdbPrintIndexData64 ( IN BOOLEAN Sign, IN UINT64 NaturalUnits, IN UINT64 ConstantUnits ) -/*++ - -Routine Description: - - Print the hexical QWORD index data to instruction content - -Arguments: - - Sign - Signed bit of QWORD data - NaturalUnits - natural units of QWORD data - ConstantUnits - natural units of QWORD data - -Returns: - - Instruction content offset - ---*/ { EDBSPrintWithOffset ( mInstructionString.Content, @@ -564,25 +468,19 @@ Returns: return mInstructionContentOffset; } -UINTN -EdbPrintRawIndexData16 ( - IN UINT16 Data16 - ) -/*++ - -Routine Description: - - Print the hexical WORD raw index data to instruction content +/** -Arguments: + Print the hexical WORD raw index data to instruction content. - Data16 - WORD data + @param Data16 - WORD data -Returns: + @return Instruction content offset - Instruction content offset - ---*/ +**/ +UINTN +EdbPrintRawIndexData16 ( + IN UINT16 Data16 + ) { BOOLEAN Sign; UINTN NaturalUnits; @@ -595,25 +493,19 @@ Returns: return Offset; } -UINTN -EdbPrintRawIndexData32 ( - IN UINT32 Data32 - ) -/*++ - -Routine Description: - - Print the hexical DWORD raw index data to instruction content +/** -Arguments: + Print the hexical DWORD raw index data to instruction content. - Data32 - DWORD data + @param Data32 - DWORD data -Returns: + @return Instruction content offset - Instruction content offset - ---*/ +**/ +UINTN +EdbPrintRawIndexData32 ( + IN UINT32 Data32 + ) { BOOLEAN Sign; UINTN NaturalUnits; @@ -626,25 +518,19 @@ Returns: return Offset; } -UINTN -EdbPrintRawIndexData64 ( - IN UINT64 Data64 - ) -/*++ - -Routine Description: - - Print the hexical QWORD raw index data to instruction content +/** -Arguments: + Print the hexical QWORD raw index data to instruction content. - Data64 - QWORD data + @param Data64 - QWORD data -Returns: + @return Instruction content offset - Instruction content offset - ---*/ +**/ +UINTN +EdbPrintRawIndexData64 ( + IN UINT64 Data64 + ) { BOOLEAN Sign; UINT64 NaturalUnits; @@ -657,25 +543,19 @@ Returns: return Offset; } -UINTN -EdbPrintImmData8 ( - IN UINT8 Data - ) -/*++ - -Routine Description: +/** - Print the hexical BYTE immediate data to instruction content + Print the hexical BYTE immediate data to instruction content. -Arguments: + @param Data - BYTE data - Data - BYTE data + @return Instruction content offset -Returns: - - Instruction content offset - ---*/ +**/ +UINTN +EdbPrintImmData8 ( + IN UINT8 Data + ) { EDBSPrintWithOffset ( mInstructionString.Content, @@ -689,25 +569,19 @@ Returns: return mInstructionContentOffset; } -UINTN -EdbPrintImmData16 ( - IN UINT16 Data - ) -/*++ +/** -Routine Description: + Print the hexical WORD immediate data to instruction content. - Print the hexical WORD immediate data to instruction content + @param Data - WORD data -Arguments: + @return Instruction content offset - Data - WORD data - -Returns: - - Instruction content offset - ---*/ +**/ +UINTN +EdbPrintImmData16 ( + IN UINT16 Data + ) { EDBSPrintWithOffset ( mInstructionString.Content, @@ -721,25 +595,19 @@ Returns: return mInstructionContentOffset; } -UINTN -EdbPrintImmData32 ( - IN UINT32 Data - ) -/*++ - -Routine Description: - - Print the hexical DWORD immediate data to instruction content +/** -Arguments: + Print the hexical DWORD immediate data to instruction content. - Data - DWORD data + @param Data - DWORD data -Returns: + @return Instruction content offset - Instruction content offset - ---*/ +**/ +UINTN +EdbPrintImmData32 ( + IN UINT32 Data + ) { EDBSPrintWithOffset ( mInstructionString.Content, @@ -753,25 +621,19 @@ Returns: return mInstructionContentOffset; } -UINTN -EdbPrintImmData64 ( - IN UINT64 Data - ) -/*++ - -Routine Description: +/** - Print the hexical QWORD immediate data to instruction content + Print the hexical QWORD immediate data to instruction content. -Arguments: + @param Data - QWORD data - Data - QWORD data + @return Instruction content offset -Returns: - - Instruction content offset - ---*/ +**/ +UINTN +EdbPrintImmData64 ( + IN UINT64 Data + ) { EDBSPrintWithOffset ( mInstructionString.Content, @@ -785,25 +647,19 @@ Returns: return mInstructionContentOffset; } -UINTN -EdbPrintImmDatan ( - IN UINTN Data - ) -/*++ - -Routine Description: - - Print the decimal UINTN immediate data to instruction content - -Arguments: +/** - Data - UINTN data + Print the decimal UINTN immediate data to instruction content. -Returns: + @param Data - UINTN data - Instruction content offset + @return Instruction content offset ---*/ +**/ +UINTN +EdbPrintImmDatan ( + IN UINTN Data + ) { EDBSPrintWithOffset ( mInstructionString.Content, @@ -817,25 +673,19 @@ Returns: return mInstructionContentOffset; } -UINTN -EdbPrintImmData64n ( - IN UINT64 Data64 - ) -/*++ - -Routine Description: +/** - Print the decimal QWORD immediate data to instruction content + Print the decimal QWORD immediate data to instruction content. -Arguments: + @param Data64 - QWORD data - Data64 - QWORD data + @return Instruction content offset -Returns: - - Instruction content offset - ---*/ +**/ +UINTN +EdbPrintImmData64n ( + IN UINT64 Data64 + ) { EDBSPrintWithOffset ( mInstructionString.Content, @@ -849,25 +699,19 @@ Returns: return mInstructionContentOffset; } -UINTN -EdbPrintData8 ( - IN UINT8 Data8 - ) -/*++ - -Routine Description: - - Print the hexical BYTE to instruction content - -Arguments: +/** - Data8 - BYTE data + Print the hexical BYTE to instruction content. -Returns: + @param Data8 - BYTE data - Instruction content offset + @return Instruction content offset ---*/ +**/ +UINTN +EdbPrintData8 ( + IN UINT8 Data8 + ) { EDBSPrintWithOffset ( mInstructionString.Content, @@ -881,25 +725,19 @@ Returns: return mInstructionContentOffset; } -UINTN -EdbPrintData16 ( - IN UINT16 Data16 - ) -/*++ - -Routine Description: - - Print the hexical WORD to instruction content +/** -Arguments: + Print the hexical WORD to instruction content. - Data16 - WORD data + @param Data16 - WORD data -Returns: + @return Instruction content offset - Instruction content offset - ---*/ +**/ +UINTN +EdbPrintData16 ( + IN UINT16 Data16 + ) { EDBSPrintWithOffset ( mInstructionString.Content, @@ -913,25 +751,19 @@ Returns: return mInstructionContentOffset; } -UINTN -EdbPrintData32 ( - IN UINT32 Data32 - ) -/*++ - -Routine Description: +/** - Print the hexical DWORD to instruction content + Print the hexical DWORD to instruction content. -Arguments: + @param Data32 - DWORD data - Data32 - DWORD data + @return Instruction content offset -Returns: - - Instruction content offset - ---*/ +**/ +UINTN +EdbPrintData32 ( + IN UINT32 Data32 + ) { EDBSPrintWithOffset ( mInstructionString.Content, @@ -945,25 +777,19 @@ Returns: return mInstructionContentOffset; } -UINTN -EdbPrintData64 ( - IN UINT64 Data64 - ) -/*++ - -Routine Description: - - Print the hexical QWORD to instruction content - -Arguments: +/** - Data64 - QWORD data + Print the hexical QWORD to instruction content. -Returns: + @param Data64 - QWORD data - Instruction content offset + @return Instruction content offset ---*/ +**/ +UINTN +EdbPrintData64 ( + IN UINT64 Data64 + ) { EDBSPrintWithOffset ( mInstructionString.Content, @@ -977,25 +803,19 @@ Returns: return mInstructionContentOffset; } -UINTN -EdbPrintDatan ( - IN UINTN Data - ) -/*++ - -Routine Description: - - Print the decimal unsigned UINTN to instruction content +/** -Arguments: + Print the decimal unsigned UINTN to instruction content. - Data - unsigned UINTN data + @param Data - unsigned UINTN data -Returns: + @return Instruction content offset - Instruction content offset - ---*/ +**/ +UINTN +EdbPrintDatan ( + IN UINTN Data + ) { EDBSPrintWithOffset ( mInstructionString.Content, @@ -1009,25 +829,19 @@ Returns: return mInstructionContentOffset; } -UINTN -EdbPrintData64n ( - IN UINT64 Data64 - ) -/*++ - -Routine Description: - - Print the decimal unsigned QWORD to instruction content +/** -Arguments: + Print the decimal unsigned QWORD to instruction content. - Data64 - unsigned QWORD data + @param Data64 - unsigned QWORD data -Returns: + @return Instruction content offset - Instruction content offset - ---*/ +**/ +UINTN +EdbPrintData64n ( + IN UINT64 Data64 + ) { EDBSPrintWithOffset ( mInstructionString.Content, @@ -1041,25 +855,19 @@ Returns: return mInstructionContentOffset; } -UINTN -EdbPrintData8s ( - IN UINT8 Data8 - ) -/*++ - -Routine Description: - - Print the decimal signed BYTE to instruction content +/** -Arguments: + Print the decimal signed BYTE to instruction content. - Data8 - signed BYTE data + @param Data8 - signed BYTE data -Returns: + @return Instruction content offset - Instruction content offset - ---*/ +**/ +UINTN +EdbPrintData8s ( + IN UINT8 Data8 + ) { BOOLEAN Sign; @@ -1078,25 +886,19 @@ Returns: return mInstructionContentOffset; } -UINTN -EdbPrintData16s ( - IN UINT16 Data16 - ) -/*++ - -Routine Description: +/** - Print the decimal signed WORD to instruction content + Print the decimal signed WORD to instruction content. -Arguments: + @param Data16 - signed WORD data - Data16 - signed WORD data + @return Instruction content offset -Returns: - - Instruction content offset - ---*/ +**/ +UINTN +EdbPrintData16s ( + IN UINT16 Data16 + ) { BOOLEAN Sign; @@ -1115,25 +917,19 @@ Returns: return mInstructionContentOffset; } -UINTN -EdbPrintData32s ( - IN UINT32 Data32 - ) -/*++ +/** -Routine Description: + Print the decimal signed DWORD to instruction content. - Print the decimal signed DWORD to instruction content + @param Data32 - signed DWORD data -Arguments: + @return Instruction content offset - Data32 - signed DWORD data - -Returns: - - Instruction content offset - ---*/ +**/ +UINTN +EdbPrintData32s ( + IN UINT32 Data32 + ) { BOOLEAN Sign; @@ -1152,25 +948,19 @@ Returns: return mInstructionContentOffset; } -UINTN -EdbPrintData64s ( - IN UINT64 Data64 - ) -/*++ - -Routine Description: - - Print the decimal signed QWORD to instruction content +/** -Arguments: + Print the decimal signed QWORD to instruction content. - Data64 - signed QWORD data + @param Data64 - signed QWORD data -Returns: + @return Instruction content offset - Instruction content offset - ---*/ +**/ +UINTN +EdbPrintData64s ( + IN UINT64 Data64 + ) { BOOLEAN Sign; INT64 Data64s; @@ -1191,25 +981,17 @@ Returns: return mInstructionContentOffset; } +/** + + Print the comma to instruction content. + + @return Instruction content offset + +**/ UINTN EdbPrintComma ( VOID ) -/*++ - -Routine Description: - - Print the comma to instruction content - -Arguments: - - None - -Returns: - - Instruction content offset - ---*/ { EDBSPrintWithOffset ( mInstructionString.Content, @@ -1222,26 +1004,20 @@ Returns: return mInstructionContentOffset; } -UINTN -EdbFindAndPrintSymbol ( - IN UINTN Address - ) -/*++ - -Routine Description: - - Find the symbol string according to address, then print it +/** -Arguments: + Find the symbol string according to address, then print it. - Address - instruction address + @param Address - instruction address -Returns: + @retval 1 - symbol string is found and printed + @retval 0 - symbol string not found - 1 - symbol string is found and printed - 0 - symbol string not found - ---*/ +**/ +UINTN +EdbFindAndPrintSymbol ( + IN UINTN Address + ) { CHAR8 *SymbolStr; @@ -1260,27 +1036,19 @@ Returns: return 0; } +/** + + Print the EBC byte code. + + @param InstructionAddress - instruction address + @param InstructionNumber - instruction number + +**/ VOID EdbPrintRaw ( IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN UINTN InstructionNumber ) -/*++ - -Routine Description: - - Print the EBC byte code - -Arguments: - - InstructionAddress - instruction address - InstructionNumber - instruction number - -Returns: - - None - ---*/ { UINTN LineNumber; UINTN ByteNumber; @@ -1328,27 +1096,21 @@ Returns: return ; } +/** + + Print the EBC asm code. + + @param DebuggerPrivate - EBC Debugger private data structure + @param SystemContext - EBC system context. + + @retval EFI_SUCCESS - show disasm successfully + +**/ EFI_STATUS EdbShowDisasm ( IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_SYSTEM_CONTEXT SystemContext ) -/*++ - -Routine Description: - - Print the EBC asm code - -Arguments: - - DebuggerPrivate - EBC Debugger private data structure - SystemContext - EBC system context. - -Returns: - - EFI_SUCCESS - show disasm successfully - ---*/ { EFI_PHYSICAL_ADDRESS InstructionAddress; UINTN InstructionNumber; @@ -1414,27 +1176,21 @@ Returns: return EFI_SUCCESS; } +/** + + Get register value accroding to the system context, and register index. + + @param SystemContext - EBC system context. + @param Index - EBC register index + + @return register value + +**/ UINT64 GetRegisterValue ( IN EFI_SYSTEM_CONTEXT SystemContext, IN UINT8 Index ) -/*++ - -Routine Description: - - Get register value accroding to the system context, and register index - -Arguments: - - SystemContext - EBC system context. - Index - EBC register index - -Returns: - - register value - ---*/ { switch (Index) { case 0: diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasmSupport.h b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasmSupport.h index f66261bcbd..702673b8df 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasmSupport.h +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbDisasmSupport.h @@ -1,7 +1,7 @@ -/*++ +/** @file -Copyright (c) 2007, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007, Intel Corporation All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -9,14 +9,8 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: - EdbDisasmSupport.h - -Abstract: - - ---*/ +**/ #ifndef _EFI_EDB_DISASM_SUPPORT_H_ #define _EFI_EDB_DISASM_SUPPORT_H_ diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbHook.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbHook.c index 64c5ed892b..322dd258d0 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbHook.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbHook.c @@ -1,7 +1,7 @@ -/*++ +/** @file -Copyright (c) 2007, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -9,40 +9,24 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: - EdbHook.c +**/ -Abstract: +#include "Edb.h" +/** ---*/ + Check the Hook flag, and trigger exception if match. -#include "Edb.h" + @param VmPtr - EbcDebuggerCheckHookFlag + @param Flag - Feature flag -// -// Hook support function -// +**/ VOID EbcDebuggerCheckHookFlag ( IN VM_CONTEXT *VmPtr, IN UINT32 Flag ) -/*++ - -Routine Description: - - Check the Hook flag, and trigger exception if match. - -Arguments: - - VmPtr - EbcDebuggerCheckHookFlag - Flag - Feature flag - -Returns: - None - ---*/ { if ((mDebuggerPrivate.FeatureFlags & Flag) == Flag) { mDebuggerPrivate.StatusFlags = Flag; @@ -55,26 +39,19 @@ Returns: return ; } +/** + + It will record soruce address for Callstack entry. + + @param SourceEntry - Source address + @param Type - Branch type + +**/ VOID EbcDebuggerPushCallstackSource ( IN UINT64 SourceEntry, IN EFI_DEBUGGER_BRANCH_TYPE Type ) -/*++ - -Routine Description: - - It will record soruce address for Callstack entry. - -Arguments: - - SourceEntry - Source address - Type - Branch type - -Returns: - None - ---*/ { if (mDebuggerPrivate.CallStackEntryCount > EFI_DEBUGGER_CALLSTACK_MAX) { ASSERT (FALSE); @@ -93,26 +70,19 @@ Returns: return ; } +/** + + It will record parameter for Callstack entry. + + @param ParameterAddress - The address for the parameter + @param Type - Branch type + +**/ VOID EbcDebuggerPushCallstackParameter ( IN UINT64 ParameterAddress, IN EFI_DEBUGGER_BRANCH_TYPE Type ) -/*++ - -Routine Description: - - It will record parameter for Callstack entry. - -Arguments: - - ParameterAddress - The address for the parameter - Type - Branch type - -Returns: - None - ---*/ { if (mDebuggerPrivate.CallStackEntryCount > EFI_DEBUGGER_CALLSTACK_MAX) { ASSERT (FALSE); @@ -135,26 +105,19 @@ Returns: return ; } +/** + + It will record source address for callstack entry. + + @param DestEntry - Source address + @param Type - Branch type + +**/ VOID EbcDebuggerPushCallstackDest ( IN UINT64 DestEntry, IN EFI_DEBUGGER_BRANCH_TYPE Type ) -/*++ - -Routine Description: - - It will record source address for callstack entry. - -Arguments: - - DestEntry - Source address - Type - Branch type - -Returns: - None - ---*/ { UINTN Index; @@ -180,24 +143,15 @@ Returns: return ; } +/** + + It will throw the newest Callstack entry. + +**/ VOID EbcDebuggerPopCallstack ( VOID ) -/*++ - -Routine Description: - - It will throw the newest Callstack entry. - -Arguments: - - None - -Returns: - None - ---*/ { if ((mDebuggerPrivate.CallStackEntryCount > 0) && (mDebuggerPrivate.CallStackEntryCount <= EFI_DEBUGGER_CALLSTACK_MAX)) { @@ -219,26 +173,19 @@ Returns: return ; } +/** + + It will record source address for trace entry. + + @param SourceEntry - Source address + @param Type - Branch type + +**/ VOID EbcDebuggerPushTraceSourceEntry ( IN UINT64 SourceEntry, IN EFI_DEBUGGER_BRANCH_TYPE Type ) -/*++ - -Routine Description: - - It will record source address for trace entry. - -Arguments: - - SourceEntry - Source address - Type - Branch type - -Returns: - None - ---*/ { if (mDebuggerPrivate.TraceEntryCount > EFI_DEBUGGER_TRACE_MAX) { ASSERT (FALSE); @@ -257,26 +204,19 @@ Returns: return ; } +/** + + It will record destination address for trace entry. + + @param DestEntry - Destination address + @param Type - Branch type + +**/ VOID EbcDebuggerPushTraceDestEntry ( IN UINT64 DestEntry, IN EFI_DEBUGGER_BRANCH_TYPE Type ) -/*++ - -Routine Description: - - It will record destination address for trace entry. - -Arguments: - - DestEntry - Destination address - Type - Branch type - -Returns: - None - ---*/ { UINTN Index; @@ -302,28 +242,21 @@ Returns: return ; } +/** + + It will record address for StepEntry, if STEPOVER or STEPOUT is enabled. + + @param Entry - Break Address + @param FramePtr - Break Frame pointer + @param Flag - for STEPOVER or STEPOUT + +**/ VOID EbcDebuggerPushStepEntry ( IN UINT64 Entry, IN UINT64 FramePtr, IN UINT32 Flag ) -/*++ - -Routine Description: - - It will record address for StepEntry, if STEPOVER or STEPOUT is enabled. - -Arguments: - - Entry - Break Address - FramePtr - Break Frame pointer - Flag - for STEPOVER or STEPOUT - -Returns: - None - ---*/ { // // Check StepOver @@ -364,30 +297,20 @@ EbcDebuggerBreakEventFunc ( } } -// -// Hook function implementation -// -VOID -EbcDebuggerHookInit ( - IN EFI_HANDLE Handle, - IN EFI_DEBUG_SUPPORT_PROTOCOL *EbcDebugProtocol - ) -/*++ - -Routine Description: +/** The hook in InitializeEbcDriver. It will init the EbcDebuggerPrivate data structure. -Arguments: - - Handle - The EbcDebugProtocol handle. - EbcDebugProtocol - The EbcDebugProtocol interface. + @param Handle - The EbcDebugProtocol handle. + @param EbcDebugProtocol - The EbcDebugProtocol interface. -Returns: - None - ---*/ +**/ +VOID +EbcDebuggerHookInit ( + IN EFI_HANDLE Handle, + IN EFI_DEBUG_SUPPORT_PROTOCOL *EbcDebugProtocol + ) { EFI_STATUS Status; UINTN Index; @@ -479,25 +402,16 @@ Returns: return ; } -VOID -EbcDebuggerHookUnload ( - VOID - ) -/*++ - -Routine Description: +/** The hook in UnloadImage for EBC Interpreter. It clean up the environment. -Arguments: - - None - -Returns: - None - ---*/ +**/ +VOID +EbcDebuggerHookUnload ( + VOID + ) { UINTN Index; UINTN SubIndex; @@ -545,49 +459,37 @@ Returns: return ; } -VOID -EbcDebuggerHookEbcUnloadImage ( - IN EFI_HANDLE Handle - ) -/*++ - -Routine Description: +/** The hook in EbcUnloadImage. Currently do nothing here. -Arguments: + @param Handle - The EbcImage handle. - Handle - The EbcImage handle. +**/ -Returns: - None - ---*/ +VOID +EbcDebuggerHookEbcUnloadImage ( + IN EFI_HANDLE Handle + ) { return ; } -VOID -EbcDebuggerHookExecuteEbcImageEntryPoint ( - IN VM_CONTEXT *VmPtr - ) -/*++ - -Routine Description: +/** The hook in ExecuteEbcImageEntryPoint. It will record the call-stack entry. (-1 means EbcImageEntryPoint call) and trigger Exception if BOE enabled. -Arguments: - - VmPtr - pointer to VM context. -Returns: - None + @param VmPtr - pointer to VM context. ---*/ +**/ +VOID +EbcDebuggerHookExecuteEbcImageEntryPoint ( + IN VM_CONTEXT *VmPtr + ) { EbcDebuggerPushCallstackSource ((UINT64)(UINTN)-1, EfiDebuggerBranchTypeEbcCall); EbcDebuggerPushCallstackParameter ((UINT64)(UINTN)VmPtr->Gpr[0], EfiDebuggerBranchTypeEbcCall); @@ -596,26 +498,19 @@ Returns: return ; } -VOID -EbcDebuggerHookEbcInterpret ( - IN VM_CONTEXT *VmPtr - ) -/*++ - -Routine Description: +/** The hook in ExecuteEbcImageEntryPoint. It will record the call-stack entry. (-2 means EbcInterpret call) and trigger Exception if BOT enabled. -Arguments: - - VmPtr - pointer to VM context. + @param VmPtr - pointer to VM context. -Returns: - None - ---*/ +**/ +VOID +EbcDebuggerHookEbcInterpret ( + IN VM_CONTEXT *VmPtr + ) { EbcDebuggerPushCallstackSource ((UINT64)(UINTN)-2, EfiDebuggerBranchTypeEbcCall); EbcDebuggerPushCallstackParameter ((UINT64)(UINTN)VmPtr->Gpr[0], EfiDebuggerBranchTypeEbcCall); @@ -624,25 +519,18 @@ Returns: return ; } -VOID -EbcDebuggerHookExecuteStart ( - IN VM_CONTEXT *VmPtr - ) -/*++ - -Routine Description: +/** The hook in EbcExecute, before ExecuteFunction. It will trigger Exception if GoTil, StepOver, or StepOut hit. -Arguments: - - VmPtr - pointer to VM context. - -Returns: - None + @param VmPtr - pointer to VM context. ---*/ +**/ +VOID +EbcDebuggerHookExecuteStart ( + IN VM_CONTEXT *VmPtr + ) { EFI_TPL CurrentTpl; @@ -710,25 +598,18 @@ Returns: return ; } -VOID -EbcDebuggerHookExecuteEnd ( - IN VM_CONTEXT *VmPtr - ) -/*++ - -Routine Description: +/** The hook in EbcExecute, after ExecuteFunction. It will record StepOut Entry if need. -Arguments: - - VmPtr - pointer to VM context. - -Returns: - None + @param VmPtr - pointer to VM context. ---*/ +**/ +VOID +EbcDebuggerHookExecuteEnd ( + IN VM_CONTEXT *VmPtr + ) { UINTN Address; @@ -741,26 +622,19 @@ Returns: return ; } -VOID -EbcDebuggerHookCALLStart ( - IN VM_CONTEXT *VmPtr - ) -/*++ - -Routine Description: +/** The hook in ExecuteCALL, before move IP. It will trigger Exception if BOC enabled, and record Callstack, and trace information. -Arguments: - - VmPtr - pointer to VM context. + @param VmPtr - pointer to VM context. -Returns: - None - ---*/ +**/ +VOID +EbcDebuggerHookCALLStart ( + IN VM_CONTEXT *VmPtr + ) { EbcDebuggerCheckHookFlag (VmPtr, EFI_DEBUG_FLAG_EBC_BOC); EbcDebuggerPushCallstackSource ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcCall); @@ -769,26 +643,19 @@ Returns: return ; } -VOID -EbcDebuggerHookCALLEnd ( - IN VM_CONTEXT *VmPtr - ) -/*++ - -Routine Description: +/** The hook in ExecuteCALL, after move IP. It will record Callstack, trace information and record StepOver/StepOut Entry if need. -Arguments: - - VmPtr - pointer to VM context. + @param VmPtr - pointer to VM context. -Returns: - None - ---*/ +**/ +VOID +EbcDebuggerHookCALLEnd ( + IN VM_CONTEXT *VmPtr + ) { UINT64 Address; UINTN FramePtr; @@ -817,26 +684,19 @@ Returns: return ; } -VOID -EbcDebuggerHookCALLEXStart ( - IN VM_CONTEXT *VmPtr - ) -/*++ - -Routine Description: +/** The hook in ExecuteCALL, before call EbcLLCALLEX. It will trigger Exception if BOCX enabled, and record Callstack information. -Arguments: - - VmPtr - pointer to VM context. + @param VmPtr - pointer to VM context. -Returns: - None - ---*/ +**/ +VOID +EbcDebuggerHookCALLEXStart ( + IN VM_CONTEXT *VmPtr + ) { EbcDebuggerCheckHookFlag (VmPtr, EFI_DEBUG_FLAG_EBC_BOCX); // EbcDebuggerPushCallstackSource ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcCallEx); @@ -845,51 +705,37 @@ Returns: return ; } -VOID -EbcDebuggerHookCALLEXEnd ( - IN VM_CONTEXT *VmPtr - ) -/*++ - -Routine Description: +/** The hook in ExecuteCALL, after call EbcLLCALLEX. It will record trace information. -Arguments: + @param VmPtr - pointer to VM context. - VmPtr - pointer to VM context. - -Returns: - None - ---*/ +**/ +VOID +EbcDebuggerHookCALLEXEnd ( + IN VM_CONTEXT *VmPtr + ) { // EbcDebuggerPushCallstackDest ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcCallEx); EbcDebuggerPushTraceDestEntry ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcCallEx); return ; } -VOID -EbcDebuggerHookRETStart ( - IN VM_CONTEXT *VmPtr - ) -/*++ - -Routine Description: +/** The hook in ExecuteRET, before move IP. It will trigger Exception if BOR enabled, and record Callstack, and trace information. -Arguments: - - VmPtr - pointer to VM context. - -Returns: - None + @param VmPtr - pointer to VM context. ---*/ +**/ +VOID +EbcDebuggerHookRETStart ( + IN VM_CONTEXT *VmPtr + ) { EbcDebuggerCheckHookFlag (VmPtr, EFI_DEBUG_FLAG_EBC_BOR); EbcDebuggerPopCallstack (); @@ -897,121 +743,86 @@ Returns: return ; } -VOID -EbcDebuggerHookRETEnd ( - IN VM_CONTEXT *VmPtr - ) -/*++ - -Routine Description: +/** The hook in ExecuteRET, after move IP. It will record trace information. -Arguments: - - VmPtr - pointer to VM context. - -Returns: - None + @param VmPtr - pointer to VM context. ---*/ +**/ +VOID +EbcDebuggerHookRETEnd ( + IN VM_CONTEXT *VmPtr + ) { EbcDebuggerPushTraceDestEntry ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcRet); return ; } -VOID -EbcDebuggerHookJMPStart ( - IN VM_CONTEXT *VmPtr - ) -/*++ - -Routine Description: +/** The hook in ExecuteJMP, before move IP. It will record trace information. -Arguments: - - VmPtr - pointer to VM context. + @param VmPtr - pointer to VM context. -Returns: - None - ---*/ +**/ +VOID +EbcDebuggerHookJMPStart ( + IN VM_CONTEXT *VmPtr + ) { EbcDebuggerPushTraceSourceEntry ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcJmp); return ; } -VOID -EbcDebuggerHookJMPEnd ( - IN VM_CONTEXT *VmPtr - ) -/*++ - -Routine Description: +/** The hook in ExecuteJMP, after move IP. It will record trace information. -Arguments: - - VmPtr - pointer to VM context. + @param VmPtr - pointer to VM context. -Returns: - None - ---*/ +**/ +VOID +EbcDebuggerHookJMPEnd ( + IN VM_CONTEXT *VmPtr + ) { EbcDebuggerPushTraceDestEntry ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcJmp); return ; } -VOID -EbcDebuggerHookJMP8Start ( - IN VM_CONTEXT *VmPtr - ) -/*++ - -Routine Description: +/** The hook in ExecuteJMP8, before move IP. It will record trace information. -Arguments: + @param VmPtr - pointer to VM context. - VmPtr - pointer to VM context. - -Returns: - None - ---*/ +**/ +VOID +EbcDebuggerHookJMP8Start ( + IN VM_CONTEXT *VmPtr + ) { EbcDebuggerPushTraceSourceEntry ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcJmp8); return ; } -VOID -EbcDebuggerHookJMP8End ( - IN VM_CONTEXT *VmPtr - ) -/*++ - -Routine Description: +/** The hook in ExecuteJMP8, after move IP. It will record trace information. -Arguments: - - VmPtr - pointer to VM context. - -Returns: - None + @param VmPtr - pointer to VM context. ---*/ +**/ +VOID +EbcDebuggerHookJMP8End ( + IN VM_CONTEXT *VmPtr + ) { EbcDebuggerPushTraceDestEntry ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcJmp8); return ; diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbHook.h b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbHook.h index 7cddd50c09..fd5e430c62 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbHook.h +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbHook.h @@ -1,7 +1,7 @@ -/*++ +/** @file -Copyright (c) 2007, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007, Intel Corporation All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -9,14 +9,7 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: - - EdbHook.h - -Abstract: - - ---*/ +**/ #ifndef _EFI_EDB_HOOKER_H_ #define _EFI_EDB_HOOKER_H_ diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupport.h b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupport.h index 7ad5860f50..ed1abe6ba5 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupport.h +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupport.h @@ -1,7 +1,7 @@ -/*++ +/** @file -Copyright (c) 2007, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007, Intel Corporation All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -9,14 +9,8 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: - EdbSupport.h - -Abstract: - - ---*/ +**/ #ifndef _EFI_EDB_SUPPORT_H_ #define _EFI_EDB_SUPPORT_H_ @@ -175,9 +169,9 @@ PatchForAsciiStrTokenBefore ( IN CHAR8 Patch ); -// -// Shell Library -// +/** +Shell Library. +**/ VOID EFIAPI Input ( diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportFile.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportFile.c index 617a5a844f..6ef7b23be7 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportFile.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportFile.c @@ -1,7 +1,7 @@ -/*++ +/** @file -Copyright (c) 2007, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -9,17 +9,23 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: - EdbSupportFile.c +**/ -Abstract: +#include "Edb.h" +/** + Read a file. ---*/ + @param Vol - File System Volume + @param FileName - The file to be read. + @param BufferSize - The file buffer size + @param Buffer - The file buffer -#include "Edb.h" + @retval EFI_SUCCESS - read file successfully + @retval EFI_NOT_FOUND - file not found +**/ EFI_STATUS EFIAPI ReadFileFromVol ( @@ -28,25 +34,6 @@ ReadFileFromVol ( OUT UINTN *BufferSize, OUT VOID **Buffer ) -/*++ - -Routine Description: - - Read a file. - -Arguments: - - Vol - File System Volume - FileName - The file to be read. - BufferSize - The file buffer size - Buffer - The file buffer - -Returns: - - EFI_SUCCESS - read file successfully - EFI_NOT_FOUND - file not found - ---*/ { EFI_STATUS Status; EFI_FILE_HANDLE RootDir; @@ -138,6 +125,25 @@ Returns: return EFI_SUCCESS; } +/** + + Read a file. + If ScanFs is FLASE, it will use DebuggerPrivate->Vol as default Fs. + If ScanFs is TRUE, it will scan all FS and check the file. + If there is only one file match the name, it will be read. + If there is more than one file match the name, it will return Error. + + @param DebuggerPrivate - EBC Debugger private data structure + @param FileName - The file to be read. + @param BufferSize - The file buffer size + @param Buffer - The file buffer + @param ScanFs - Need Scan all FS + + @retval EFI_SUCCESS - read file successfully + @retval EFI_NOT_FOUND - file not found + @retval EFI_NO_MAPPING - there is duplicated files found + +**/ EFI_STATUS EFIAPI ReadFileToBuffer ( @@ -147,31 +153,6 @@ ReadFileToBuffer ( OUT VOID **Buffer, IN BOOLEAN ScanFs ) -/*++ - -Routine Description: - - Read a file. - If ScanFs is FLASE, it will use DebuggerPrivate->Vol as default Fs. - If ScanFs is TRUE, it will scan all FS and check the file. - If there is only one file match the name, it will be read. - If there is more than one file match the name, it will return Error. - -Arguments: - - DebuggerPrivate - EBC Debugger private data structure - FileName - The file to be read. - BufferSize - The file buffer size - Buffer - The file buffer - ScanFs - Need Scan all FS - -Returns: - - EFI_SUCCESS - read file successfully - EFI_NOT_FOUND - file not found - EFI_NO_MAPPING - there is duplicated files found - ---*/ { EFI_STATUS Status; EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *Vol; @@ -272,6 +253,18 @@ Returns: return EFI_SUCCESS; } +/** + + Get file name under this dir with index + + @param DebuggerPrivate - EBC Debugger private data structure + @param DirName - The dir to be read. + @param FileName - The file name pattern under this dir + @param Index - The file index under this dir + + @return File Name which match the pattern and index. + +**/ CHAR16 * EFIAPI GetFileNameUnderDir ( @@ -280,24 +273,6 @@ GetFileNameUnderDir ( IN CHAR16 *FileName, IN OUT UINTN *Index ) -/*++ - -Routine Description: - - Get file name under this dir with index - -Arguments: - - DebuggerPrivate - EBC Debugger private data structure - DirName - The dir to be read. - FileName - The file name pattern under this dir - Index - The file index under this dir - -Returns: - - File Name which match the pattern and index. - ---*/ { EFI_STATUS Status; EFI_FILE_HANDLE RootDir; diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportString.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportString.c index 555ee96d48..f56412418f 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportString.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportString.c @@ -1,7 +1,7 @@ -/*++ +/** @file -Copyright (c) 2007 - 2016, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007 - 2016, Intel Corporation All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -9,35 +9,23 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: - EdbSupportString.c +**/ -Abstract: +#include "Edb.h" +/** ---*/ + Convert hex string to uint. -#include "Edb.h" + @param str - The string +**/ UINTN EFIAPI Xtoi ( CHAR16 *str ) -/*++ - -Routine Description: - - Convert hex string to uint - -Arguments: - - Str - The string - -Returns: - ---*/ { UINTN u; CHAR16 c; @@ -90,24 +78,19 @@ Returns: return u; } +/** + + Convert hex string to uint. + + @param str - The string + +**/ + UINT64 EFIAPI LXtoi ( CHAR16 *str ) -/*++ - -Routine Description: - - Convert hex string to uint - -Arguments: - - Str - The string - -Returns: - ---*/ { UINT64 u; CHAR16 c; @@ -161,24 +144,18 @@ Returns: return u; } +/** + + Convert hex string to uint. + + @param str - The string + +**/ UINTN EFIAPI Atoi ( CHAR16 *str ) -/*++ - -Routine Description: - - Convert hex string to uint - -Arguments: - - Str - The string - -Returns: - ---*/ { UINTN u; CHAR16 c; @@ -217,24 +194,18 @@ Returns: return u; } +/** + + Convert hex string to uint. + + @param str - The string + +**/ UINTN EFIAPI AsciiXtoi ( CHAR8 *str ) -/*++ - -Routine Description: - - Convert hex string to uint - -Arguments: - - Str - The string - -Returns: - ---*/ { UINTN u; CHAR8 c; @@ -287,24 +258,18 @@ Returns: return u; } +/** + + Convert hex string to uint. + + @param str - The string + +**/ UINTN EFIAPI AsciiAtoi ( CHAR8 *str ) -/*++ - -Routine Description: - - Convert hex string to uint - -Arguments: - - Str - The string - -Returns: - ---*/ { UINTN u; CHAR8 c; @@ -361,28 +326,24 @@ AsciiToUpper ( return (Chr >= 'a' && Chr <= 'z') ? Chr - ('a' - 'A') : Chr; } -INTN -EFIAPI -StrCmpUnicodeAndAscii ( - IN CHAR16 *String, - IN CHAR8 *String2 - ) -/*++ - -Routine Description: +/** Compare the Unicode and Ascii string pointed by String to the string pointed by String2. -Arguments: - String - Unicode String to process + @param String - Unicode String to process - String2 - Ascii string to process + @param String2 - Ascii string to process -Returns: - Return a positive integer if String is lexicall greater than String2; Zero if + @return Return a positive integer if String is lexicall greater than String2; Zero if the two strings are identical; and a negative interger if String is lexically less than String2. ---*/ +**/ +INTN +EFIAPI +StrCmpUnicodeAndAscii ( + IN CHAR16 *String, + IN CHAR8 *String2 + ) { while (*String) { if (*String != (CHAR16)*String2) { @@ -396,27 +357,24 @@ Returns: return (*String - (CHAR16)*String2); } -INTN -EFIAPI -StriCmp ( - IN CHAR16 *String, - IN CHAR16 *String2 - ) -/*++ +/** -Routine Description: Compare the Unicode string pointed by String to the string pointed by String2. -Arguments: - String - Unicode String to process - String2 - Unicode string to process + @param String - Unicode String to process + @param String2 - Unicode string to process -Returns: - Return a positive integer if String is lexically greater than String2; Zero if + @return Return a positive integer if String is lexically greater than String2; Zero if the two strings are identical; and a negative integer if String is lexically less than String2. ---*/ +**/ +INTN +EFIAPI +StriCmp ( + IN CHAR16 *String, + IN CHAR16 *String2 + ) { while ((*String != L'\0') && (UnicodeToUpper (*String) == UnicodeToUpper (*String2))) { @@ -427,28 +385,24 @@ Returns: return UnicodeToUpper (*String) - UnicodeToUpper (*String2); } -INTN -EFIAPI -StriCmpUnicodeAndAscii ( - IN CHAR16 *String, - IN CHAR8 *String2 - ) -/*++ +/** -Routine Description: Compare the Unicode and Ascii string pointed by String to the string pointed by String2. -Arguments: - String - Unicode String to process - - String2 - Ascii string to process + @param String - Unicode String to process + @param String2 - Ascii string to process -Returns: - Return a positive integer if String is lexically greater than String2; Zero if + @return Return a positive integer if String is lexically greater than String2; Zero if the two strings are identical; and a negative integer if String is lexically less than String2. ---*/ +**/ +INTN +EFIAPI +StriCmpUnicodeAndAscii ( + IN CHAR16 *String, + IN CHAR8 *String2 + ) { while ((*String != L'\0') && (UnicodeToUpper (*String) == (CHAR16)AsciiToUpper (*String2))) { @@ -459,19 +413,20 @@ Returns: return UnicodeToUpper (*String) - (CHAR16)AsciiToUpper (*String2); } +/** + + Verify if the string is end with the sub string. + + @param Str - The string where to search the sub string + @param SubStr - The substring. + +**/ BOOLEAN EFIAPI StrEndWith ( IN CHAR16 *Str, IN CHAR16 *SubStr ) -/*++ - -Routine Description: - - Verify if the string is end with the sub string. - ---*/ { CHAR16 *Temp; @@ -491,12 +446,17 @@ Routine Description: } } +/** + Duplicate a string. + + @param Src The string to be duplicated. + +**/ CHAR16 * EFIAPI StrDuplicate ( IN CHAR16 *Src ) -// duplicate a string { CHAR16 *Dest; UINTN Size; @@ -513,19 +473,20 @@ StrDuplicate ( CHAR16 *mLineBuffer = NULL; CHAR16 *mFieldBuffer = NULL; +/** + + Find the first substring. + + @param String Point to the string where to find the substring. + @param CharSet Point to the string to be found. + +**/ UINTN EFIAPI StrSpn ( IN CHAR16 *String, IN CHAR16 *CharSet ) -/*++ - -Routine Description: - - Find the first substring. - ---*/ { UINTN Count; CHAR16 *Str1; @@ -550,6 +511,15 @@ Routine Description: return Count; } +/** + + Searches a string for the first occurrence of a character contained in a + specified buffer. + + @param String Point to the string where to find the substring. + @param CharSet Point to the string to be found. + +**/ CHAR16 * EFIAPI @@ -557,14 +527,6 @@ StrBrk ( IN CHAR16 *String, IN CHAR16 *CharSet ) -/*++ - -Routine Description: - - Searches a string for the first occurrence of a character contained in a - specified buffer. - ---*/ { CHAR16 *Str1; CHAR16 *Str2; @@ -580,19 +542,20 @@ Routine Description: return NULL; } +/** + + Find the next token after one or more specified characters. + + @param String Point to the string where to find the substring. + @param CharSet Point to the string to be found. + +**/ CHAR16 * EFIAPI StrTokenLine ( IN CHAR16 *String OPTIONAL, IN CHAR16 *CharSet ) -/*++ - -Routine Description: - - Find the next token after one or more specified characters. - ---*/ { CHAR16 *Begin; CHAR16 *End; @@ -618,6 +581,14 @@ Routine Description: return Begin; } +/** + + Find the next token after one specificed characters. + + @param String Point to the string where to find the substring. + @param CharSet Point to the string to be found. + +**/ CHAR16 * EFIAPI @@ -625,13 +596,6 @@ StrTokenField ( IN CHAR16 *String OPTIONAL, IN CHAR16 *CharSet ) -/*++ - -Routine Description: - - Find the next token after one specificed characters. - ---*/ { CHAR16 *Begin; CHAR16 *End; @@ -753,19 +717,20 @@ PatchForStrTokenBefore ( CHAR8 *mAsciiLineBuffer = NULL; CHAR8 *mAsciiFieldBuffer = NULL; +/** + + Find the first substring. + + @param String Point to the string where to find the substring. + @param CharSet Point to the string to be found. + +**/ UINTN EFIAPI AsciiStrSpn ( IN CHAR8 *String, IN CHAR8 *CharSet ) -/*++ - -Routine Description: - - Find the first substring. - ---*/ { UINTN Count; CHAR8 *Str1; @@ -790,21 +755,20 @@ Routine Description: return Count; } +/** + Searches a string for the first occurrence of a character contained in a + specified buffer. + + @param String Point to the string where to find the substring. + @param CharSet Point to the string to be found. +**/ CHAR8 * EFIAPI AsciiStrBrk ( IN CHAR8 *String, IN CHAR8 *CharSet ) -/*++ - -Routine Description: - - Searches a string for the first occurrence of a character contained in a - specified buffer. - ---*/ { CHAR8 *Str1; CHAR8 *Str2; @@ -820,19 +784,20 @@ Routine Description: return NULL; } +/** + + Find the next token after one or more specified characters. + + @param String Point to the string where to find the substring. + @param CharSet Point to the string to be found. + +**/ CHAR8 * EFIAPI AsciiStrTokenLine ( IN CHAR8 *String OPTIONAL, IN CHAR8 *CharSet ) -/*++ - -Routine Description: - - Find the next token after one or more specified characters. - ---*/ { CHAR8 *Begin; CHAR8 *End; @@ -858,6 +823,14 @@ Routine Description: return Begin; } +/** + + Find the next token after one specificed characters. + + @param String Point to the string where to find the substring. + @param CharSet Point to the string to be found. + +**/ CHAR8 * EFIAPI @@ -865,13 +838,6 @@ AsciiStrTokenField ( IN CHAR8 *String OPTIONAL, IN CHAR8 *CharSet ) -/*++ - -Routine Description: - - Find the next token after one specificed characters. - ---*/ { CHAR8 *Begin; CHAR8 *End; diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportUI.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportUI.c index 265e6c165b..42d8086521 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportUI.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSupportUI.c @@ -1,7 +1,7 @@ -/*++ +/** @file -Copyright (c) 2007, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -9,14 +9,8 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: - EdbSupportUI.c - -Abstract: - - ---*/ +**/ #include "Edb.h" @@ -33,28 +27,23 @@ SetCursorPosition ( IN UINTN Len ); +/** + + Function waits for a given event to fire, or for an optional timeout to expire. + + @param Event - The event to wait for + @param Timeout - An optional timeout value in 100 ns units. + + @retval EFI_SUCCESS - Event fired before Timeout expired. + @retval EFI_TIME_OUT - Timout expired before Event fired.. + +**/ EFI_STATUS EFIAPI WaitForSingleEvent ( IN EFI_EVENT Event, IN UINT64 Timeout OPTIONAL ) -/*++ - -Routine Description: - Function waits for a given event to fire, or for an optional timeout to expire. - -Arguments: - Event - The event to wait for - - Timeout - An optional timeout value in 100 ns units. - -Returns: - - EFI_SUCCESS - Event fired before Timeout expired. - EFI_TIME_OUT - Timout expired before Event fired.. - ---*/ { EFI_STATUS Status; UINTN Index; @@ -103,6 +92,15 @@ Returns: return Status; } +/** + + Move the cursor position one character backward. + + @param LineLength Length of a line. Get it by calling QueryMode + @param Column Current column of the cursor position + @param Row Current row of the cursor position + +**/ VOID EFIAPI ConMoveCursorBackward ( @@ -110,19 +108,6 @@ ConMoveCursorBackward ( IN OUT UINTN *Column, IN OUT UINTN *Row ) -/*++ - -Routine Description: - Move the cursor position one character backward. - -Arguments: - LineLength Length of a line. Get it by calling QueryMode - Column Current column of the cursor position - Row Current row of the cursor position - -Returns: - ---*/ { ASSERT (Column != NULL); ASSERT (Row != NULL); @@ -144,6 +129,16 @@ Returns: } } +/** + + Move the cursor position one character backward. + + @param LineLength Length of a line. Get it by calling QueryMode + @param TotalRow Total row of a screen, get by calling QueryMode + @param Column Current column of the cursor position + @param Row Current row of the cursor position + +**/ VOID EFIAPI ConMoveCursorForward ( @@ -152,20 +147,6 @@ ConMoveCursorForward ( IN OUT UINTN *Column, IN OUT UINTN *Row ) -/*++ - -Routine Description: - Move the cursor position one character backward. - -Arguments: - LineLength Length of a line. Get it by calling QueryMode - TotalRow Total row of a screen, get by calling QueryMode - Column Current column of the cursor position - Row Current row of the cursor position - -Returns: - ---*/ { ASSERT (Column != NULL); ASSERT (Row != NULL); diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c index 5794502358..1c3a8465f3 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c @@ -1,7 +1,7 @@ -/*++ +/** @file -Copyright (c) 2007 - 2016, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007 - 2016, Intel Corporatio. All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -9,17 +9,24 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: - EdbSymbol.c +**/ -Abstract: +#include "Edb.h" +/** ---*/ + Load single symbol entry. -#include "Edb.h" + @param Object - Symbol file object + @param Name - Symbol name + @param ObjName - Object name + @param Address - Symbol address + @param Type - Symbol type + + @retval EFI_SUCCESS - add single symbol entry successfully +**/ EFI_STATUS EdbLoadSymbolSingleEntry ( IN EFI_DEBUGGER_SYMBOL_OBJECT *Object, @@ -28,25 +35,6 @@ EdbLoadSymbolSingleEntry ( IN UINTN Address, IN EFI_DEBUGGER_SYMBOL_TYPE Type ) -/*++ - -Routine Description: - - Load single symbol entry - -Arguments: - - Object - Symbol file object - Name - Symbol name - ObjName - Object name - Address - Symbol address - Type - Symbol type - -Returns: - - EFI_SUCCESS - add single symbol entry successfully - ---*/ { EFI_DEBUGGER_SYMBOL_ENTRY *Entry; @@ -114,7 +102,7 @@ typedef enum { EdbEbcSymbolParseStateMax, } EDB_EBC_SYMBOL_PARSE_STATE; -/*++ +/** The following code depends on the MAP file generated by IEC compiler (actually Microsoft linker). @@ -165,31 +153,25 @@ typedef enum { 0001:00000000 TestSubRoutine2 10000400 f EbcTest.obj =============================================================================== ---*/ +**/ + +/** + + Load symbol entry by Iec. + + @param Object - Symbol file object + @param BufferSize - Symbol file buffer size + @param Buffer - Symbol file buffer + + @retval EFI_SUCCESS - add symbol entry successfully + +**/ EFI_STATUS EdbLoadSymbolEntryByIec ( IN EFI_DEBUGGER_SYMBOL_OBJECT *Object, IN UINTN BufferSize, IN VOID *Buffer ) -/*++ - -Routine Description: - - Load symbol entry by Iec - -Arguments: - - DebuggerPrivate - EBC Debugger private data structure - Object - Symbol file object - BufferSize - Symbol file buffer size - Buffer - Symbol file buffer - -Returns: - - EFI_SUCCESS - add symbol entry successfully - ---*/ { CHAR8 *LineBuffer; CHAR8 *FieldBuffer; @@ -407,29 +389,23 @@ ExitFieldParse: return EFI_SUCCESS; } +/** + + Load symbol entry. + + @param Object - Symbol file object + @param BufferSize - Symbol file buffer size + @param Buffer - Symbol file buffer + + @retval EFI_SUCCESS - add symbol entry successfully + +**/ EFI_STATUS EdbLoadSymbolEntry ( IN EFI_DEBUGGER_SYMBOL_OBJECT *Object, IN UINTN BufferSize, IN VOID *Buffer ) -/*++ - -Routine Description: - - Load symbol entry - -Arguments: - - Object - Symbol file object - BufferSize - Symbol file buffer size - Buffer - Symbol file buffer - -Returns: - - EFI_SUCCESS - add symbol entry successfully - ---*/ { // // MAP file format depends on the compiler (actually linker). @@ -440,29 +416,23 @@ Returns: return EdbLoadSymbolEntryByIec (Object, BufferSize, Buffer); } +/** + + Find symbol file by name. + + @param DebuggerPrivate - EBC Debugger private data structure + @param FileName - Symbol file name + @param Index - Symbol file index + + @return Object + +**/ EFI_DEBUGGER_SYMBOL_OBJECT * EdbFindSymbolFile ( IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN CHAR16 *FileName, IN OUT UINTN *Index OPTIONAL ) -/*++ - -Routine Description: - - Find symbol file by name - -Arguments: - - DebuggerPrivate - EBC Debugger private data structure - FileName - Symbol file name - Index - Symbol file index - -Returns: - - Object - ---*/ { UINTN ObjectIndex; @@ -487,6 +457,18 @@ Returns: return NULL; } +/** + + Find symbol by address. + + @param Address - Symbol address + @param Type - Search type + @param RetObject - Symbol object + @param RetEntry - Symbol entry + + @return Nearest symbol address + +**/ UINTN EbdFindSymbolAddress ( IN UINTN Address, @@ -494,24 +476,6 @@ EbdFindSymbolAddress ( OUT EFI_DEBUGGER_SYMBOL_OBJECT **RetObject, OUT EFI_DEBUGGER_SYMBOL_ENTRY **RetEntry ) -/*++ - -Routine Description: - - Find symbol by address - -Arguments: - - Address - Symbol address - Type - Search type - RetObject - Symbol object - RetEntry - Symbol entry - -Returns: - - Nearest symbol address - ---*/ { UINTN Index; UINTN SubIndex; @@ -627,27 +591,21 @@ Returns: return 0; } +/** + + Unload symbol file by name. + + @param DebuggerPrivate - EBC Debugger private data structure + @param FileName - Symbol file name + + @retval EFI_SUCCESS - unload symbol successfully + +**/ EFI_STATUS EdbUnloadSymbol ( IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN CHAR16 *FileName ) -/*++ - -Routine Description: - - Unload symbol file by name - -Arguments: - - DebuggerPrivate - EBC Debugger private data structure - FileName - Symbol file name - -Returns: - - EFI_SUCCESS - unload symbol successfully - ---*/ { EFI_DEBUGGER_SYMBOL_OBJECT *Object; UINTN ObjectIndex; @@ -709,6 +667,18 @@ Returns: return EFI_SUCCESS; } +/** + + Load symbol file by name. + + @param DebuggerPrivate - EBC Debugger private data structure + @param FileName - Symbol file name + @param BufferSize - Symbol file buffer size + @param Buffer - Symbol file buffer + + @retval EFI_SUCCESS - load symbol successfully + +**/ EFI_STATUS EdbLoadSymbol ( IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, @@ -716,24 +686,6 @@ EdbLoadSymbol ( IN UINTN BufferSize, IN VOID *Buffer ) -/*++ - -Routine Description: - - Load symbol file by name - -Arguments: - - DebuggerPrivate - EBC Debugger private data structure - FileName - Symbol file name - BufferSize - Symbol file buffer size - Buffer - Symbol file buffer - -Returns: - - EFI_SUCCESS - load symbol successfully - ---*/ { EFI_DEBUGGER_SYMBOL_OBJECT *Object; EFI_STATUS Status; @@ -793,26 +745,20 @@ Returns: return EFI_SUCCESS; } -CHAR8 * -GetPdbPath ( - VOID *ImageBase - ) -/*++ - -Routine Description: - - Located PDB path name in PE image - -Arguments: +/** - ImageBase - base of PE to search + Located PDB path name in PE image. -Returns: + @param ImageBase - base of PE to search - Pointer into image at offset of PDB file name if PDB file name is found, + @return Pointer into image at offset of PDB file name if PDB file name is found, Otherwise a pointer to an empty string. ---*/ +**/ +CHAR8 * +GetPdbPath ( + VOID *ImageBase + ) { CHAR8 *PdbPath; UINT32 DirCount; @@ -896,28 +842,22 @@ Returns: return PdbPath; } +/** + + Check whether PDB file and MAP file have same name. + + @param PdbFileName - PDB file name + @param MapFileName - MAP file name + + @retval TRUE - PDB and MAP file name match + @retval FALSE - PDB and MAP file name not match + +**/ BOOLEAN MatchPdbAndMap ( IN CHAR8 *PdbFileName, IN CHAR16 *MapFileName ) -/*++ - -Routine Description: - - Check whether PDB file and MAP file have same name - -Arguments: - - PdbFileName - PDB file name - MapFileName - MAP file name - -Returns: - - TRUE - PDB and MAP file name match - FALSE - PDB and MAP file name not match - ---*/ { UINTN PdbNameSize; UINTN MapNameSize; @@ -968,11 +908,7 @@ typedef struct { EFI_DEBUG_IMAGE_INFO_TABLE_HEADER mDebugImageInfoTableHeader; -VOID -EdbFixDebugImageInfoTable ( - IN OUT EFI_DEBUG_IMAGE_INFO_TABLE_HEADER **DebugImageInfoTableHeader - ) -/* +/** For compatibility consideration, we handle 2 cases: 1) IA32: @@ -997,7 +933,13 @@ For compatibility consideration, we handle 2 cases: | TableSize | | | +------------------------+ +------------------------+ -*/ + @param DebugImageInfoTableHeader Point to the EFI_DEBUG_IMAGE_INFO_TABLE_HEADER structure. + +**/ +VOID +EdbFixDebugImageInfoTable ( + IN OUT EFI_DEBUG_IMAGE_INFO_TABLE_HEADER **DebugImageInfoTableHeader + ) { mDebugImageInfoTableHeader.EfiDebugImageInfoTable = ((EFI_DEBUG_IMAGE_INFO_TABLE_HEADER_OLD *)(*DebugImageInfoTableHeader))->EfiDebugImageInfoTable; mDebugImageInfoTableHeader.UpdateStatus = ((EFI_DEBUG_IMAGE_INFO_TABLE_HEADER_OLD *)(*DebugImageInfoTableHeader))->UpdateStatus; @@ -1019,30 +961,24 @@ For compatibility consideration, we handle 2 cases: // BUGBUG: work-around end // +/** + + Patch symbol RVA. + + @param DebuggerPrivate - EBC Debugger private data structure + @param FileName - Symbol file name + @param SearchType - Search type for Object + + @retval EFI_SUCCESS - Patch symbol RVA successfully + @retval EFI_NOT_FOUND - Symbol RVA base not found + +**/ EFI_STATUS EdbPatchSymbolRVA ( IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN CHAR16 *FileName, IN EDB_EBC_IMAGE_RVA_SEARCH_TYPE SearchType ) -/*++ - -Routine Description: - - Patch symbol RVA - -Arguments: - - DebuggerPrivate - EBC Debugger private data structure - FileName - Symbol file name - SearchType - Search type for Object - -Returns: - - EFI_SUCCESS - Patch symbol RVA successfully - EFI_NOT_FOUND - Symbol RVA base not found - ---*/ { EFI_STATUS Status; UINTN ImageNumber; @@ -1149,28 +1085,22 @@ Returns: return EFI_NOT_FOUND; } +/** + + Check whether OBJ file and COD file have same name. + + @param ObjFileName - OBJ file name + @param CodFileName - COD file name + + @retval TRUE - OBJ and COD file name match + @retval FALSE - OBJ and COD file name not match + +**/ BOOLEAN MatchObjAndCod ( IN CHAR8 *ObjFileName, IN CHAR16 *CodFileName ) -/*++ - -Routine Description: - - Check whether OBJ file and COD file have same name - -Arguments: - - ObjFileName - OBJ file name - CodFileName - COD file name - -Returns: - - TRUE - OBJ and COD file name match - FALSE - OBJ and COD file name not match - ---*/ { UINTN ObjNameSize; UINTN CodNameSize; @@ -1219,283 +1149,25 @@ typedef enum { EdbEbcCodParseStateMax, } EDB_EBC_COD_PARSE_STATE; -/*++ +/** The following code depends on the COD file generated by IEC compiler. - Sample as follows: EbcTest.cod -=============================================================================== -; -- Machine type EFI -; mark_description "Intel(R) C Compiler for EFI Byte Code, Version 1.2 Build 20040123"; -; mark_description "XXX"; -;ident "Intel(R) C Compiler for EFI Byte Code, Version 1.2 Build 20040123" -;ident "XXX" - .686P - .387 -_TEXT SEGMENT PARA PUBLIC USE32 'CODE' -_TEXT ENDS -_DATA SEGMENT PARA PUBLIC USE32 'DATA' - ALIGN 010H -_DATA ENDS -_BSS SEGMENT PARA PUBLIC USE32 'BSS' - ALIGN 010H -_BSS ENDS -_VARBSS SEGMENT PARA PUBLIC USE32 'BSS' - ALIGN 010H -_VARBSS ENDS - ASSUME CS:FLAT,DS:FLAT,SS:FLAT -_DATA SEGMENT PARA PUBLIC USE32 'DATA' -TestVariable2 DD 000000003H,000000000H ; u64 -_DATA ENDS -_DATA SEGMENT PARA PUBLIC USE32 'DATA' -_DATA ENDS -_TEXT SEGMENT PARA PUBLIC USE32 'CODE' -; -- Begin EfiMain -; mark_begin; - PUBLIC EfiMain -EfiMain PROC NEAR -$B3$1:; 11a -$LN45: - -;117 ; { - - 0011a 60 00 70 80 MOVqw R0, R0(+0,-112) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:117 -$LN46: - -;118 ; UINT16 test = 0x1234; - - 0011e 77 58 58 00 34 - 12 MOVIww @R0(+0,+88), +4660 ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:118 -$LN47: - -;121 ; EFI_STATUS Status; -;121 ; -;121 ; SystemTable->ConOut->OutputString ( - - 00124 72 87 01 12 MOVnw R7, @R0(+1,+128) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:121 - 00128 72 f7 85 21 MOVnw R7, @R7(+5,+24) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:121 -$LN48: - -;122 ; SystemTable->ConOut, - - 0012c 72 84 01 12 MOVnw R4, @R0(+1,+128) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:122 - 00130 72 c8 85 21 MOVnw @R0, @R4(+5,+24) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:122 - 00134 b9 34 00 00 00 - 00 MOVreld R4, __STRING$1 ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:122 - 0013a b2 48 01 10 MOVnw @R0(+1,+0), R4 ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:122 - 0013e 83 2f 01 00 00 - 10 CALLEX @R7(+1,+0) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:122 -$B3$2:; 144 -$LN49: - -;125 ; L"Hello EBC Test!\n\r" -;125 ; ); -;125 ; EFI_BREAKPOINT (); - - 00144 00 03 BREAK 3 ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:125 -$B3$3:; 146 -$LN50: - -;126 ; TestVariable1 = 6; - - 00146 b9 37 00 00 00 - 00 MOVreld R7, TestVariable1 ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:126 - 0014c 78 0f 06 00 MOVInw @R7, (0,6) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:126 -$LN51: - -;127 ; TestSubRoutineSub (1, 5); - - 00150 78 08 01 00 MOVInw @R0, (0,1) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:127 - 00154 78 48 01 10 05 - 00 MOVInw @R0(1,0), (0,5) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:127 - 0015a 83 10 00 00 00 - 00 CALL TestSubRoutineSub ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:127 -$B3$4:; 160 -$LN52: - -;129 ; -;129 ; SystemTable->ConOut->OutputString ( - - 00160 72 87 01 12 MOVnw R7, @R0(+1,+128) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:129 - 00164 72 f7 85 21 MOVnw R7, @R7(+5,+24) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:129 -$LN53: - -;130 ; SystemTable->ConOut, - - 00168 72 84 01 12 MOVnw R4, @R0(+1,+128) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:130 - 0016c 72 c8 85 21 MOVnw @R0, @R4(+5,+24) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:130 -$LN54: - -;131 ; TestStr - - 00170 b9 34 00 00 00 - 00 MOVreld R4, TestStr ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:131 - 00176 b2 c8 01 10 MOVnw @R0(+1, +0), @R4 ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:131 - 0017a 83 2f 01 00 00 - 10 CALLEX @R7(+1,+0) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:131 -$B3$5:; 180 -$LN55: - -;134 ; ); -;134 ; -;134 ; test = test & 0xFF; - - 00180 de 88 58 00 58 - 00 MOVww @R0(+0,+88), @R0(+0,+88) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:134 -$LN56: - -;139 ; if (test != 0x34) { -;139 ; // EFI_BREAKPOINT (); -;139 ; } -;139 ; -;139 ; Status = TestSubRoutine (1, 2, 3, 4, 5, 6, 7, 8, 9, 10); - - 00186 78 08 01 00 MOVInw @R0, (0,1) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:139 - 0018a 78 48 01 10 02 - 00 MOVInw @R0(1,0), (0,2) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:139 - 00190 78 48 02 10 03 - 00 MOVInw @R0(2,0), (0,3) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:139 - 00196 78 48 03 10 04 - 00 MOVInw @R0(3,0), (0,4) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:139 - 0019c 78 48 04 20 05 - 00 MOVInw @R0(4,0), (0,5) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:139 - 001a2 78 48 05 20 06 - 00 MOVInw @R0(5,0), (0,6) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:139 - 001a8 78 48 06 20 07 - 00 MOVInw @R0(6,0), (0,7) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:139 - 001ae 78 48 07 20 08 - 00 MOVInw @R0(7,0), (0,8) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:139 - 001b4 78 48 08 20 09 - 00 MOVInw @R0(8,0), (0,9) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:139 - 001ba 78 48 09 20 0a - 00 MOVInw @R0(9,0), (0,10) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:139 - 001c0 83 10 00 00 00 - 00 CALL TestSubRoutine ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:139 -$B3$10:; 1c6 - 001c6 b2 78 60 00 MOVnw @R0(+0,+96), R7 ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:139 -$B3$6:; 1ca -$LN57: - 001ca f2 88 50 00 60 - 00 MOVnw @R0(+0,+80), @R0(+0,+96) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:139 -$LN58: - -;141 ; -;141 ; SystemTable->ConOut->OutputString ( - - 001d0 72 87 01 12 MOVnw R7, @R0(+1,+128) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:141 - 001d4 72 f7 85 21 MOVnw R7, @R7(+5,+24) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:141 -$LN59: - -;142 ; SystemTable->ConOut, - - 001d8 72 84 01 12 MOVnw R4, @R0(+1,+128) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:142 - 001dc 72 c8 85 21 MOVnw @R0, @R4(+5,+24) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:142 - 001e0 b9 34 00 00 00 - 00 MOVreld R4, __STRING$2 ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:142 - 001e6 b2 48 01 10 MOVnw @R0(+1,+0), R4 ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:142 - 001ea 83 2f 01 00 00 - 10 CALLEX @R7(+1,+0) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:142 -$B3$7:; 1f0 -$LN60: - -;146 ; L"Goodbye EBC Test!\n\r" -;146 ; ); -;146 ; -;146 ; return Status; - - 001f0 72 87 50 00 MOVnw R7, @R0(+0,+80) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:146 - 001f4 60 00 70 00 MOVqw R0, R0(+0,+112) ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:146 - 001f8 04 00 RET ;C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest.c:146 -; mark_end; -EfiMain ENDP -_TEXT ENDS -_DATA SEGMENT PARA PUBLIC USE32 'DATA' - DB 3 DUP (0) ; pad -__STRING$2 DW 71 ; u16 - DW 111 ; u16 - DW 111 ; u16 - DW 100 ; u16 - DW 98 ; u16 - DW 121 ; u16 - DW 101 ; u16 - DW 32 ; u16 - DW 69 ; u16 - DW 66 ; u16 - DW 67 ; u16 - DW 32 ; u16 - DW 84 ; u16 - DW 101 ; u16 - DW 115 ; u16 - DW 116 ; u16 - DW 33 ; u16 - DW 10 ; u16 - DW 13 ; u16 - DW 0 ; u16 -__STRING$1 DW 72 ; u16 - DW 101 ; u16 - DW 108 ; u16 - DW 108 ; u16 - DW 111 ; u16 - DW 32 ; u16 - DW 69 ; u16 - DW 66 ; u16 - DW 67 ; u16 - DW 32 ; u16 - DW 84 ; u16 - DW 101 ; u16 - DW 115 ; u16 - DW 116 ; u16 - DW 33 ; u16 - DW 10 ; u16 - DW 13 ; u16 - DW 0 ; u16 -_DATA ENDS -_DATA SEGMENT PARA PUBLIC USE32 'DATA' -_DATA ENDS -; -- End EfiMain -_DATA SEGMENT PARA PUBLIC USE32 'DATA' -__STRING$0 DW 55 ; u16 - DW 56 ; u16 - DW 57 ; u16 - DW 52 ; u16 - DW 53 ; u16 - DW 54 ; u16 - DW 49 ; u16 - DW 50 ; u16 - DW 51 ; u16 - DW 13 ; u16 - DW 10 ; u16 - DW 0 ; u16 -_DATA ENDS -_VARBSS SEGMENT PARA PUBLIC USE32 'BSS' - PUBLIC TestStr -TestStr DD 2 DUP (?) ; pad - PUBLIC TestVariable1 -TestVariable1 DD 2 DUP (?) ; pad -_VARBSS ENDS -_VARBSS_INIT SEGMENT DWORD PUBLIC USE32 'CODE' -; -- Begin varbss_init_C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest$c45b815d2 - PUBLIC varbss_init_C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest$c45b815d2 -varbss_init_C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest$c45b815d2 PROC NEAR - 00000 b9 34 00 00 00 - 00 MOVreld R4, TestStr - 00006 b9 35 00 00 00 - 00 MOVreld R5, __STRING$0 - 0000c 33 5c MOVnd @R4, R5 - 0000e b9 34 00 00 00 - 00 MOVreld R4, TestVariable1 - 00014 78 0c 04 00 MOVInw @R4, (0,4) - 00018 04 00 RET -; -- End varbss_init_C:\efi_src\TIANO\Edk\Sample\Universal\Ebc\Dxe\EbcTest\EbcTest$c45b815d2 -_VARBSS_INIT ENDS -_DATA SEGMENT PARA PUBLIC USE32 'DATA' -_DATA ENDS -EXTRN TestSubRoutineSub:PROC - END +**/ -=============================================================================== +/** + + Load code by symbol by Iec. + + @param Name - Symbol file name + @param Buffer - Symbol file buffer + @param BufferSize - Symbol file buffer size + @param CodeBufferSize - Code buffer size + @param FuncOffset - Code funcion offset ---*/ + @return CodeBuffer + +**/ CHAR8 * EdbLoadCodBySymbolByIec ( IN CHAR8 *Name, @@ -1504,25 +1176,6 @@ EdbLoadCodBySymbolByIec ( OUT UINTN *CodeBufferSize, OUT UINTN *FuncOffset ) -/*++ - -Routine Description: - - Load code by symbol by Iec - -Arguments: - - Name - Symbol file name - BufferSize - Symbol file buffer size - Buffer - Symbol file buffer - CodeBufferSize - Code buffer size - FuncOffset - Code funcion offset - -Returns: - - CodeBuffer - ---*/ { CHAR8 *LineBuffer; CHAR8 *FieldBuffer; @@ -1646,6 +1299,19 @@ Returns: return NULL; } +/** + + Load code by symbol. + + @param Name - Symbol file name + @param Buffer - Symbol file buffer + @param BufferSize - Symbol file buffer size + @param CodeBufferSize - Code buffer size + @param FuncOffset - Code funcion offset + + @return CodeBuffer + +**/ CHAR8 * EdbLoadCodBySymbol ( IN CHAR8 *Name, @@ -1654,25 +1320,6 @@ EdbLoadCodBySymbol ( OUT UINTN *CodeBufferSize, OUT UINTN *FuncOffset ) -/*++ - -Routine Description: - - Load code by symbol - -Arguments: - - Name - Symbol file name - BufferSize - Symbol file buffer size - Buffer - Symbol file buffer - CodeBufferSize - Code buffer size - FuncOffset - Code funcion offset - -Returns: - - CodeBuffer - ---*/ { // // COD file format depends on the compiler. @@ -1683,28 +1330,21 @@ Returns: return EdbLoadCodBySymbolByIec (Name, Buffer, BufferSize, CodeBufferSize, FuncOffset); } +/** + + Find code from object. + + @param DebuggerPrivate EBC Debugger private data structure + @param Object - Symbol object + @param FileName - File name + +**/ VOID * EdbFindCodeFromObject ( IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_DEBUGGER_SYMBOL_OBJECT *Object, IN CHAR16 *FileName ) -/*++ - -Routine Description: - - Find code from object - -Arguments: - - Object - Symbol object - FileName - File name - -Returns: - - CodeBuffer - ---*/ { UINTN EntryIndex; @@ -1745,6 +1385,19 @@ Returns: return NULL; } +/** + + Load code. + + @param DebuggerPrivate - EBC Debugger private data structure + @param MapFileName - Symbol file name + @param FileName - Code file name + @param BufferSize - Code file buffer size + @param Buffer - Code file buffer + + @retval EFI_SUCCESS - Code loaded successfully + +**/ EFI_STATUS EdbLoadCode ( IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, @@ -1753,25 +1406,6 @@ EdbLoadCode ( IN UINTN BufferSize, IN VOID *Buffer ) -/*++ - -Routine Description: - - Load code - -Arguments: - - DebuggerPrivate - EBC Debugger private data structure - MapFileName - Symbol file name - FileName - Code file name - BufferSize - Code file buffer size - Buffer - Code file buffer - -Returns: - - EFI_SUCCESS - Code loaded successfully - ---*/ { EFI_DEBUGGER_SYMBOL_OBJECT *Object; UINTN ObjectIndex; @@ -1863,6 +1497,18 @@ Returns: return EFI_SUCCESS; } +/** + + Unload code. + + @param DebuggerPrivate - EBC Debugger private data structure + @param MapFileName - Symbol file name + @param FileName - Code file name + @param Buffer - Code file buffer + + @retval EFI_SUCCESS - Code unloaded successfully + +**/ EFI_STATUS EdbUnloadCode ( IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, @@ -1870,24 +1516,6 @@ EdbUnloadCode ( IN CHAR16 *FileName, OUT VOID **Buffer ) -/*++ - -Routine Description: - - Unload code - -Arguments: - - DebuggerPrivate - EBC Debugger private data structure - MapFileName - Symbol file name - FileName - Code file name - Buffer - Code file buffer - -Returns: - - EFI_SUCCESS - Code unloaded successfully - ---*/ { EFI_DEBUGGER_SYMBOL_OBJECT *Object; UINTN ObjectIndex; @@ -1940,6 +1568,19 @@ Returns: return EFI_SUCCESS; } +/** + + Add code buffer. + + @param DebuggerPrivate - EBC Debugger private data structure + @param MapFileName - Symbol file name + @param CodeFileName - Code file name + @param SourceBufferSize- Code buffer size + @param SourceBuffer - Code buffer + + @retval EFI_SUCCESS - CodeBuffer added successfully + +**/ EFI_STATUS EdbAddCodeBuffer ( IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, @@ -1948,25 +1589,6 @@ EdbAddCodeBuffer ( IN UINTN SourceBufferSize, IN VOID *SourceBuffer ) -/*++ - -Routine Description: - - Add code buffer - -Arguments: - - DebuggerPrivate - EBC Debugger private data structure - MapFileName - Symbol file name - CodeFileName - Code file name - SourceBufferSize- Code buffer size - SourceBuffer - Code buffer - -Returns: - - EFI_SUCCESS - CodeBuffer added successfully - ---*/ { UINTN Index; EFI_DEBUGGER_SYMBOL_OBJECT *Object; @@ -1991,6 +1613,18 @@ Returns: return EFI_SUCCESS; } +/** + + Delete code buffer. + + @param DebuggerPrivate - EBC Debugger private data structure + @param MapFileName - Symbol file name + @param CodeFileName - Code file name + @param SourceBuffer - Code buffer + + @retval EFI_SUCCESS - CodeBuffer deleted successfully + +**/ EFI_STATUS EdbDeleteCodeBuffer ( IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, @@ -1998,24 +1632,6 @@ EdbDeleteCodeBuffer ( IN CHAR16 *CodeFileName, IN VOID *SourceBuffer ) -/*++ - -Routine Description: - - Delete code buffer - -Arguments: - - DebuggerPrivate - EBC Debugger private data structure - MapFileName - Symbol file name - CodeFileName - Code file name - SourceBuffer - Code buffer - -Returns: - - EFI_SUCCESS - CodeBuffer deleted successfully - ---*/ { UINTN Index; EFI_DEBUGGER_SYMBOL_OBJECT *Object; @@ -2058,25 +1674,19 @@ Returns: return EFI_SUCCESS; } -CHAR8 * -FindSymbolStr ( - IN UINTN Address - ) -/*++ - -Routine Description: +/** - Find the symbol string according to address + Find the symbol string according to address. -Arguments: + @param Address - Symbol address - Address - Symbol address + @return Symbol string -Returns: - - Symbol string - ---*/ +**/ +CHAR8 * +FindSymbolStr ( + IN UINTN Address + ) { UINTN ObjectIndex; EFI_DEBUGGER_SYMBOL_OBJECT *Object; @@ -2112,27 +1722,21 @@ Returns: return NULL; } +/** + + Get line number and offset from this line in code file. + + @param Line - Line buffer in code file + @param Offset - Offset to functin entry + + @return Line number + +**/ UINTN EdbGetLineNumberAndOffsetFromThisLine ( IN VOID *Line, OUT UINTN *Offset ) -/*++ - -Routine Description: - - Get line number and offset from this line in code file - -Arguments: - - Line - Line buffer in code file - Offset - Offset to functin entry - -Returns: - - Line number - ---*/ { UINTN LineNumber; CHAR8 *LineBuffer; @@ -2211,29 +1815,23 @@ typedef enum { EdbEbcLineSearchTypeMax, } EDB_EBC_LINE_SEARCH_TYPE; +/** + + Get line number from this code file. + + @param Entry - Symbol entry + @param FuncOffset - Offset to functin entry + @param SearchType - Search type for the code + + @return Line number + +**/ UINTN EdbGetLineNumberFromCode ( IN EFI_DEBUGGER_SYMBOL_ENTRY *Entry, IN UINTN FuncOffset, IN EDB_EBC_LINE_SEARCH_TYPE SearchType ) -/*++ - -Routine Description: - - Get line number from this code file - -Arguments: - - Entry - Symbol entry - FuncOffset - Offset to functin entry - SearchType - Search type for the code - -Returns: - - Line number - ---*/ { CHAR8 *LineBuffer; UINTN LineNumber; @@ -2328,29 +1926,23 @@ Returns: return (UINTN)-1; } +/** + + Get the source string from this code file by line. + + @param Entry - Symbol entry + @param LineNumber - line number + @param FuncEnd - Function end + + @return Funtion start + +**/ VOID * EdbGetSourceStrFromCodeByLine ( IN EFI_DEBUGGER_SYMBOL_ENTRY *Entry, IN UINTN LineNumber, IN VOID **FuncEnd ) -/*++ - -Routine Description: - - Get the source string from this code file by line - -Arguments: - - Entry - Symbol entry - LineNumber - line number - FuncEnd - Function end - -Returns: - - Funtion start - ---*/ { CHAR8 *LineBuffer; CHAR8 *FieldBuffer; @@ -2400,29 +1992,23 @@ Returns: return NULL; } +/** + + Get source string from this code file. + + @param Entry - Symbol entry + @param FuncOffset - Offset to functin entry + @param FuncEnd - Function end + + @retval Funtion start + +**/ VOID * EdbGetSourceStrFromCode ( IN EFI_DEBUGGER_SYMBOL_ENTRY *Entry, IN UINTN FuncOffset, IN VOID **FuncEnd ) -/*++ - -Routine Description: - - Get source string from this code file - -Arguments: - - Entry - Symbol entry - FuncOffset - Offset to functin entry - FuncEnd - Function end - -Returns: - - Funtion start - ---*/ { UINTN LineNumber; @@ -2437,28 +2023,22 @@ Returns: return EdbGetSourceStrFromCodeByLine (Entry, LineNumber, FuncEnd); } +/** + + Print source. + + @param Address - Instruction address + @param IsPrint - Whether need to print + + @retval 1 - find the source + @retval 0 - not find the source + +**/ UINTN EdbPrintSource ( IN UINTN Address, IN BOOLEAN IsPrint ) -/*++ - -Routine Description: - - Print source - -Arguments: - - Address - Instruction address - IsPrint - Whether need to print - -Returns: - - 1 - find the source - 0 - not find the source - ---*/ { UINTN SymbolAddress; EFI_DEBUGGER_SYMBOL_OBJECT *RetObject; @@ -2540,29 +2120,21 @@ Returns: return 1 ; } +/** + + Get Mapfile and SymbolName from one symbol format: [MapFileName:]SymbolName. + + @param Symbol - whole Symbol name + @param MapfileName - the mapfile name in the symbol + @param SymbolName - the symbol name in the symbol + +**/ VOID GetMapfileAndSymbol ( IN CHAR16 *Symbol, OUT CHAR16 **MapfileName, OUT CHAR16 **SymbolName ) -/*++ - -Routine Description: - - Get Mapfile and SymbolName from one symbol format: [MapFileName:]SymbolName - -Arguments: - - Symbol - whole Symbol name - MapfileName - the mapfile name in the symbol - SymbolName - the symbol name in the symbol - -Returns: - - None - ---*/ { CHAR16 *Ch; @@ -2584,29 +2156,23 @@ Returns: return ; } +/** + + Convert a symbol to an address. + + @param Symbol - Symbol name + @param Address - Symbol address + + @retval EFI_SUCCESS - symbol found and address returned. + @retval EFI_NOT_FOUND - symbol not found + @retval EFI_NO_MAPPING - duplicated symbol not found + +**/ EFI_STATUS Symboltoi ( IN CHAR16 *Symbol, OUT UINTN *Address ) -/*++ - -Routine Description: - - Convert a symbol to an address - -Arguments: - - Symbol - Symbol name - Address - Symbol address - -Returns: - - EFI_SUCCESS - symbol found and address returned. - EFI_NOT_FOUND - symbol not found - EFI_NO_MAPPING - duplicated symbol not found - ---*/ { UINTN ObjectIndex; EFI_DEBUGGER_SYMBOL_OBJECT *Object; diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.h b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.h index a9d49d2ee1..c4c28582e7 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.h +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.h @@ -1,7 +1,7 @@ -/*++ +/** @file -Copyright (c) 2007, Intel Corporation -All rights reserved. This program and the accompanying materials +Copyright (c) 2007, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -9,14 +9,8 @@ http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -Module Name: - EdbSymbol.h - -Abstract: - - ---*/ +**/ #ifndef _EFI_EDB_SYMBOL_H_ #define _EFI_EDB_SYMBOL_H_ -- 2.39.2