MdeModulePkg/EbcDxe: Make the comments align with EDKII coding style

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Pete Batard <pete@akeo.ie>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Jiewen.yao@intel.com
This commit is contained in:
Dandan Bi
2016-11-29 11:01:00 +08:00
committed by Star Zeng
parent 445d200762
commit e8a5ac7c49
30 changed files with 2356 additions and 4016 deletions

View File

@ -1,7 +1,7 @@
/*++ /** @file
Copyright (c) 2007 - 2016, Intel Corporation Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
All rights reserved. This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php 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, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: **/
Ebc.c
Abstract:
--*/
#include <Uefi.h> #include <Uefi.h>
#include "Edb.h" #include "Edb.h"
@ -66,27 +60,19 @@ CHAR16 *mExceptionStr[] = {
L"EXCEPT_EBC_SINGLE_STEP", 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 VOID
EdbClearAllBreakpoint ( EdbClearAllBreakpoint (
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN BOOLEAN NeedRemove 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; UINTN Index;
@ -117,25 +103,17 @@ Returns:
return ; return ;
} }
/**
Set all the breakpoint.
@param DebuggerPrivate EBC Debugger private data structure
**/
VOID VOID
EdbSetAllBreakpoint ( EdbSetAllBreakpoint (
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate
) )
/*++
Routine Description:
Set all the breakpoint
Arguments:
DebuggerPrivate - EBC Debugger private data structure
Returns:
None
--*/
{ {
UINTN Index; UINTN Index;
UINT16 Data16; UINT16 Data16;
@ -173,28 +151,20 @@ Returns:
return ; return ;
} }
/**
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
@param DebuggerPrivate EBC Debugger private data structure
@param SystemContext EBC system context.
**/
VOID VOID
EdbCheckBreakpoint ( EdbCheckBreakpoint (
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN EFI_SYSTEM_CONTEXT SystemContext 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.
Returns:
None
--*/
{ {
UINT64 Address; UINT64 Address;
UINTN Index; UINTN Index;
@ -277,25 +247,16 @@ Returns:
return ; return ;
} }
/**
clear all the symbol.
@param DebuggerPrivate EBC Debugger private data structure
**/
VOID VOID
EdbClearSymbol ( EdbClearSymbol (
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate 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_CONTEXT *DebuggerSymbolContext;
EFI_DEBUGGER_SYMBOL_OBJECT *Object; EFI_DEBUGGER_SYMBOL_OBJECT *Object;
@ -332,6 +293,16 @@ Returns:
return ; 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 EFI_STATUS
InitDebuggerPrivateData ( InitDebuggerPrivateData (
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
@ -339,24 +310,6 @@ InitDebuggerPrivateData (
IN EFI_SYSTEM_CONTEXT SystemContext, IN EFI_SYSTEM_CONTEXT SystemContext,
IN BOOLEAN Initialized 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. // clear STEP flag in any condition.
@ -404,6 +357,16 @@ Returns:
return EFI_SUCCESS; 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 EFI_STATUS
DeinitDebuggerPrivateData ( DeinitDebuggerPrivateData (
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
@ -411,24 +374,6 @@ DeinitDebuggerPrivateData (
IN EFI_SYSTEM_CONTEXT SystemContext, IN EFI_SYSTEM_CONTEXT SystemContext,
IN BOOLEAN Initialized 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) { if (!Initialized) {
// //
@ -468,6 +413,16 @@ Returns:
return EFI_SUCCESS; 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 VOID
PrintExceptionReason ( PrintExceptionReason (
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
@ -475,24 +430,6 @@ PrintExceptionReason (
IN EFI_SYSTEM_CONTEXT SystemContext, IN EFI_SYSTEM_CONTEXT SystemContext,
IN BOOLEAN Initialized 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 // Print break status
@ -529,30 +466,22 @@ Returns:
return ; return ;
} }
/**
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 VOID
EFIAPI EFIAPI
EdbExceptionHandler ( EdbExceptionHandler (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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
--*/
{ {
CHAR16 InputBuffer[EFI_DEBUG_INPUS_BUFFER_SIZE]; CHAR16 InputBuffer[EFI_DEBUG_INPUS_BUFFER_SIZE];
CHAR16 *CommandArg; CHAR16 *CommandArg;

View File

@ -1,7 +1,7 @@
/*++ /** @file
Copyright (c) 2007, Intel Corporation Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
All rights reserved. This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php 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, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
Edb.h **/
Abstract:
--*/
#ifndef _EFI_EDB_H_ #ifndef _EFI_EDB_H_
#define _EFI_EDB_H_ #define _EFI_EDB_H_
@ -30,15 +24,29 @@ Abstract:
#define EFI_DEBUG_BREAK 2 #define EFI_DEBUG_BREAK 2
#define EFI_DEBUG_CONTINUE 3 #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 EFI_STATUS
EfiDebuggerEntrypoint ( EfiDebuggerEntrypoint (
IN EFI_HANDLE ImageHandle, IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable 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 VOID
EFIAPI EFIAPI
EdbExceptionHandler ( EdbExceptionHandler (

View File

@ -1,7 +1,7 @@
/*++ /** @file
Copyright (c) 2007, Intel Corporation Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
All rights reserved. This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php 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, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdbCmdBranch.c **/
Abstract:
--*/
#include "Edb.h" #include "Edb.h"
@ -28,25 +22,19 @@ CHAR16 *mBranchTypeStr[] = {
L"(JMP8)", L"(JMP8)",
}; };
/**
Comvert Branch Type to string.
@param Type Branch Type
@retval String string of Branch Type.
**/
CHAR16 * CHAR16 *
EdbBranchTypeToStr ( EdbBranchTypeToStr (
IN EFI_DEBUGGER_BRANCH_TYPE Type IN EFI_DEBUGGER_BRANCH_TYPE Type
) )
/*++
Routine Description:
Comvert Branch Type to string
Arguments:
Type - Branch Type
Returns:
String
--*/
{ {
if (Type < 0 || Type >= EfiDebuggerBranchTypeEbcMax) { if (Type < 0 || Type >= EfiDebuggerBranchTypeEbcMax) {
return L"(Unknown Type)"; return L"(Unknown Type)";
@ -55,6 +43,18 @@ Returns:
return mBranchTypeStr [Type]; 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 EFI_DEBUG_STATUS
DebuggerCallStack ( DebuggerCallStack (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -62,24 +62,6 @@ DebuggerCallStack (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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; INTN Index;
UINTN SubIndex; UINTN SubIndex;
@ -256,6 +238,18 @@ Returns:
return EFI_DEBUG_CONTINUE; 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 EFI_DEBUG_STATUS
DebuggerInstructionBranch ( DebuggerInstructionBranch (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -263,24 +257,6 @@ DebuggerInstructionBranch (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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; UINTN Index;

View File

@ -1,7 +1,7 @@
/*++ /** @file
Copyright (c) 2007, Intel Corporation Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
All rights reserved. This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php 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, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 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 EFI_DEBUG_STATUS
DebuggerBreakOnCALL ( DebuggerBreakOnCALL (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -27,24 +34,6 @@ DebuggerBreakOnCALL (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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 // Check argument
@ -71,6 +60,19 @@ Returns:
return EFI_DEBUG_CONTINUE; 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 EFI_DEBUG_STATUS
DebuggerBreakOnCALLEX ( DebuggerBreakOnCALLEX (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -78,24 +80,6 @@ DebuggerBreakOnCALLEX (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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 // Check argument
@ -122,6 +106,19 @@ Returns:
return EFI_DEBUG_CONTINUE; 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 EFI_DEBUG_STATUS
DebuggerBreakOnRET ( DebuggerBreakOnRET (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -129,24 +126,6 @@ DebuggerBreakOnRET (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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 // Check argument
@ -173,6 +152,19 @@ Returns:
return EFI_DEBUG_CONTINUE; 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 EFI_DEBUG_STATUS
DebuggerBreakOnEntrypoint ( DebuggerBreakOnEntrypoint (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -180,24 +172,6 @@ DebuggerBreakOnEntrypoint (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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 // Check argument
@ -224,6 +198,21 @@ Returns:
return EFI_DEBUG_CONTINUE; return EFI_DEBUG_CONTINUE;
} }
/**
DebuggerCommand - BreakOnThunk.
@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 EFI_DEBUG_STATUS
DebuggerBreakOnThunk ( DebuggerBreakOnThunk (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -231,24 +220,6 @@ DebuggerBreakOnThunk (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext IN OUT EFI_SYSTEM_CONTEXT SystemContext
) )
/*++
Routine Description:
DebuggerCommand - BreakOnThunk
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 // Check argument
@ -275,6 +246,20 @@ Returns:
return EFI_DEBUG_CONTINUE; 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 EFI_DEBUG_STATUS
DebuggerBreakOnKey ( DebuggerBreakOnKey (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -282,24 +267,6 @@ DebuggerBreakOnKey (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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 // Check argument

View File

@ -1,7 +1,7 @@
/*++ /** @file
Copyright (c) 2007 - 2016, Intel Corporation Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
All rights reserved. This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php 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, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdbCmdBreakpoint.c **/
Abstract:
--*/
#include "Edb.h" #include "Edb.h"
/**
Check whether current IP is EBC BREAK3 instruction.
@param Address EBC IP address.
@retval TRUE Current IP is EBC BREAK3 instruction
@retval FALSE Current IP is not EBC BREAK3 instruction
**/
BOOLEAN BOOLEAN
IsEBCBREAK3 ( IsEBCBREAK3 (
IN UINTN Address 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) { if (GET_OPCODE(Address) != OPCODE_BREAK) {
return FALSE; 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 BOOLEAN
DebuggerBreakpointIsDuplicated ( DebuggerBreakpointIsDuplicated (
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN UINTN Address 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; UINTN Index;
@ -95,29 +77,23 @@ Returns:
return FALSE; 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 EFI_STATUS
DebuggerBreakpointAdd ( DebuggerBreakpointAdd (
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN UINTN Address 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 // Check duplicated breakpoint
@ -160,28 +136,22 @@ Returns:
return EFI_SUCCESS; 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 EFI_STATUS
DebuggerBreakpointDel ( DebuggerBreakpointDel (
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN UINTN Index 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; UINTN BpIndex;
@ -209,28 +179,22 @@ Returns:
return EFI_SUCCESS; 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 EFI_STATUS
DebuggerBreakpointDis ( DebuggerBreakpointDis (
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN UINTN Index 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) || if ((Index >= EFI_DEBUGGER_BREAKPOINT_MAX) ||
(Index >= DebuggerPrivate->DebuggerBreakpointCount)) { (Index >= DebuggerPrivate->DebuggerBreakpointCount)) {
@ -245,28 +209,22 @@ Returns:
return EFI_SUCCESS; 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 EFI_STATUS
DebuggerBreakpointEn ( DebuggerBreakpointEn (
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN UINTN Index 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) || if ((Index >= EFI_DEBUGGER_BREAKPOINT_MAX) ||
(Index >= DebuggerPrivate->DebuggerBreakpointCount)) { (Index >= DebuggerPrivate->DebuggerBreakpointCount)) {
@ -281,6 +239,18 @@ Returns:
return EFI_SUCCESS; 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 EFI_DEBUG_STATUS
DebuggerBreakpointList ( DebuggerBreakpointList (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -288,24 +258,6 @@ DebuggerBreakpointList (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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; UINTN Index;
@ -347,6 +299,18 @@ Returns:
return EFI_DEBUG_CONTINUE; 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 EFI_DEBUG_STATUS
DebuggerBreakpointSet ( DebuggerBreakpointSet (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -354,24 +318,6 @@ DebuggerBreakpointSet (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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; UINTN Address;
EFI_STATUS Status; EFI_STATUS Status;
@ -411,6 +357,18 @@ Returns:
return EFI_DEBUG_CONTINUE; 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 EFI_DEBUG_STATUS
DebuggerBreakpointClear ( DebuggerBreakpointClear (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -418,24 +376,6 @@ DebuggerBreakpointClear (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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; UINTN Index;
EFI_STATUS Status; EFI_STATUS Status;
@ -484,6 +424,18 @@ Returns:
return EFI_DEBUG_CONTINUE; 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 EFI_DEBUG_STATUS
DebuggerBreakpointDisable ( DebuggerBreakpointDisable (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -491,24 +443,6 @@ DebuggerBreakpointDisable (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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; UINTN Index;
EFI_STATUS Status; EFI_STATUS Status;
@ -552,6 +486,17 @@ Returns:
return EFI_DEBUG_CONTINUE; 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 EFI_DEBUG_STATUS
DebuggerBreakpointEnable ( DebuggerBreakpointEnable (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -559,24 +504,6 @@ DebuggerBreakpointEnable (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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; UINTN Index;
EFI_STATUS Status; EFI_STATUS Status;

View File

@ -1,7 +1,7 @@
/*++ /** @file
Copyright (c) 2007, Intel Corporation Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
All rights reserved. This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php 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, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdbCmdExtIo.c **/
Abstract:
--*/
#include "Edb.h" #include "Edb.h"
/**
DebuggerCommand - IB.
@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 EFI_DEBUG_STATUS
DebuggerExtIoIB ( DebuggerExtIoIB (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -27,24 +33,6 @@ DebuggerExtIoIB (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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"); EDBPrint (L"Unsupported\n");
// //
@ -53,6 +41,20 @@ Returns:
return EFI_DEBUG_CONTINUE; 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 EFI_DEBUG_STATUS
DebuggerExtIoIW ( DebuggerExtIoIW (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -60,24 +62,6 @@ DebuggerExtIoIW (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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"); EDBPrint (L"Unsupported\n");
// //
@ -86,6 +70,19 @@ Returns:
return EFI_DEBUG_CONTINUE; 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 EFI_DEBUG_STATUS
DebuggerExtIoID ( DebuggerExtIoID (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -93,24 +90,6 @@ DebuggerExtIoID (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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"); EDBPrint (L"Unsupported\n");
// //
@ -119,6 +98,18 @@ Returns:
return EFI_DEBUG_CONTINUE; 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 EFI_DEBUG_STATUS
DebuggerExtIoOB ( DebuggerExtIoOB (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -126,24 +117,6 @@ DebuggerExtIoOB (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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"); EDBPrint (L"Unsupported\n");
// //
@ -152,6 +125,19 @@ Returns:
return EFI_DEBUG_CONTINUE; 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 EFI_DEBUG_STATUS
DebuggerExtIoOW ( DebuggerExtIoOW (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -159,24 +145,6 @@ DebuggerExtIoOW (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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"); EDBPrint (L"Unsupported\n");
// //
@ -185,6 +153,19 @@ Returns:
return EFI_DEBUG_CONTINUE; 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 EFI_DEBUG_STATUS
DebuggerExtIoOD ( DebuggerExtIoOD (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -192,24 +173,6 @@ DebuggerExtIoOD (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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"); EDBPrint (L"Unsupported\n");
// //

View File

@ -1,7 +1,7 @@
/*++ /** @file
Copyright (c) 2007, Intel Corporation Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
All rights reserved. This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php 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, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdbCmdExtPci.c **/
Abstract:
--*/
#include "Edb.h" #include "Edb.h"
/**
DebuggerCommand - PCIL.
@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 EFI_DEBUG_STATUS
DebuggerExtPciPCIL ( DebuggerExtPciPCIL (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -27,24 +33,6 @@ DebuggerExtPciPCIL (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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"); EDBPrint (L"Unsupported\n");
// //
@ -53,6 +41,18 @@ Returns:
return EFI_DEBUG_CONTINUE; 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 EFI_DEBUG_STATUS
DebuggerExtPciPCID ( DebuggerExtPciPCID (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -60,24 +60,6 @@ DebuggerExtPciPCID (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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"); EDBPrint (L"Unsupported\n");
// //
@ -86,6 +68,18 @@ Returns:
return EFI_DEBUG_CONTINUE; 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 EFI_DEBUG_STATUS
DebuggerExtPciCFGB ( DebuggerExtPciCFGB (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -93,24 +87,6 @@ DebuggerExtPciCFGB (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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"); EDBPrint (L"Unsupported\n");
// //
@ -119,6 +95,19 @@ Returns:
return EFI_DEBUG_CONTINUE; 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 EFI_DEBUG_STATUS
DebuggerExtPciCFGW ( DebuggerExtPciCFGW (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -126,24 +115,6 @@ DebuggerExtPciCFGW (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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"); EDBPrint (L"Unsupported\n");
// //
@ -152,6 +123,18 @@ Returns:
return EFI_DEBUG_CONTINUE; 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 EFI_DEBUG_STATUS
DebuggerExtPciCFGD ( DebuggerExtPciCFGD (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -159,24 +142,6 @@ DebuggerExtPciCFGD (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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"); EDBPrint (L"Unsupported\n");
// //

View File

@ -1,7 +1,7 @@
/*++ /** @file
Copyright (c) 2007, Intel Corporation Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
All rights reserved. This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php 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, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 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 EFI_DEBUG_STATUS
DebuggerGo ( DebuggerGo (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -27,25 +35,6 @@ DebuggerGo (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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; UINTN Address;
CHAR16 *CommandStr; CHAR16 *CommandStr;

View File

@ -1,7 +1,7 @@
/*++ /** @file
Copyright (c) 2007, Intel Corporation Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
All rights reserved. This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php 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, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdbCmdHelp.c **/
Abstract:
--*/
#include "Edb.h" #include "Edb.h"
/**
DebuggerCommand - Help.
@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 EFI_DEBUG_STATUS
DebuggerHelp ( DebuggerHelp (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -27,24 +33,6 @@ DebuggerHelp (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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; UINTN Index;

View File

@ -1,7 +1,7 @@
/*++ /** @file
Copyright (c) 2007, Intel Corporation Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
All rights reserved. This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php 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, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 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 UINTN
EdbDisplayMemoryUnit ( EdbDisplayMemoryUnit (
IN UINTN Address, IN UINTN Address,
IN EDB_DATA_WIDTH Width 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; UINT8 Data8;
UINT16 Data16; UINT16 Data16;
@ -78,29 +67,21 @@ Returns:
return 0; return 0;
} }
/**
Display memory.
@param Address - Memory Address
@param Count - Memory Count
@param Width - Memory Width
**/
VOID VOID
EdbDisplayMemory ( EdbDisplayMemory (
IN UINTN Address, IN UINTN Address,
IN UINTN Count, IN UINTN Count,
IN EDB_DATA_WIDTH Width IN EDB_DATA_WIDTH Width
) )
/*++
Routine Description:
Display memory
Arguments:
Address - Memory Address
Count - Memory Count
Width - Memory Width
Returns:
None
--*/
{ {
UINTN LineNumber; UINTN LineNumber;
UINTN ByteNumber; UINTN ByteNumber;
@ -182,29 +163,21 @@ Returns:
return ; return ;
} }
/**
Entry memory.
@param Address - Memory Address
@param Value - Memory Value
@param Width - Memory Width
**/
VOID VOID
EdbEnterMemory ( EdbEnterMemory (
IN UINTN Address, IN UINTN Address,
IN VOID *Value, IN VOID *Value,
IN EDB_DATA_WIDTH Width IN EDB_DATA_WIDTH Width
) )
/*++
Routine Description:
Entry memory
Arguments:
Address - Memory Address
Value - Memory Value
Width - Memory Width
Returns:
None
--*/
{ {
switch (Width) { switch (Width) {
case EdbWidthUint8: case EdbWidthUint8:
@ -226,30 +199,24 @@ Returns:
return ; 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 EFI_STATUS
EdbGetMemoryAddressCount ( EdbGetMemoryAddressCount (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
IN UINTN *Address, IN UINTN *Address,
IN UINTN *Count 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; CHAR16 *CommandStr;
UINTN MemAddress; UINTN MemAddress;
@ -293,30 +260,24 @@ Returns:
return EFI_SUCCESS; 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 EFI_STATUS
EdbGetMemoryAddressValue ( EdbGetMemoryAddressValue (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
IN UINTN *Address, IN UINTN *Address,
IN UINT64 *Value 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; CHAR16 *CommandStr;
UINTN MemAddress; UINTN MemAddress;
@ -360,27 +321,21 @@ Returns:
return EFI_SUCCESS; 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 EFI_DEBUG_STATUS
DebuggerMemoryDisplay ( DebuggerMemoryDisplay (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
IN EDB_DATA_WIDTH Width 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; EFI_STATUS Status;
UINTN Address; UINTN Address;
@ -405,27 +360,21 @@ Returns:
return EFI_DEBUG_CONTINUE; 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 EFI_DEBUG_STATUS
DebuggerMemoryEnter ( DebuggerMemoryEnter (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
IN EDB_DATA_WIDTH Width 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; EFI_STATUS Status;
UINTN Address; UINTN Address;
@ -450,6 +399,18 @@ Returns:
return EFI_DEBUG_CONTINUE; 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 EFI_DEBUG_STATUS
DebuggerMemoryDB ( DebuggerMemoryDB (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -457,28 +418,22 @@ DebuggerMemoryDB (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext IN OUT EFI_SYSTEM_CONTEXT SystemContext
) )
/*++
Routine Description:
DebuggerCommand - DB
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 DebuggerMemoryDisplay (CommandArg, EdbWidthUint8); return DebuggerMemoryDisplay (CommandArg, EdbWidthUint8);
} }
/**
DebuggerCommand - DW.
@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 EFI_DEBUG_STATUS
DebuggerMemoryDW ( DebuggerMemoryDW (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -486,28 +441,22 @@ DebuggerMemoryDW (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext IN OUT EFI_SYSTEM_CONTEXT SystemContext
) )
/*++
Routine Description:
DebuggerCommand - DW
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 DebuggerMemoryDisplay (CommandArg, EdbWidthUint16); return DebuggerMemoryDisplay (CommandArg, EdbWidthUint16);
} }
/**
DebuggerCommand - DD.
@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 EFI_DEBUG_STATUS
DebuggerMemoryDD ( DebuggerMemoryDD (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -515,28 +464,22 @@ DebuggerMemoryDD (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext IN OUT EFI_SYSTEM_CONTEXT SystemContext
) )
/*++
Routine Description:
DebuggerCommand - DD
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 DebuggerMemoryDisplay (CommandArg, EdbWidthUint32); return DebuggerMemoryDisplay (CommandArg, EdbWidthUint32);
} }
/**
DebuggerCommand - DQ.
@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 EFI_DEBUG_STATUS
DebuggerMemoryDQ ( DebuggerMemoryDQ (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -544,28 +487,22 @@ DebuggerMemoryDQ (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext IN OUT EFI_SYSTEM_CONTEXT SystemContext
) )
/*++
Routine Description:
DebuggerCommand - DQ
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 DebuggerMemoryDisplay (CommandArg, EdbWidthUint64); return DebuggerMemoryDisplay (CommandArg, EdbWidthUint64);
} }
/**
DebuggerCommand - EB.
@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 EFI_DEBUG_STATUS
DebuggerMemoryEB ( DebuggerMemoryEB (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -573,28 +510,22 @@ DebuggerMemoryEB (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext IN OUT EFI_SYSTEM_CONTEXT SystemContext
) )
/*++
Routine Description:
DebuggerCommand - EB
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, EdbWidthUint8); return DebuggerMemoryEnter (CommandArg, EdbWidthUint8);
} }
/**
DebuggerCommand - EW.
@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 EFI_DEBUG_STATUS
DebuggerMemoryEW ( DebuggerMemoryEW (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -602,28 +533,22 @@ DebuggerMemoryEW (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext IN OUT EFI_SYSTEM_CONTEXT SystemContext
) )
/*++
Routine Description:
DebuggerCommand - EW
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, EdbWidthUint16); return DebuggerMemoryEnter (CommandArg, EdbWidthUint16);
} }
/**
DebuggerCommand - ED.
@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 EFI_DEBUG_STATUS
DebuggerMemoryED ( DebuggerMemoryED (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -631,28 +556,22 @@ DebuggerMemoryED (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext IN OUT EFI_SYSTEM_CONTEXT SystemContext
) )
/*++
Routine Description:
DebuggerCommand - ED
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, EdbWidthUint32); return DebuggerMemoryEnter (CommandArg, EdbWidthUint32);
} }
/**
DebuggerCommand - EQ.
@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 EFI_DEBUG_STATUS
DebuggerMemoryEQ ( DebuggerMemoryEQ (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -660,24 +579,6 @@ DebuggerMemoryEQ (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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); return DebuggerMemoryEnter (CommandArg, EdbWidthUint64);
} }

View File

@ -1,7 +1,7 @@
/*++ /** @file
Copyright (c) 2007, Intel Corporation Copyright (c) 2007, Intel Corporation.All rights reserved.<BR>
All rights reserved. This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php http://opensource.org/licenses/bsd-license.php
@ -16,10 +16,22 @@ Module Name:
Abstract: Abstract:
--*/ **/
#include "Edb.h" #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 EFI_DEBUG_STATUS
DebuggerQuit ( DebuggerQuit (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -27,24 +39,6 @@ DebuggerQuit (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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; return EFI_DEBUG_RETURN;
} }

View File

@ -1,7 +1,7 @@
/*++ /** @file
Copyright (c) 2007, Intel Corporation Copyright (c) 2007, Intel Corporation.All rights reserved.<BR>
All rights reserved. This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php 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, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdbCmdRegister.c **/
Abstract:
--*/
#include "Edb.h" #include "Edb.h"
/**
DebuggerCommand - Register.
@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 EFI_DEBUG_STATUS
DebuggerRegister ( DebuggerRegister (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -27,24 +33,6 @@ DebuggerRegister (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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 *RegName;
CHAR16 *RegValStr; CHAR16 *RegValStr;

View File

@ -1,7 +1,7 @@
/*++ /** @file
Copyright (c) 2007, Intel Corporation Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
All rights reserved. This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php 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, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdbCmdScope.c **/
Abstract:
--*/
#include "Edb.h" #include "Edb.h"
/**
DebuggerCommand - Scope.
@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 EFI_DEBUG_STATUS
DebuggerScope ( DebuggerScope (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -27,24 +33,6 @@ DebuggerScope (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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; EFI_STATUS Status;
UINTN Address; UINTN Address;
@ -79,6 +67,18 @@ Returns:
return EFI_DEBUG_CONTINUE; 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 EFI_DEBUG_STATUS
DebuggerList ( DebuggerList (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -86,24 +86,6 @@ DebuggerList (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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) { if (CommandArg == NULL) {
EdbShowDisasm (DebuggerPrivate, SystemContext); EdbShowDisasm (DebuggerPrivate, SystemContext);

View File

@ -1,7 +1,7 @@
/*++ /** @file
Copyright (c) 2007, Intel Corporation Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
All rights reserved. This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php 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, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdbCmdStep.c **/
Abstract:
--*/
#include "Edb.h" #include "Edb.h"
/**
Check whether current IP is EBC CALL instruction (NOTE: CALLEX is exclusive)
@param Address - EBC IP address.
@retval TRUE - Current IP is EBC CALL instruction
@retval FALSE - Current IP is not EBC CALL instruction
**/
BOOLEAN BOOLEAN
IsEBCCALL ( IsEBCCALL (
IN UINTN Address 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) { if (GET_OPCODE(Address) != OPCODE_CALL) {
return FALSE; return FALSE;
@ -52,26 +40,20 @@ Returns:
} }
} }
/**
Check whether current IP is EBC RET instruction.
@param Address - EBC IP address.
@retval TRUE - Current IP is EBC RET instruction
@retval FALSE - Current IP is not EBC RET instruction
**/
BOOLEAN BOOLEAN
IsEBCRET ( IsEBCRET (
IN UINTN Address IN UINTN Address
) )
/*++
Routine Description:
Check whether current IP is EBC RET instruction
Arguments:
Address - EBC IP address.
Returns:
TRUE - Current IP is EBC RET instruction
FALSE - Current IP is not EBC RET instruction
--*/
{ {
if (GET_OPCODE(Address) != OPCODE_RET) { if (GET_OPCODE(Address) != OPCODE_RET) {
return FALSE; 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 EFI_DEBUG_STATUS
DebuggerStepInto ( DebuggerStepInto (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -91,30 +85,24 @@ DebuggerStepInto (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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; SystemContext.SystemContextEbc->Flags |= VMFLAGS_STEP;
return EFI_DEBUG_BREAK; 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 EFI_DEBUG_STATUS
DebuggerStepOver ( DebuggerStepOver (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -122,24 +110,6 @@ DebuggerStepOver (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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)) { if (IsEBCCALL((UINTN)SystemContext.SystemContextEbc->Ip)) {
// //
@ -156,6 +126,18 @@ Returns:
return EFI_DEBUG_BREAK; 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 EFI_DEBUG_STATUS
DebuggerStepOut ( DebuggerStepOut (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -163,24 +145,6 @@ DebuggerStepOut (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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)) { if (IsEBCRET((UINTN)SystemContext.SystemContextEbc->Ip)) {
// //

View File

@ -1,7 +1,7 @@
/*++ /** @file
Copyright (c) 2007 - 2016, Intel Corporation Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
All rights reserved. This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php 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, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdbCmdSymbol.c **/
Abstract:
--*/
#include "Edb.h" #include "Edb.h"
/**
Get file name from full path.
@param FullPath - full file path
@return file name
**/
CHAR16 * CHAR16 *
GetFileNameFromFullPath ( GetFileNameFromFullPath (
IN CHAR16 *FullPath IN CHAR16 *FullPath
) )
/*++
Routine Description:
Get file name from full path
Arguments:
FullPath - full file path
Returns:
file name
--*/
{ {
CHAR16 *FileName; CHAR16 *FileName;
CHAR16 *TempFileName; CHAR16 *TempFileName;
@ -55,25 +43,19 @@ Returns:
return FileName; return FileName;
} }
/**
Get dir name from full path.
@param FullPath - full file path
@return dir name
**/
CHAR16 * CHAR16 *
GetDirNameFromFullPath ( GetDirNameFromFullPath (
IN CHAR16 *FullPath IN CHAR16 *FullPath
) )
/*++
Routine Description:
Get dir name from full path
Arguments:
FullPath - full file path
Returns:
dir name
--*/
{ {
CHAR16 *FileName; CHAR16 *FileName;
@ -86,29 +68,23 @@ Returns:
return L""; 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 * CHAR16 *
ConstructFullPath ( ConstructFullPath (
IN CHAR16 *DirPath, IN CHAR16 *DirPath,
IN CHAR16 *FilePath, IN CHAR16 *FilePath,
IN UINTN Size 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; UINTN DirPathSize;
@ -128,25 +104,19 @@ CHAR16 *mSymbolTypeStr[] = {
L"(SV)", L"(SV)",
}; };
/**
Comvert Symbol Type to string.
@param Type - Symbol Type
@return String
**/
CHAR16 * CHAR16 *
EdbSymbolTypeToStr ( EdbSymbolTypeToStr (
IN EFI_DEBUGGER_SYMBOL_TYPE Type IN EFI_DEBUGGER_SYMBOL_TYPE Type
) )
/*++
Routine Description:
Comvert Symbol Type to string
Arguments:
Type - Symbol Type
Returns:
String
--*/
{ {
if (Type < 0 || Type >= EfiDebuggerSymbolTypeMax) { if (Type < 0 || Type >= EfiDebuggerSymbolTypeMax) {
return L"(?)"; return L"(?)";
@ -155,27 +125,21 @@ Returns:
return mSymbolTypeStr [Type]; 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 EFI_DEBUG_STATUS
DebuggerDisplaySymbolAccrodingToAddress ( DebuggerDisplaySymbolAccrodingToAddress (
IN UINTN Address, IN UINTN Address,
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate 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_OBJECT *Object;
EFI_DEBUGGER_SYMBOL_ENTRY *Entry; EFI_DEBUGGER_SYMBOL_ENTRY *Entry;
@ -224,29 +188,23 @@ Returns:
return EFI_DEBUG_CONTINUE; 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 EFI_DEBUG_STATUS
DebuggerDisplaySymbolAccrodingToName ( DebuggerDisplaySymbolAccrodingToName (
IN CHAR16 *SymbolFileName, IN CHAR16 *SymbolFileName,
IN CHAR16 *SymbolName, IN CHAR16 *SymbolName,
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate 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 Index;
UINTN SubIndex; UINTN SubIndex;
@ -338,6 +296,18 @@ Returns:
return EFI_DEBUG_CONTINUE; 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 EFI_DEBUG_STATUS
DebuggerListSymbol ( DebuggerListSymbol (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -345,24 +315,6 @@ DebuggerListSymbol (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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 *SymbolFileName;
CHAR16 *SymbolName; CHAR16 *SymbolName;
@ -425,6 +377,18 @@ Returns:
return DebuggerDisplaySymbolAccrodingToName (SymbolFileName, SymbolName, DebuggerPrivate); 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 EFI_DEBUG_STATUS
DebuggerLoadSymbol ( DebuggerLoadSymbol (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -432,24 +396,6 @@ DebuggerLoadSymbol (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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; UINTN BufferSize;
VOID *Buffer; VOID *Buffer;
@ -590,6 +536,18 @@ Returns:
return EFI_DEBUG_CONTINUE; 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 EFI_DEBUG_STATUS
DebuggerUnloadSymbol ( DebuggerUnloadSymbol (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -597,24 +555,6 @@ DebuggerUnloadSymbol (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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; EFI_STATUS Status;
CHAR16 *FileName; CHAR16 *FileName;
@ -696,6 +636,18 @@ Returns:
return EFI_DEBUG_CONTINUE; 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 EFI_DEBUG_STATUS
DebuggerDisplaySymbol ( DebuggerDisplaySymbol (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -703,24 +655,6 @@ DebuggerDisplaySymbol (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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) { if (CommandArg == NULL) {
DebuggerPrivate->DebuggerSymbolContext.DisplaySymbol = !DebuggerPrivate->DebuggerSymbolContext.DisplaySymbol; DebuggerPrivate->DebuggerSymbolContext.DisplaySymbol = !DebuggerPrivate->DebuggerSymbolContext.DisplaySymbol;
@ -738,6 +672,18 @@ Returns:
return EFI_DEBUG_CONTINUE; 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 EFI_DEBUG_STATUS
DebuggerLoadCode ( DebuggerLoadCode (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -745,24 +691,6 @@ DebuggerLoadCode (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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; UINTN BufferSize;
VOID *Buffer; VOID *Buffer;
@ -838,6 +766,18 @@ Returns:
return EFI_DEBUG_CONTINUE; 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 EFI_DEBUG_STATUS
DebuggerUnloadCode ( DebuggerUnloadCode (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -845,24 +785,6 @@ DebuggerUnloadCode (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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 *CommandArg2;
CHAR16 *FileName; CHAR16 *FileName;
@ -909,6 +831,18 @@ Returns:
return EFI_DEBUG_CONTINUE; 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 EFI_DEBUG_STATUS
DebuggerDisplayCode ( DebuggerDisplayCode (
IN CHAR16 *CommandArg, IN CHAR16 *CommandArg,
@ -916,24 +850,6 @@ DebuggerDisplayCode (
IN EFI_EXCEPTION_TYPE ExceptionType, IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext 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) { if (CommandArg == NULL) {
DebuggerPrivate->DebuggerSymbolContext.DisplayCodeOnly = !DebuggerPrivate->DebuggerSymbolContext.DisplayCodeOnly; DebuggerPrivate->DebuggerSymbolContext.DisplayCodeOnly = !DebuggerPrivate->DebuggerSymbolContext.DisplayCodeOnly;

View File

@ -1,7 +1,7 @@
/*++ /** @file
Copyright (c) 2007, Intel Corporation Copyright (c) 2007, Intel Corporation All rights reserved.<BR>
All rights reserved. This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php 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, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdbCommand.c **/
Abstract:
--*/
#include "Edb.h" #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 EFI_DEBUGGER_COMMAND
MatchDebuggerCommand ( MatchDebuggerCommand (
IN CHAR16 *CommandName, IN CHAR16 *CommandName,
IN CHAR16 **CommandArg 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; UINTN Index;
CHAR16 *Temp; CHAR16 *Temp;
@ -637,26 +625,20 @@ Returns:
return NULL; return NULL;
} }
/**
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 * CHAR16 *
GetCommandNameByKey ( GetCommandNameByKey (
IN EFI_INPUT_KEY CommandKey IN EFI_INPUT_KEY CommandKey
) )
/*++
Routine Description:
Find the command name according to the function key
Arguments:
CommandKey - Command Function Key
Returns:
Not NULL - The DebuggerName is found successfully
NULL - not found
--*/
{ {
UINTN Index; UINTN Index;

View File

@ -1,7 +1,7 @@
/*++ /** @file
Copyright (c) 2007, Intel Corporation Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
All rights reserved. This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php 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, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdbCommand.h **/
Abstract:
--*/
#ifndef _EFI_EDB_COMMAND_H_ #ifndef _EFI_EDB_COMMAND_H_
#define _EFI_EDB_COMMAND_H_ #define _EFI_EDB_COMMAND_H_
@ -29,12 +23,33 @@ typedef enum {
EdbWidthMax EdbWidthMax
} EDB_DATA_WIDTH; } 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 EFI_DEBUGGER_COMMAND
MatchDebuggerCommand ( MatchDebuggerCommand (
IN CHAR16 *CommandName, IN CHAR16 *CommandName,
IN CHAR16 **CommandArg 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 * CHAR16 *
GetCommandNameByKey ( GetCommandNameByKey (
IN EFI_INPUT_KEY CommandKey IN EFI_INPUT_KEY CommandKey

View File

@ -1,7 +1,7 @@
/*++ /** @file
Copyright (c) 2007, Intel Corporation Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
All rights reserved. This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php 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, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: **/
EdbCommon.h
Abstract:
--*/
#ifndef _EFI_EDB_COMMON_H_ #ifndef _EFI_EDB_COMMON_H_
#define _EFI_EDB_COMMON_H_ #define _EFI_EDB_COMMON_H_

View File

@ -1,7 +1,7 @@
/*++ /** @file
Copyright (c) 2007, Intel Corporation Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
All rights reserved. This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php 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, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdbDisasm.c **/
Abstract:
--*/
#include "Edb.h" #include "Edb.h"
@ -117,29 +111,23 @@ EDB_DISASM_INSTRUCTION mEdbDisasmInstructionTable[] = {
EdbDisasmMOVREL, // opcode 0x39 MOVREL 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 UINTN
EdbDisasmBREAK ( EdbDisasmBREAK (
IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_PHYSICAL_ADDRESS InstructionAddress,
IN EFI_SYSTEM_CONTEXT SystemContext, IN EFI_SYSTEM_CONTEXT SystemContext,
OUT CHAR16 **DisasmString 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); ASSERT (GET_OPCODE(InstructionAddress) == OPCODE_BREAK);
@ -164,29 +152,23 @@ Returns:
extern CONST UINT8 mJMPLen[]; 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 UINTN
EdbDisasmJMP ( EdbDisasmJMP (
IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_PHYSICAL_ADDRESS InstructionAddress,
IN EFI_SYSTEM_CONTEXT SystemContext, IN EFI_SYSTEM_CONTEXT SystemContext,
OUT CHAR16 **DisasmString 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 Modifiers;
UINT8 Operands; UINT8 Operands;
@ -248,29 +230,23 @@ Returns:
return Size; return Size;
} }
/**
Disasm instruction - JMP8.
@param InstructionAddress - The instruction address
@param SystemContext - EBC system context.
@param DisasmString - The instruction string
@return Instruction length
**/
UINTN UINTN
EdbDisasmJMP8 ( EdbDisasmJMP8 (
IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_PHYSICAL_ADDRESS InstructionAddress,
IN EFI_SYSTEM_CONTEXT SystemContext, IN EFI_SYSTEM_CONTEXT SystemContext,
OUT CHAR16 **DisasmString 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; UINT8 Modifiers;
@ -300,29 +276,23 @@ Returns:
return 2; return 2;
} }
/**
Disasm instruction - CALL.
@param InstructionAddress - The instruction address
@param SystemContext - EBC system context.
@param DisasmString - The instruction string
@return Instruction length
**/
UINTN UINTN
EdbDisasmCALL ( EdbDisasmCALL (
IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_PHYSICAL_ADDRESS InstructionAddress,
IN EFI_SYSTEM_CONTEXT SystemContext, IN EFI_SYSTEM_CONTEXT SystemContext,
OUT CHAR16 **DisasmString 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 Modifiers;
UINT8 Operands; UINT8 Operands;
@ -410,29 +380,23 @@ Returns:
return Size; return Size;
} }
/**
Disasm instruction - RET.
@param InstructionAddress - The instruction address
@param SystemContext - EBC system context.
@param DisasmString - The instruction string
@return Instruction length
**/
UINTN UINTN
EdbDisasmRET ( EdbDisasmRET (
IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_PHYSICAL_ADDRESS InstructionAddress,
IN EFI_SYSTEM_CONTEXT SystemContext, IN EFI_SYSTEM_CONTEXT SystemContext,
OUT CHAR16 **DisasmString 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); ASSERT (GET_OPCODE(InstructionAddress) == OPCODE_RET);
@ -454,29 +418,23 @@ Returns:
return 2; return 2;
} }
/**
Disasm instruction - CMP.
@param InstructionAddress - The instruction address
@param SystemContext - EBC system context.
@param DisasmString - The instruction string
@return Instruction length
**/
UINTN UINTN
EdbDisasmCMP ( EdbDisasmCMP (
IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_PHYSICAL_ADDRESS InstructionAddress,
IN EFI_SYSTEM_CONTEXT SystemContext, IN EFI_SYSTEM_CONTEXT SystemContext,
OUT CHAR16 **DisasmString 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 Opcode;
UINT8 Modifiers; UINT8 Modifiers;
@ -552,29 +510,23 @@ Returns:
return Size; 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 UINTN
EdbDisasmUnsignedDataManip ( EdbDisasmUnsignedDataManip (
IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_PHYSICAL_ADDRESS InstructionAddress,
IN EFI_SYSTEM_CONTEXT SystemContext, IN EFI_SYSTEM_CONTEXT SystemContext,
OUT CHAR16 **DisasmString 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 Modifiers;
UINT8 Opcode; UINT8 Opcode;
@ -676,29 +628,23 @@ Returns:
return Size; 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 UINTN
EdbDisasmSignedDataManip ( EdbDisasmSignedDataManip (
IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_PHYSICAL_ADDRESS InstructionAddress,
IN EFI_SYSTEM_CONTEXT SystemContext, IN EFI_SYSTEM_CONTEXT SystemContext,
OUT CHAR16 **DisasmString 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 Modifiers;
UINT8 Opcode; UINT8 Opcode;
@ -780,29 +726,23 @@ Returns:
return Size; return Size;
} }
/**
Disasm instruction - MOVxx.
@param InstructionAddress - The instruction address
@param SystemContext - EBC system context.
@param DisasmString - The instruction string
@return Instruction length
**/
UINTN UINTN
EdbDisasmMOVxx ( EdbDisasmMOVxx (
IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_PHYSICAL_ADDRESS InstructionAddress,
IN EFI_SYSTEM_CONTEXT SystemContext, IN EFI_SYSTEM_CONTEXT SystemContext,
OUT CHAR16 **DisasmString 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 Modifiers;
UINT8 Opcode; UINT8 Opcode;
@ -939,29 +879,23 @@ Returns:
return Size; return Size;
} }
/**
Disasm instruction - MOVsnw.
@param InstructionAddress - The instruction address
@param SystemContext - EBC system context.
@param DisasmString - The instruction string
@return Instruction length
**/
UINTN UINTN
EdbDisasmMOVsnw ( EdbDisasmMOVsnw (
IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_PHYSICAL_ADDRESS InstructionAddress,
IN EFI_SYSTEM_CONTEXT SystemContext, IN EFI_SYSTEM_CONTEXT SystemContext,
OUT CHAR16 **DisasmString 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 Modifiers;
UINT8 Operands; UINT8 Operands;
@ -1015,29 +949,23 @@ Returns:
return Size; return Size;
} }
/**
Disasm instruction - MOVsnd.
@param InstructionAddress - The instruction address
@param SystemContext - EBC system context.
@param DisasmString - The instruction string
@return Instruction length
**/
UINTN UINTN
EdbDisasmMOVsnd ( EdbDisasmMOVsnd (
IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_PHYSICAL_ADDRESS InstructionAddress,
IN EFI_SYSTEM_CONTEXT SystemContext, IN EFI_SYSTEM_CONTEXT SystemContext,
OUT CHAR16 **DisasmString 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 Modifiers;
UINT8 Operands; UINT8 Operands;
@ -1091,29 +1019,23 @@ Returns:
return Size; return Size;
} }
/**
Disasm instruction - LOADSP.
@param InstructionAddress - The instruction address
@param SystemContext - EBC system context.
@param DisasmString - The instruction string
@return Instruction length
**/
UINTN UINTN
EdbDisasmLOADSP ( EdbDisasmLOADSP (
IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_PHYSICAL_ADDRESS InstructionAddress,
IN EFI_SYSTEM_CONTEXT SystemContext, IN EFI_SYSTEM_CONTEXT SystemContext,
OUT CHAR16 **DisasmString 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; UINT8 Operands;
@ -1139,29 +1061,23 @@ Returns:
return 2; return 2;
} }
/**
Disasm instruction - STORESP.
@param InstructionAddress - The instruction address
@param SystemContext - EBC system context.
@param DisasmString - The instruction string
@return Instruction length
**/
UINTN UINTN
EdbDisasmSTORESP ( EdbDisasmSTORESP (
IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_PHYSICAL_ADDRESS InstructionAddress,
IN EFI_SYSTEM_CONTEXT SystemContext, IN EFI_SYSTEM_CONTEXT SystemContext,
OUT CHAR16 **DisasmString 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; UINT8 Operands;
@ -1187,29 +1103,24 @@ Returns:
return 2; return 2;
} }
/**
Disasm instruction - PUSH.
@param InstructionAddress - The instruction address
@param SystemContext - EBC system context.
@param DisasmString - The instruction string
@return Instruction length
**/
UINTN UINTN
EdbDisasmPUSH ( EdbDisasmPUSH (
IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_PHYSICAL_ADDRESS InstructionAddress,
IN EFI_SYSTEM_CONTEXT SystemContext, IN EFI_SYSTEM_CONTEXT SystemContext,
OUT CHAR16 **DisasmString 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 Modifiers;
UINT8 Operands; UINT8 Operands;
@ -1257,29 +1168,23 @@ Returns:
return Size; return Size;
} }
/**
Disasm instruction - POP.
@param InstructionAddress - The instruction address
@param SystemContext - EBC system context.
@param DisasmString - The instruction string
@return Instruction length
**/
UINTN UINTN
EdbDisasmPOP ( EdbDisasmPOP (
IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_PHYSICAL_ADDRESS InstructionAddress,
IN EFI_SYSTEM_CONTEXT SystemContext, IN EFI_SYSTEM_CONTEXT SystemContext,
OUT CHAR16 **DisasmString 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 Modifiers;
UINT8 Operands; UINT8 Operands;
@ -1327,29 +1232,23 @@ Returns:
return Size; return Size;
} }
/**
Disasm instruction - CMPI.
@param InstructionAddress - The instruction address
@param SystemContext - EBC system context.
@param DisasmString - The instruction string
@return Instruction length
**/
UINTN UINTN
EdbDisasmCMPI ( EdbDisasmCMPI (
IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_PHYSICAL_ADDRESS InstructionAddress,
IN EFI_SYSTEM_CONTEXT SystemContext, IN EFI_SYSTEM_CONTEXT SystemContext,
OUT CHAR16 **DisasmString 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 Modifiers;
UINT8 Opcode; UINT8 Opcode;
@ -1444,29 +1343,23 @@ Returns:
return Size; return Size;
} }
/**
Disasm instruction - PUSHn.
@param InstructionAddress - The instruction address
@param SystemContext - EBC system context.
@param DisasmString - The instruction string
@return Instruction length
**/
UINTN UINTN
EdbDisasmPUSHn ( EdbDisasmPUSHn (
IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_PHYSICAL_ADDRESS InstructionAddress,
IN EFI_SYSTEM_CONTEXT SystemContext, IN EFI_SYSTEM_CONTEXT SystemContext,
OUT CHAR16 **DisasmString 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 Modifiers;
UINT8 Operands; UINT8 Operands;
@ -1509,29 +1402,23 @@ Returns:
return Size; return Size;
} }
/**
Disasm instruction - POPn.
@param InstructionAddress - The instruction address
@param SystemContext - EBC system context.
@param DisasmString - The instruction string
@return Instruction length
**/
UINTN UINTN
EdbDisasmPOPn ( EdbDisasmPOPn (
IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_PHYSICAL_ADDRESS InstructionAddress,
IN EFI_SYSTEM_CONTEXT SystemContext, IN EFI_SYSTEM_CONTEXT SystemContext,
OUT CHAR16 **DisasmString 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 Modifiers;
UINT8 Operands; UINT8 Operands;
@ -1574,29 +1461,23 @@ Returns:
return Size; return Size;
} }
/**
Disasm instruction - MOVI.
@param InstructionAddress - The instruction address
@param SystemContext - EBC system context.
@param DisasmString - The instruction string
@return Instruction length
**/
UINTN UINTN
EdbDisasmMOVI ( EdbDisasmMOVI (
IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_PHYSICAL_ADDRESS InstructionAddress,
IN EFI_SYSTEM_CONTEXT SystemContext, IN EFI_SYSTEM_CONTEXT SystemContext,
OUT CHAR16 **DisasmString 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 Modifiers;
UINT8 Operands; UINT8 Operands;
@ -1688,29 +1569,23 @@ Returns:
return Size; return Size;
} }
/**
Disasm instruction - MOVIn.
@param InstructionAddress - The instruction address
@param SystemContext - EBC system context.
@param DisasmString - The instruction string
@return Instruction length
**/
UINTN UINTN
EdbDisasmMOVIn ( EdbDisasmMOVIn (
IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_PHYSICAL_ADDRESS InstructionAddress,
IN EFI_SYSTEM_CONTEXT SystemContext, IN EFI_SYSTEM_CONTEXT SystemContext,
OUT CHAR16 **DisasmString 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 Modifiers;
UINT8 Operands; UINT8 Operands;
@ -1788,29 +1663,23 @@ Returns:
return Size; return Size;
} }
/**
Disasm instruction - MOVREL.
@param InstructionAddress - The instruction address
@param SystemContext - EBC system context.
@param DisasmString - The instruction string
@return Instruction length
**/
UINTN UINTN
EdbDisasmMOVREL ( EdbDisasmMOVREL (
IN EFI_PHYSICAL_ADDRESS InstructionAddress, IN EFI_PHYSICAL_ADDRESS InstructionAddress,
IN EFI_SYSTEM_CONTEXT SystemContext, IN EFI_SYSTEM_CONTEXT SystemContext,
OUT CHAR16 **DisasmString 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 Modifiers;
UINT8 Operands; UINT8 Operands;

View File

@ -1,7 +1,7 @@
/*++ /** @file
Copyright (c) 2007, Intel Corporation Copyright (c) 2007, Intel Corporation All rights reserved.<BR>
All rights reserved. This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php 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, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdbDisasm.h **/
Abstract:
--*/
#ifndef _EFI_EDB_DISASM_H_ #ifndef _EFI_EDB_DISASM_H_
#define _EFI_EDB_DISASM_H_ #define _EFI_EDB_DISASM_H_

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/*++ /** @file
Copyright (c) 2007, Intel Corporation Copyright (c) 2007, Intel Corporation All rights reserved.<BR>
All rights reserved. This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php 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, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdbDisasmSupport.h **/
Abstract:
--*/
#ifndef _EFI_EDB_DISASM_SUPPORT_H_ #ifndef _EFI_EDB_DISASM_SUPPORT_H_
#define _EFI_EDB_DISASM_SUPPORT_H_ #define _EFI_EDB_DISASM_SUPPORT_H_

View File

@ -1,7 +1,7 @@
/*++ /** @file
Copyright (c) 2007, Intel Corporation Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
All rights reserved. This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php 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, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdbHook.c **/
Abstract:
--*/
#include "Edb.h" #include "Edb.h"
// /**
// Hook support function
// Check the Hook flag, and trigger exception if match.
@param VmPtr - EbcDebuggerCheckHookFlag
@param Flag - Feature flag
**/
VOID VOID
EbcDebuggerCheckHookFlag ( EbcDebuggerCheckHookFlag (
IN VM_CONTEXT *VmPtr, IN VM_CONTEXT *VmPtr,
IN UINT32 Flag 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) { if ((mDebuggerPrivate.FeatureFlags & Flag) == Flag) {
mDebuggerPrivate.StatusFlags = Flag; mDebuggerPrivate.StatusFlags = Flag;
@ -55,26 +39,19 @@ Returns:
return ; return ;
} }
/**
It will record soruce address for Callstack entry.
@param SourceEntry - Source address
@param Type - Branch type
**/
VOID VOID
EbcDebuggerPushCallstackSource ( EbcDebuggerPushCallstackSource (
IN UINT64 SourceEntry, IN UINT64 SourceEntry,
IN EFI_DEBUGGER_BRANCH_TYPE Type 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) { if (mDebuggerPrivate.CallStackEntryCount > EFI_DEBUGGER_CALLSTACK_MAX) {
ASSERT (FALSE); ASSERT (FALSE);
@ -93,26 +70,19 @@ Returns:
return ; return ;
} }
/**
It will record parameter for Callstack entry.
@param ParameterAddress - The address for the parameter
@param Type - Branch type
**/
VOID VOID
EbcDebuggerPushCallstackParameter ( EbcDebuggerPushCallstackParameter (
IN UINT64 ParameterAddress, IN UINT64 ParameterAddress,
IN EFI_DEBUGGER_BRANCH_TYPE Type 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) { if (mDebuggerPrivate.CallStackEntryCount > EFI_DEBUGGER_CALLSTACK_MAX) {
ASSERT (FALSE); ASSERT (FALSE);
@ -135,26 +105,19 @@ Returns:
return ; return ;
} }
/**
It will record source address for callstack entry.
@param DestEntry - Source address
@param Type - Branch type
**/
VOID VOID
EbcDebuggerPushCallstackDest ( EbcDebuggerPushCallstackDest (
IN UINT64 DestEntry, IN UINT64 DestEntry,
IN EFI_DEBUGGER_BRANCH_TYPE Type 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; UINTN Index;
@ -180,24 +143,15 @@ Returns:
return ; return ;
} }
/**
It will throw the newest Callstack entry.
**/
VOID VOID
EbcDebuggerPopCallstack ( EbcDebuggerPopCallstack (
VOID VOID
) )
/*++
Routine Description:
It will throw the newest Callstack entry.
Arguments:
None
Returns:
None
--*/
{ {
if ((mDebuggerPrivate.CallStackEntryCount > 0) && if ((mDebuggerPrivate.CallStackEntryCount > 0) &&
(mDebuggerPrivate.CallStackEntryCount <= EFI_DEBUGGER_CALLSTACK_MAX)) { (mDebuggerPrivate.CallStackEntryCount <= EFI_DEBUGGER_CALLSTACK_MAX)) {
@ -219,26 +173,19 @@ Returns:
return ; return ;
} }
/**
It will record source address for trace entry.
@param SourceEntry - Source address
@param Type - Branch type
**/
VOID VOID
EbcDebuggerPushTraceSourceEntry ( EbcDebuggerPushTraceSourceEntry (
IN UINT64 SourceEntry, IN UINT64 SourceEntry,
IN EFI_DEBUGGER_BRANCH_TYPE Type 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) { if (mDebuggerPrivate.TraceEntryCount > EFI_DEBUGGER_TRACE_MAX) {
ASSERT (FALSE); ASSERT (FALSE);
@ -257,26 +204,19 @@ Returns:
return ; return ;
} }
/**
It will record destination address for trace entry.
@param DestEntry - Destination address
@param Type - Branch type
**/
VOID VOID
EbcDebuggerPushTraceDestEntry ( EbcDebuggerPushTraceDestEntry (
IN UINT64 DestEntry, IN UINT64 DestEntry,
IN EFI_DEBUGGER_BRANCH_TYPE Type 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; UINTN Index;
@ -302,28 +242,21 @@ Returns:
return ; 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 VOID
EbcDebuggerPushStepEntry ( EbcDebuggerPushStepEntry (
IN UINT64 Entry, IN UINT64 Entry,
IN UINT64 FramePtr, IN UINT64 FramePtr,
IN UINT32 Flag 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 // Check StepOver
@ -364,30 +297,20 @@ EbcDebuggerBreakEventFunc (
} }
} }
// /**
// Hook function implementation
// The hook in InitializeEbcDriver.
It will init the EbcDebuggerPrivate data structure.
@param Handle - The EbcDebugProtocol handle.
@param EbcDebugProtocol - The EbcDebugProtocol interface.
**/
VOID VOID
EbcDebuggerHookInit ( EbcDebuggerHookInit (
IN EFI_HANDLE Handle, IN EFI_HANDLE Handle,
IN EFI_DEBUG_SUPPORT_PROTOCOL *EbcDebugProtocol 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.
Returns:
None
--*/
{ {
EFI_STATUS Status; EFI_STATUS Status;
UINTN Index; UINTN Index;
@ -479,25 +402,16 @@ Returns:
return ; return ;
} }
VOID /**
EbcDebuggerHookUnload (
VOID
)
/*++
Routine Description:
The hook in UnloadImage for EBC Interpreter. The hook in UnloadImage for EBC Interpreter.
It clean up the environment. It clean up the environment.
Arguments: **/
VOID
None EbcDebuggerHookUnload (
VOID
Returns: )
None
--*/
{ {
UINTN Index; UINTN Index;
UINTN SubIndex; UINTN SubIndex;
@ -545,49 +459,37 @@ Returns:
return ; return ;
} }
VOID /**
EbcDebuggerHookEbcUnloadImage (
IN EFI_HANDLE Handle
)
/*++
Routine Description:
The hook in EbcUnloadImage. The hook in EbcUnloadImage.
Currently do nothing here. Currently do nothing here.
Arguments: @param Handle - The EbcImage handle.
Handle - The EbcImage handle. **/
Returns: VOID
None EbcDebuggerHookEbcUnloadImage (
IN EFI_HANDLE Handle
--*/ )
{ {
return ; return ;
} }
VOID /**
EbcDebuggerHookExecuteEbcImageEntryPoint (
IN VM_CONTEXT *VmPtr
)
/*++
Routine Description:
The hook in ExecuteEbcImageEntryPoint. The hook in ExecuteEbcImageEntryPoint.
It will record the call-stack entry. (-1 means EbcImageEntryPoint call) It will record the call-stack entry. (-1 means EbcImageEntryPoint call)
and trigger Exception if BOE enabled. and trigger Exception if BOE enabled.
Arguments:
VmPtr - pointer to VM context. @param VmPtr - pointer to VM context.
Returns: **/
None VOID
EbcDebuggerHookExecuteEbcImageEntryPoint (
--*/ IN VM_CONTEXT *VmPtr
)
{ {
EbcDebuggerPushCallstackSource ((UINT64)(UINTN)-1, EfiDebuggerBranchTypeEbcCall); EbcDebuggerPushCallstackSource ((UINT64)(UINTN)-1, EfiDebuggerBranchTypeEbcCall);
EbcDebuggerPushCallstackParameter ((UINT64)(UINTN)VmPtr->Gpr[0], EfiDebuggerBranchTypeEbcCall); EbcDebuggerPushCallstackParameter ((UINT64)(UINTN)VmPtr->Gpr[0], EfiDebuggerBranchTypeEbcCall);
@ -596,26 +498,19 @@ Returns:
return ; return ;
} }
VOID /**
EbcDebuggerHookEbcInterpret (
IN VM_CONTEXT *VmPtr
)
/*++
Routine Description:
The hook in ExecuteEbcImageEntryPoint. The hook in ExecuteEbcImageEntryPoint.
It will record the call-stack entry. (-2 means EbcInterpret call) It will record the call-stack entry. (-2 means EbcInterpret call)
and trigger Exception if BOT enabled. and trigger Exception if BOT enabled.
Arguments: @param VmPtr - pointer to VM context.
VmPtr - pointer to VM context. **/
VOID
Returns: EbcDebuggerHookEbcInterpret (
None IN VM_CONTEXT *VmPtr
)
--*/
{ {
EbcDebuggerPushCallstackSource ((UINT64)(UINTN)-2, EfiDebuggerBranchTypeEbcCall); EbcDebuggerPushCallstackSource ((UINT64)(UINTN)-2, EfiDebuggerBranchTypeEbcCall);
EbcDebuggerPushCallstackParameter ((UINT64)(UINTN)VmPtr->Gpr[0], EfiDebuggerBranchTypeEbcCall); EbcDebuggerPushCallstackParameter ((UINT64)(UINTN)VmPtr->Gpr[0], EfiDebuggerBranchTypeEbcCall);
@ -624,25 +519,18 @@ Returns:
return ; return ;
} }
VOID /**
EbcDebuggerHookExecuteStart (
IN VM_CONTEXT *VmPtr
)
/*++
Routine Description:
The hook in EbcExecute, before ExecuteFunction. The hook in EbcExecute, before ExecuteFunction.
It will trigger Exception if GoTil, StepOver, or StepOut hit. It will trigger Exception if GoTil, StepOver, or StepOut hit.
Arguments: @param VmPtr - pointer to VM context.
VmPtr - pointer to VM context. **/
VOID
Returns: EbcDebuggerHookExecuteStart (
None IN VM_CONTEXT *VmPtr
)
--*/
{ {
EFI_TPL CurrentTpl; EFI_TPL CurrentTpl;
@ -710,25 +598,18 @@ Returns:
return ; return ;
} }
VOID /**
EbcDebuggerHookExecuteEnd (
IN VM_CONTEXT *VmPtr
)
/*++
Routine Description:
The hook in EbcExecute, after ExecuteFunction. The hook in EbcExecute, after ExecuteFunction.
It will record StepOut Entry if need. It will record StepOut Entry if need.
Arguments: @param VmPtr - pointer to VM context.
VmPtr - pointer to VM context. **/
VOID
Returns: EbcDebuggerHookExecuteEnd (
None IN VM_CONTEXT *VmPtr
)
--*/
{ {
UINTN Address; UINTN Address;
@ -741,26 +622,19 @@ Returns:
return ; return ;
} }
VOID /**
EbcDebuggerHookCALLStart (
IN VM_CONTEXT *VmPtr
)
/*++
Routine Description:
The hook in ExecuteCALL, before move IP. The hook in ExecuteCALL, before move IP.
It will trigger Exception if BOC enabled, It will trigger Exception if BOC enabled,
and record Callstack, and trace information. and record Callstack, and trace information.
Arguments: @param VmPtr - pointer to VM context.
VmPtr - pointer to VM context. **/
VOID
Returns: EbcDebuggerHookCALLStart (
None IN VM_CONTEXT *VmPtr
)
--*/
{ {
EbcDebuggerCheckHookFlag (VmPtr, EFI_DEBUG_FLAG_EBC_BOC); EbcDebuggerCheckHookFlag (VmPtr, EFI_DEBUG_FLAG_EBC_BOC);
EbcDebuggerPushCallstackSource ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcCall); EbcDebuggerPushCallstackSource ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcCall);
@ -769,26 +643,19 @@ Returns:
return ; return ;
} }
VOID /**
EbcDebuggerHookCALLEnd (
IN VM_CONTEXT *VmPtr
)
/*++
Routine Description:
The hook in ExecuteCALL, after move IP. The hook in ExecuteCALL, after move IP.
It will record Callstack, trace information It will record Callstack, trace information
and record StepOver/StepOut Entry if need. and record StepOver/StepOut Entry if need.
Arguments: @param VmPtr - pointer to VM context.
VmPtr - pointer to VM context. **/
VOID
Returns: EbcDebuggerHookCALLEnd (
None IN VM_CONTEXT *VmPtr
)
--*/
{ {
UINT64 Address; UINT64 Address;
UINTN FramePtr; UINTN FramePtr;
@ -817,26 +684,19 @@ Returns:
return ; return ;
} }
VOID /**
EbcDebuggerHookCALLEXStart (
IN VM_CONTEXT *VmPtr
)
/*++
Routine Description:
The hook in ExecuteCALL, before call EbcLLCALLEX. The hook in ExecuteCALL, before call EbcLLCALLEX.
It will trigger Exception if BOCX enabled, It will trigger Exception if BOCX enabled,
and record Callstack information. and record Callstack information.
Arguments: @param VmPtr - pointer to VM context.
VmPtr - pointer to VM context. **/
VOID
Returns: EbcDebuggerHookCALLEXStart (
None IN VM_CONTEXT *VmPtr
)
--*/
{ {
EbcDebuggerCheckHookFlag (VmPtr, EFI_DEBUG_FLAG_EBC_BOCX); EbcDebuggerCheckHookFlag (VmPtr, EFI_DEBUG_FLAG_EBC_BOCX);
// EbcDebuggerPushCallstackSource ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcCallEx); // EbcDebuggerPushCallstackSource ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcCallEx);
@ -845,51 +705,37 @@ Returns:
return ; return ;
} }
VOID /**
EbcDebuggerHookCALLEXEnd (
IN VM_CONTEXT *VmPtr
)
/*++
Routine Description:
The hook in ExecuteCALL, after call EbcLLCALLEX. The hook in ExecuteCALL, after call EbcLLCALLEX.
It will record trace information. It will record trace information.
Arguments: @param VmPtr - pointer to VM context.
VmPtr - pointer to VM context. **/
VOID
Returns: EbcDebuggerHookCALLEXEnd (
None IN VM_CONTEXT *VmPtr
)
--*/
{ {
// EbcDebuggerPushCallstackDest ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcCallEx); // EbcDebuggerPushCallstackDest ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcCallEx);
EbcDebuggerPushTraceDestEntry ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcCallEx); EbcDebuggerPushTraceDestEntry ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcCallEx);
return ; return ;
} }
VOID /**
EbcDebuggerHookRETStart (
IN VM_CONTEXT *VmPtr
)
/*++
Routine Description:
The hook in ExecuteRET, before move IP. The hook in ExecuteRET, before move IP.
It will trigger Exception if BOR enabled, It will trigger Exception if BOR enabled,
and record Callstack, and trace information. and record Callstack, and trace information.
Arguments: @param VmPtr - pointer to VM context.
VmPtr - pointer to VM context. **/
VOID
Returns: EbcDebuggerHookRETStart (
None IN VM_CONTEXT *VmPtr
)
--*/
{ {
EbcDebuggerCheckHookFlag (VmPtr, EFI_DEBUG_FLAG_EBC_BOR); EbcDebuggerCheckHookFlag (VmPtr, EFI_DEBUG_FLAG_EBC_BOR);
EbcDebuggerPopCallstack (); EbcDebuggerPopCallstack ();
@ -897,121 +743,86 @@ Returns:
return ; return ;
} }
VOID /**
EbcDebuggerHookRETEnd (
IN VM_CONTEXT *VmPtr
)
/*++
Routine Description:
The hook in ExecuteRET, after move IP. The hook in ExecuteRET, after move IP.
It will record trace information. It will record trace information.
Arguments: @param VmPtr - pointer to VM context.
VmPtr - pointer to VM context. **/
VOID
Returns: EbcDebuggerHookRETEnd (
None IN VM_CONTEXT *VmPtr
)
--*/
{ {
EbcDebuggerPushTraceDestEntry ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcRet); EbcDebuggerPushTraceDestEntry ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcRet);
return ; return ;
} }
VOID /**
EbcDebuggerHookJMPStart (
IN VM_CONTEXT *VmPtr
)
/*++
Routine Description:
The hook in ExecuteJMP, before move IP. The hook in ExecuteJMP, before move IP.
It will record trace information. It will record trace information.
Arguments: @param VmPtr - pointer to VM context.
VmPtr - pointer to VM context. **/
VOID
Returns: EbcDebuggerHookJMPStart (
None IN VM_CONTEXT *VmPtr
)
--*/
{ {
EbcDebuggerPushTraceSourceEntry ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcJmp); EbcDebuggerPushTraceSourceEntry ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcJmp);
return ; return ;
} }
VOID /**
EbcDebuggerHookJMPEnd (
IN VM_CONTEXT *VmPtr
)
/*++
Routine Description:
The hook in ExecuteJMP, after move IP. The hook in ExecuteJMP, after move IP.
It will record trace information. It will record trace information.
Arguments: @param VmPtr - pointer to VM context.
VmPtr - pointer to VM context. **/
VOID
Returns: EbcDebuggerHookJMPEnd (
None IN VM_CONTEXT *VmPtr
)
--*/
{ {
EbcDebuggerPushTraceDestEntry ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcJmp); EbcDebuggerPushTraceDestEntry ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcJmp);
return ; return ;
} }
VOID /**
EbcDebuggerHookJMP8Start (
IN VM_CONTEXT *VmPtr
)
/*++
Routine Description:
The hook in ExecuteJMP8, before move IP. The hook in ExecuteJMP8, before move IP.
It will record trace information. It will record trace information.
Arguments: @param VmPtr - pointer to VM context.
VmPtr - pointer to VM context. **/
VOID
Returns: EbcDebuggerHookJMP8Start (
None IN VM_CONTEXT *VmPtr
)
--*/
{ {
EbcDebuggerPushTraceSourceEntry ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcJmp8); EbcDebuggerPushTraceSourceEntry ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcJmp8);
return ; return ;
} }
VOID /**
EbcDebuggerHookJMP8End (
IN VM_CONTEXT *VmPtr
)
/*++
Routine Description:
The hook in ExecuteJMP8, after move IP. The hook in ExecuteJMP8, after move IP.
It will record trace information. It will record trace information.
Arguments: @param VmPtr - pointer to VM context.
VmPtr - pointer to VM context. **/
VOID
Returns: EbcDebuggerHookJMP8End (
None IN VM_CONTEXT *VmPtr
)
--*/
{ {
EbcDebuggerPushTraceDestEntry ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcJmp8); EbcDebuggerPushTraceDestEntry ((UINT64)(UINTN)VmPtr->Ip, EfiDebuggerBranchTypeEbcJmp8);
return ; return ;

View File

@ -1,7 +1,7 @@
/*++ /** @file
Copyright (c) 2007, Intel Corporation Copyright (c) 2007, Intel Corporation All rights reserved.<BR>
All rights reserved. This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php 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, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name: **/
EdbHook.h
Abstract:
--*/
#ifndef _EFI_EDB_HOOKER_H_ #ifndef _EFI_EDB_HOOKER_H_
#define _EFI_EDB_HOOKER_H_ #define _EFI_EDB_HOOKER_H_

View File

@ -1,7 +1,7 @@
/*++ /** @file
Copyright (c) 2007, Intel Corporation Copyright (c) 2007, Intel Corporation All rights reserved.<BR>
All rights reserved. This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php 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, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdbSupport.h **/
Abstract:
--*/
#ifndef _EFI_EDB_SUPPORT_H_ #ifndef _EFI_EDB_SUPPORT_H_
#define _EFI_EDB_SUPPORT_H_ #define _EFI_EDB_SUPPORT_H_
@ -175,9 +169,9 @@ PatchForAsciiStrTokenBefore (
IN CHAR8 Patch IN CHAR8 Patch
); );
// /**
// Shell Library Shell Library.
// **/
VOID VOID
EFIAPI EFIAPI
Input ( Input (

View File

@ -1,7 +1,7 @@
/*++ /** @file
Copyright (c) 2007, Intel Corporation Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
All rights reserved. This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php 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, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdbSupportFile.c **/
Abstract:
--*/
#include "Edb.h" #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
@retval EFI_SUCCESS - read file successfully
@retval EFI_NOT_FOUND - file not found
**/
EFI_STATUS EFI_STATUS
EFIAPI EFIAPI
ReadFileFromVol ( ReadFileFromVol (
@ -28,25 +34,6 @@ ReadFileFromVol (
OUT UINTN *BufferSize, OUT UINTN *BufferSize,
OUT VOID **Buffer 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_STATUS Status;
EFI_FILE_HANDLE RootDir; EFI_FILE_HANDLE RootDir;
@ -138,6 +125,25 @@ Returns:
return EFI_SUCCESS; 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 EFI_STATUS
EFIAPI EFIAPI
ReadFileToBuffer ( ReadFileToBuffer (
@ -147,31 +153,6 @@ ReadFileToBuffer (
OUT VOID **Buffer, OUT VOID **Buffer,
IN BOOLEAN ScanFs 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_STATUS Status;
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *Vol; EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *Vol;
@ -272,6 +253,18 @@ Returns:
return EFI_SUCCESS; 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 * CHAR16 *
EFIAPI EFIAPI
GetFileNameUnderDir ( GetFileNameUnderDir (
@ -280,24 +273,6 @@ GetFileNameUnderDir (
IN CHAR16 *FileName, IN CHAR16 *FileName,
IN OUT UINTN *Index 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_STATUS Status;
EFI_FILE_HANDLE RootDir; EFI_FILE_HANDLE RootDir;

View File

@ -1,7 +1,7 @@
/*++ /** @file
Copyright (c) 2007 - 2016, Intel Corporation Copyright (c) 2007 - 2016, Intel Corporation All rights reserved.<BR>
All rights reserved. This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php 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, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdbSupportString.c **/
Abstract:
--*/
#include "Edb.h" #include "Edb.h"
/**
Convert hex string to uint.
@param str - The string
**/
UINTN UINTN
EFIAPI EFIAPI
Xtoi ( Xtoi (
CHAR16 *str CHAR16 *str
) )
/*++
Routine Description:
Convert hex string to uint
Arguments:
Str - The string
Returns:
--*/
{ {
UINTN u; UINTN u;
CHAR16 c; CHAR16 c;
@ -90,24 +78,19 @@ Returns:
return u; return u;
} }
/**
Convert hex string to uint.
@param str - The string
**/
UINT64 UINT64
EFIAPI EFIAPI
LXtoi ( LXtoi (
CHAR16 *str CHAR16 *str
) )
/*++
Routine Description:
Convert hex string to uint
Arguments:
Str - The string
Returns:
--*/
{ {
UINT64 u; UINT64 u;
CHAR16 c; CHAR16 c;
@ -161,24 +144,18 @@ Returns:
return u; return u;
} }
/**
Convert hex string to uint.
@param str - The string
**/
UINTN UINTN
EFIAPI EFIAPI
Atoi ( Atoi (
CHAR16 *str CHAR16 *str
) )
/*++
Routine Description:
Convert hex string to uint
Arguments:
Str - The string
Returns:
--*/
{ {
UINTN u; UINTN u;
CHAR16 c; CHAR16 c;
@ -217,24 +194,18 @@ Returns:
return u; return u;
} }
/**
Convert hex string to uint.
@param str - The string
**/
UINTN UINTN
EFIAPI EFIAPI
AsciiXtoi ( AsciiXtoi (
CHAR8 *str CHAR8 *str
) )
/*++
Routine Description:
Convert hex string to uint
Arguments:
Str - The string
Returns:
--*/
{ {
UINTN u; UINTN u;
CHAR8 c; CHAR8 c;
@ -287,24 +258,18 @@ Returns:
return u; return u;
} }
/**
Convert hex string to uint.
@param str - The string
**/
UINTN UINTN
EFIAPI EFIAPI
AsciiAtoi ( AsciiAtoi (
CHAR8 *str CHAR8 *str
) )
/*++
Routine Description:
Convert hex string to uint
Arguments:
Str - The string
Returns:
--*/
{ {
UINTN u; UINTN u;
CHAR8 c; CHAR8 c;
@ -361,28 +326,24 @@ AsciiToUpper (
return (Chr >= 'a' && Chr <= 'z') ? Chr - ('a' - 'A') : Chr; return (Chr >= 'a' && Chr <= 'z') ? Chr - ('a' - 'A') : Chr;
} }
/**
Compare the Unicode and Ascii string pointed by String to the string pointed by String2.
@param String - Unicode String to process
@param String2 - Ascii string to process
@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 INTN
EFIAPI EFIAPI
StrCmpUnicodeAndAscii ( StrCmpUnicodeAndAscii (
IN CHAR16 *String, IN CHAR16 *String,
IN CHAR8 *String2 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
Returns:
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.
--*/
{ {
while (*String) { while (*String) {
if (*String != (CHAR16)*String2) { if (*String != (CHAR16)*String2) {
@ -396,27 +357,24 @@ Returns:
return (*String - (CHAR16)*String2); return (*String - (CHAR16)*String2);
} }
/**
Compare the Unicode string pointed by String to the string pointed by String2.
@param String - Unicode String to process
@param String2 - Unicode string to process
@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 INTN
EFIAPI EFIAPI
StriCmp ( StriCmp (
IN CHAR16 *String, IN CHAR16 *String,
IN CHAR16 *String2 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
Returns:
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.
--*/
{ {
while ((*String != L'\0') && while ((*String != L'\0') &&
(UnicodeToUpper (*String) == UnicodeToUpper (*String2))) { (UnicodeToUpper (*String) == UnicodeToUpper (*String2))) {
@ -427,28 +385,24 @@ Returns:
return UnicodeToUpper (*String) - UnicodeToUpper (*String2); return UnicodeToUpper (*String) - UnicodeToUpper (*String2);
} }
/**
Compare the Unicode and Ascii string pointed by String to the string pointed by String2.
@param String - Unicode String to process
@param String2 - Ascii string to process
@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 INTN
EFIAPI EFIAPI
StriCmpUnicodeAndAscii ( StriCmpUnicodeAndAscii (
IN CHAR16 *String, IN CHAR16 *String,
IN CHAR8 *String2 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
Returns:
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.
--*/
{ {
while ((*String != L'\0') && while ((*String != L'\0') &&
(UnicodeToUpper (*String) == (CHAR16)AsciiToUpper (*String2))) { (UnicodeToUpper (*String) == (CHAR16)AsciiToUpper (*String2))) {
@ -459,19 +413,20 @@ Returns:
return UnicodeToUpper (*String) - (CHAR16)AsciiToUpper (*String2); 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 BOOLEAN
EFIAPI EFIAPI
StrEndWith ( StrEndWith (
IN CHAR16 *Str, IN CHAR16 *Str,
IN CHAR16 *SubStr IN CHAR16 *SubStr
) )
/*++
Routine Description:
Verify if the string is end with the sub string.
--*/
{ {
CHAR16 *Temp; CHAR16 *Temp;
@ -491,12 +446,17 @@ Routine Description:
} }
} }
/**
Duplicate a string.
@param Src The string to be duplicated.
**/
CHAR16 * CHAR16 *
EFIAPI EFIAPI
StrDuplicate ( StrDuplicate (
IN CHAR16 *Src IN CHAR16 *Src
) )
// duplicate a string
{ {
CHAR16 *Dest; CHAR16 *Dest;
UINTN Size; UINTN Size;
@ -513,19 +473,20 @@ StrDuplicate (
CHAR16 *mLineBuffer = NULL; CHAR16 *mLineBuffer = NULL;
CHAR16 *mFieldBuffer = 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 UINTN
EFIAPI EFIAPI
StrSpn ( StrSpn (
IN CHAR16 *String, IN CHAR16 *String,
IN CHAR16 *CharSet IN CHAR16 *CharSet
) )
/*++
Routine Description:
Find the first substring.
--*/
{ {
UINTN Count; UINTN Count;
CHAR16 *Str1; CHAR16 *Str1;
@ -550,6 +511,15 @@ Routine Description:
return Count; 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 * CHAR16 *
EFIAPI EFIAPI
@ -557,14 +527,6 @@ StrBrk (
IN CHAR16 *String, IN CHAR16 *String,
IN CHAR16 *CharSet IN CHAR16 *CharSet
) )
/*++
Routine Description:
Searches a string for the first occurrence of a character contained in a
specified buffer.
--*/
{ {
CHAR16 *Str1; CHAR16 *Str1;
CHAR16 *Str2; CHAR16 *Str2;
@ -580,19 +542,20 @@ Routine Description:
return NULL; 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 * CHAR16 *
EFIAPI EFIAPI
StrTokenLine ( StrTokenLine (
IN CHAR16 *String OPTIONAL, IN CHAR16 *String OPTIONAL,
IN CHAR16 *CharSet IN CHAR16 *CharSet
) )
/*++
Routine Description:
Find the next token after one or more specified characters.
--*/
{ {
CHAR16 *Begin; CHAR16 *Begin;
CHAR16 *End; CHAR16 *End;
@ -618,6 +581,14 @@ Routine Description:
return Begin; 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 * CHAR16 *
EFIAPI EFIAPI
@ -625,13 +596,6 @@ StrTokenField (
IN CHAR16 *String OPTIONAL, IN CHAR16 *String OPTIONAL,
IN CHAR16 *CharSet IN CHAR16 *CharSet
) )
/*++
Routine Description:
Find the next token after one specificed characters.
--*/
{ {
CHAR16 *Begin; CHAR16 *Begin;
CHAR16 *End; CHAR16 *End;
@ -753,19 +717,20 @@ PatchForStrTokenBefore (
CHAR8 *mAsciiLineBuffer = NULL; CHAR8 *mAsciiLineBuffer = NULL;
CHAR8 *mAsciiFieldBuffer = 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 UINTN
EFIAPI EFIAPI
AsciiStrSpn ( AsciiStrSpn (
IN CHAR8 *String, IN CHAR8 *String,
IN CHAR8 *CharSet IN CHAR8 *CharSet
) )
/*++
Routine Description:
Find the first substring.
--*/
{ {
UINTN Count; UINTN Count;
CHAR8 *Str1; CHAR8 *Str1;
@ -790,21 +755,20 @@ Routine Description:
return Count; 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 * CHAR8 *
EFIAPI EFIAPI
AsciiStrBrk ( AsciiStrBrk (
IN CHAR8 *String, IN CHAR8 *String,
IN CHAR8 *CharSet IN CHAR8 *CharSet
) )
/*++
Routine Description:
Searches a string for the first occurrence of a character contained in a
specified buffer.
--*/
{ {
CHAR8 *Str1; CHAR8 *Str1;
CHAR8 *Str2; CHAR8 *Str2;
@ -820,19 +784,20 @@ Routine Description:
return NULL; 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 * CHAR8 *
EFIAPI EFIAPI
AsciiStrTokenLine ( AsciiStrTokenLine (
IN CHAR8 *String OPTIONAL, IN CHAR8 *String OPTIONAL,
IN CHAR8 *CharSet IN CHAR8 *CharSet
) )
/*++
Routine Description:
Find the next token after one or more specified characters.
--*/
{ {
CHAR8 *Begin; CHAR8 *Begin;
CHAR8 *End; CHAR8 *End;
@ -858,6 +823,14 @@ Routine Description:
return Begin; 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 * CHAR8 *
EFIAPI EFIAPI
@ -865,13 +838,6 @@ AsciiStrTokenField (
IN CHAR8 *String OPTIONAL, IN CHAR8 *String OPTIONAL,
IN CHAR8 *CharSet IN CHAR8 *CharSet
) )
/*++
Routine Description:
Find the next token after one specificed characters.
--*/
{ {
CHAR8 *Begin; CHAR8 *Begin;
CHAR8 *End; CHAR8 *End;

View File

@ -1,7 +1,7 @@
/*++ /** @file
Copyright (c) 2007, Intel Corporation Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
All rights reserved. This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php 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, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdbSupportUI.c **/
Abstract:
--*/
#include "Edb.h" #include "Edb.h"
@ -33,28 +27,23 @@ SetCursorPosition (
IN UINTN Len 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 EFI_STATUS
EFIAPI EFIAPI
WaitForSingleEvent ( WaitForSingleEvent (
IN EFI_EVENT Event, IN EFI_EVENT Event,
IN UINT64 Timeout OPTIONAL 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; EFI_STATUS Status;
UINTN Index; UINTN Index;
@ -103,6 +92,15 @@ Returns:
return Status; 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 VOID
EFIAPI EFIAPI
ConMoveCursorBackward ( ConMoveCursorBackward (
@ -110,19 +108,6 @@ ConMoveCursorBackward (
IN OUT UINTN *Column, IN OUT UINTN *Column,
IN OUT UINTN *Row 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 (Column != NULL);
ASSERT (Row != 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 VOID
EFIAPI EFIAPI
ConMoveCursorForward ( ConMoveCursorForward (
@ -152,20 +147,6 @@ ConMoveCursorForward (
IN OUT UINTN *Column, IN OUT UINTN *Column,
IN OUT UINTN *Row 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 (Column != NULL);
ASSERT (Row != NULL); ASSERT (Row != NULL);

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/*++ /** @file
Copyright (c) 2007, Intel Corporation Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
All rights reserved. This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php 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, THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdbSymbol.h **/
Abstract:
--*/
#ifndef _EFI_EDB_SYMBOL_H_ #ifndef _EFI_EDB_SYMBOL_H_
#define _EFI_EDB_SYMBOL_H_ #define _EFI_EDB_SYMBOL_H_