X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FEbcDxe%2FEbcDebugger%2FEdb.c;h=611b2de5d81f5512d0449e6e90a15cc9f332497b;hb=9d510e61fceee7b92955ef9a3c20343752d8ce3f;hp=6485060068832970f9bfa0a9aaedee40f13f3f03;hpb=2b2efe33eaceb3fd2b5c6859dcb5151970dc797b;p=mirror_edk2.git diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/Edb.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/Edb.c index 6485060068..611b2de5d8 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/Edb.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/Edb.c @@ -1,21 +1,9 @@ -/*++ +/** @file -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 +Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent -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 +54,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 +97,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 +145,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 +241,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 +287,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 +304,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 +351,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 +368,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 +407,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 +424,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,36 +460,30 @@ 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. + @param ExceptionType Exception type. + @param SystemContext EBC system context. -Returns: - - None - ---*/ +**/ +VOID +EFIAPI +EdbExceptionHandler ( + IN EFI_EXCEPTION_TYPE ExceptionType, + IN OUT EFI_SYSTEM_CONTEXT SystemContext + ) { CHAR16 InputBuffer[EFI_DEBUG_INPUS_BUFFER_SIZE]; CHAR16 *CommandArg; EFI_DEBUGGER_COMMAND DebuggerCommand; EFI_DEBUG_STATUS DebugStatus; - STATIC BOOLEAN mInitialized = FALSE; + STATIC BOOLEAN mInitialized; + + mInitialized = FALSE; DEBUG ((DEBUG_ERROR, "Hello EBC Debugger!\n"));