MdeModulePkg/EbcDxe: add EBC Debugger

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Pete Batard <pete@akeo.ie>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
This commit is contained in:
Pete Batard
2016-11-16 21:24:09 +08:00
committed by Jiewen Yao
parent 6f0a3cd23e
commit 748edcd5eb
34 changed files with 15745 additions and 1 deletions
+2 -1
View File
@@ -427,10 +427,11 @@
MdeModulePkg/Library/DxeCapsuleLibFmp/DxeCapsuleLib.inf
MdeModulePkg/Library/DxeCapsuleLibFmp/DxeRuntimeCapsuleLib.inf
[Components.IA32, Components.X64, Components.IPF]
[Components.IA32, Components.X64, Components.IPF, Components.AARCH64]
MdeModulePkg/Universal/Network/UefiPxeBcDxe/UefiPxeBcDxe.inf
MdeModulePkg/Universal/DebugSupportDxe/DebugSupportDxe.inf
MdeModulePkg/Universal/EbcDxe/EbcDxe.inf
MdeModulePkg/Universal/EbcDxe/EbcDebugger.inf
[Components.IA32, Components.X64, Components.Ebc]
MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
@@ -0,0 +1,120 @@
## @file
# EFI Byte Code (EBC) Debugger.
#
# Copyright (c) 2007 - 2016, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
#
##
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = EbcDebugger
MODULE_UNI_FILE = EbcDebugger.uni
FILE_GUID = 8296AF37-D183-4416-B3B6-19D2A80AD4A8
MODULE_TYPE = DXE_DRIVER
VERSION_STRING = 1.0
ENTRY_POINT = InitializeEbcDriver
#
# The following information is for reference only and not required by the build tools.
#
# VALID_ARCHITECTURES = IA32 X64 IPF AARCH64
#
[Sources]
EbcDebuggerHook.h
EbcInt.c
EbcInt.h
EbcExecute.c
EbcExecute.h
EbcDebugger/Edb.c
EbcDebugger/Edb.h
EbcDebugger/EdbCommon.h
EbcDebugger/EdbCmdBranch.c
EbcDebugger/EdbCmdBreak.c
EbcDebugger/EdbCmdBreakpoint.c
EbcDebugger/EdbCmdGo.c
EbcDebugger/EdbCmdHelp.c
EbcDebugger/EdbCmdMemory.c
EbcDebugger/EdbCmdRegister.c
EbcDebugger/EdbCmdQuit.c
EbcDebugger/EdbCmdScope.c
EbcDebugger/EdbCmdStep.c
EbcDebugger/EdbCmdSymbol.c
EbcDebugger/EdbCmdExtIo.c
EbcDebugger/EdbCmdExtPci.c
EbcDebugger/EdbCommand.c
EbcDebugger/EdbCommand.h
EbcDebugger/EdbDisasm.c
EbcDebugger/EdbDisasm.h
EbcDebugger/EdbDisasmSupport.c
EbcDebugger/EdbDisasmSupport.h
EbcDebugger/EdbSymbol.c
EbcDebugger/EdbSymbol.h
EbcDebugger/EdbHook.c
EbcDebugger/EdbHook.h
EbcDebugger/EdbSupport.h
EbcDebugger/EdbSupportUI.c
EbcDebugger/EdbSupportString.c
EbcDebugger/EdbSupportFile.c
[Sources.Ia32]
Ia32/EbcSupport.c
Ia32/EbcLowLevel.nasm
Ia32/EbcLowLevel.S
Ia32/EbcLowLevel.asm
[Sources.X64]
X64/EbcSupport.c
X64/EbcLowLevel.nasm
X64/EbcLowLevel.S
X64/EbcLowLevel.asm
[Sources.IPF]
Ipf/EbcSupport.h
Ipf/EbcSupport.c
Ipf/EbcLowLevel.s
[Sources.AARCH64]
AArch64/EbcSupport.c
AArch64/EbcLowLevel.S
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
[LibraryClasses]
UefiDriverEntryPoint
UefiLib
UefiBootServicesTableLib
MemoryAllocationLib
BaseMemoryLib
DebugLib
BaseLib
[Protocols]
gEfiDebugSupportProtocolGuid ## PRODUCES
gEfiEbcProtocolGuid ## PRODUCES
gEfiEbcVmTestProtocolGuid ## SOMETIMES_PRODUCES
gEfiEbcSimpleDebuggerProtocolGuid ## SOMETIMES_CONSUMES
gEfiPciRootBridgeIoProtocolGuid ## SOMETIMES_CONSUMES
gEfiSimpleFileSystemProtocolGuid ## SOMETIMES_CONSUMES
[Guids]
gEfiFileInfoGuid ## SOMETIMES_CONSUMES ## GUID
gEfiFileSystemInfoGuid ## SOMETIMES_CONSUMES ## GUID
gEfiFileSystemVolumeLabelInfoIdGuid ## SOMETIMES_CONSUMES ## GUID
gEfiDebugImageInfoTableGuid ## SOMETIMES_CONSUMES ## GUID
[Depex]
TRUE
[UserExtensions.TianoCore."ExtraFiles"]
EbcDebuggerExtra.uni
@@ -0,0 +1,18 @@
// /** @file
// EFI Byte Code (EBC) Debugger.
//
// Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
//
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
// which accompanies this distribution. The full text of the license may be found at
// http://opensource.org/licenses/bsd-license.php
// THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
// WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
//
// **/
#string STR_MODULE_ABSTRACT #language en-US "EFI Byte Code (EBC) Debugger application"
#string STR_MODULE_DESCRIPTION #language en-US "This application enables the debugging of EBC runtimes."
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,62 @@
/*++
Copyright (c) 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
Edb.h
Abstract:
--*/
#ifndef _EFI_EDB_H_
#define _EFI_EDB_H_
#include <Uefi.h>
#include "EdbCommon.h"
#include "EbcInt.h"
#include "EbcExecute.h"
#define EBC_DEBUGGER_MAJOR_VERSION 1
#define EBC_DEBUGGER_MINOR_VERSION 0
#define EFI_DEBUG_RETURN 1
#define EFI_DEBUG_BREAK 2
#define EFI_DEBUG_CONTINUE 3
//
// Function
//
EFI_STATUS
EfiDebuggerEntrypoint (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
);
VOID
EFIAPI
EdbExceptionHandler (
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
);
extern EFI_DEBUGGER_PRIVATE_DATA mDebuggerPrivate;
#include "EdbSupport.h"
#include "EdbCommand.h"
#include "EdbDisasm.h"
#include "EdbDisasmSupport.h"
#include "EdbSymbol.h"
#include "EdbHook.h"
#endif
@@ -0,0 +1,336 @@
/*++
Copyright (c) 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdbCmdBranch.c
Abstract:
--*/
#include "Edb.h"
CHAR16 *mBranchTypeStr[] = {
L"(CALL)",
L"(CALLEX)",
L"(RET)",
L"(JMP)",
L"(JMP8)",
};
CHAR16 *
EdbBranchTypeToStr (
IN EFI_DEBUGGER_BRANCH_TYPE Type
)
/*++
Routine Description:
Comvert Branch Type to string
Arguments:
Type - Branch Type
Returns:
String
--*/
{
if (Type < 0 || Type >= EfiDebuggerBranchTypeEbcMax) {
return L"(Unknown Type)";
}
return mBranchTypeStr [Type];
}
EFI_DEBUG_STATUS
DebuggerCallStack (
IN CHAR16 *CommandArg,
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
/*++
Routine Description:
DebuggerCommand - CallStack
Arguments:
CommandArg - The argument for this command
DebuggerPrivate - EBC Debugger private data structure
InterruptType - Interrupt type.
SystemContext - EBC system context.
Returns:
EFI_DEBUG_CONTINUE - formal return value
--*/
{
INTN Index;
UINTN SubIndex;
CHAR8 *FuncName;
EFI_DEBUGGER_CALLSTACK_CONTEXT *CallStackEntry;
BOOLEAN ShowParameter;
UINTN ParameterNumber;
ShowParameter = FALSE;
ParameterNumber = EFI_DEBUGGER_CALL_DEFAULT_PARAMETER;
//
// Check argument
//
if (CommandArg != NULL) {
if (StriCmp (CommandArg, L"c") == 0) {
//
// Clear Call-Stack
//
DebuggerPrivate->CallStackEntryCount = 0;
ZeroMem (DebuggerPrivate->CallStackEntry, sizeof(DebuggerPrivate->CallStackEntry));
EDBPrint (L"Call-Stack is cleared\n");
return EFI_DEBUG_CONTINUE;
} else if (StriCmp (CommandArg, L"p") == 0) {
//
// Print Call-Stack with parameter
//
ShowParameter = TRUE;
CommandArg = StrGetNextTokenLine (L" ");
if (CommandArg != NULL) {
//
// Try to get the parameter number
//
ParameterNumber = Atoi (CommandArg);
if (ParameterNumber > 16) {
EDBPrint (L"Call-Stack argument Invalid\n");
return EFI_DEBUG_CONTINUE;
}
}
} else {
EDBPrint (L"Call-Stack argument Invalid\n");
return EFI_DEBUG_CONTINUE;
}
}
//
// Check CallStack Entry Count
//
if (DebuggerPrivate->CallStackEntryCount == 0) {
EDBPrint (L"No Call-Stack\n");
return EFI_DEBUG_CONTINUE;
} else if (DebuggerPrivate->CallStackEntryCount > EFI_DEBUGGER_CALLSTACK_MAX) {
EDBPrint (L"Call-Stack Crash, re-initialize!\n");
DebuggerPrivate->CallStackEntryCount = 0;
return EFI_DEBUG_CONTINUE;
}
//
// Go through each CallStack entry and print
//
EDBPrint (L"Call-Stack (TOP):\n");
EDBPrint (L" Caller Callee Name\n");
EDBPrint (L" ================== ================== ========\n");
//EDBPrint (L" 0x00000000FFFFFFFF 0xFFFFFFFF00000000 EfiMain\n");
for (Index = (INTN)(DebuggerPrivate->CallStackEntryCount - 1); Index >= 0; Index--) {
//
// Get CallStack and print
//
CallStackEntry = &DebuggerPrivate->CallStackEntry[Index];
EDBPrint (
L" 0x%016lx 0x%016lx",
CallStackEntry->SourceAddress,
CallStackEntry->DestAddress
);
FuncName = FindSymbolStr ((UINTN)CallStackEntry->DestAddress);
if (FuncName != NULL) {
EDBPrint (L" %a()", FuncName);
}
EDBPrint (L"\n");
if (ShowParameter) {
//
// Print parameter
//
if (sizeof(UINTN) == sizeof(UINT64)) {
EDBPrint (
L" Parameter Address (0x%016lx) (\n",
CallStackEntry->ParameterAddr
);
if (ParameterNumber == 0) {
EDBPrint (L" )\n");
continue;
}
//
// Print each parameter
//
for (SubIndex = 0; SubIndex < ParameterNumber - 1; SubIndex++) {
if (SubIndex % 2 == 0) {
EDBPrint (L" ");
}
EDBPrint (
L"0x%016lx, ",
CallStackEntry->Parameter[SubIndex]
);
if (SubIndex % 2 == 1) {
EDBPrint (L"\n");
}
}
if (SubIndex % 2 == 0) {
EDBPrint (L" ");
}
EDBPrint (
L"0x%016lx\n",
CallStackEntry->Parameter[SubIndex]
);
EDBPrint (L" )\n");
//
// break only for parameter
//
if ((((DebuggerPrivate->CallStackEntryCount - Index) % (16 / ParameterNumber)) == 0) &&
(Index != 0)) {
if (SetPageBreak ()) {
break;
}
}
} else {
EDBPrint (
L" Parameter Address (0x%08x) (\n",
CallStackEntry->ParameterAddr
);
if (ParameterNumber == 0) {
EDBPrint (L" )\n");
continue;
}
//
// Print each parameter
//
for (SubIndex = 0; SubIndex < ParameterNumber - 1; SubIndex++) {
if (SubIndex % 4 == 0) {
EDBPrint (L" ");
}
EDBPrint (
L"0x%08x, ",
CallStackEntry->Parameter[SubIndex]
);
if (SubIndex % 4 == 3) {
EDBPrint (L"\n");
}
}
if (SubIndex % 4 == 0) {
EDBPrint (L" ");
}
EDBPrint (
L"0x%08x\n",
CallStackEntry->Parameter[SubIndex]
);
EDBPrint (L" )\n");
//
// break only for parameter
//
if ((((DebuggerPrivate->CallStackEntryCount - Index) % (32 / ParameterNumber)) == 0) &&
(Index != 0)) {
if (SetPageBreak ()) {
break;
}
}
}
}
}
//
// Done
//
return EFI_DEBUG_CONTINUE;
}
EFI_DEBUG_STATUS
DebuggerInstructionBranch (
IN CHAR16 *CommandArg,
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
/*++
Routine Description:
DebuggerCommand - InstructionBranch
Arguments:
CommandArg - The argument for this command
DebuggerPrivate - EBC Debugger private data structure
InterruptType - Interrupt type.
SystemContext - EBC system context.
Returns:
EFI_DEBUG_CONTINUE - formal return value
--*/
{
UINTN Index;
//
// Check argument
//
if (CommandArg != NULL) {
if (StriCmp (CommandArg, L"c") == 0) {
//
// Clear Trace
//
DebuggerPrivate->TraceEntryCount = 0;
ZeroMem (DebuggerPrivate->TraceEntry, sizeof(DebuggerPrivate->TraceEntry));
EDBPrint (L"Instruction Trace is cleared\n");
} else {
EDBPrint (L"Trace argument Invalid\n");
}
return EFI_DEBUG_CONTINUE;
}
//
// Check Trace Entry Count
//
if (DebuggerPrivate->TraceEntryCount == 0) {
EDBPrint (L"No Instruction Trace\n");
return EFI_DEBUG_CONTINUE;
} else if (DebuggerPrivate->TraceEntryCount > EFI_DEBUGGER_TRACE_MAX) {
EDBPrint (L"Instruction Trace Crash, re-initialize!\n");
DebuggerPrivate->TraceEntryCount = 0;
return EFI_DEBUG_CONTINUE;
}
//
// Go through each Trace entry and print
//
EDBPrint (L"Instruction Trace (->Latest):\n");
EDBPrint (L" Source Addr Destination Addr Type\n");
EDBPrint (L" ================== ================== ========\n");
//EDBPrint (L" 0x00000000FFFFFFFF 0xFFFFFFFF00000000 (CALLEX)\n");
for (Index = 0; Index < DebuggerPrivate->TraceEntryCount; Index++) {
EDBPrint (
L" 0x%016lx 0x%016lx %s\n",
DebuggerPrivate->TraceEntry[Index].SourceAddress,
DebuggerPrivate->TraceEntry[Index].DestAddress,
EdbBranchTypeToStr (DebuggerPrivate->TraceEntry[Index].Type)
);
}
//
// Done
//
return EFI_DEBUG_CONTINUE;
}
@@ -0,0 +1,327 @@
/*++
Copyright (c) 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdbCmdBreak.c
Abstract:
--*/
#include "Edb.h"
EFI_DEBUG_STATUS
DebuggerBreakOnCALL (
IN CHAR16 *CommandArg,
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
/*++
Routine Description:
DebuggerCommand - BreakOnCALL
Arguments:
CommandArg - The argument for this command
DebuggerPrivate - EBC Debugger private data structure
InterruptType - Interrupt type.
SystemContext - EBC system context.
Returns:
EFI_DEBUG_CONTINUE - formal return value
--*/
{
//
// Check argument
//
if (CommandArg == NULL) {
if ((DebuggerPrivate->FeatureFlags & EFI_DEBUG_FLAG_EBC_BOC) == EFI_DEBUG_FLAG_EBC_BOC) {
EDBPrint (L"BOC on\n");
} else {
EDBPrint (L"BOC off\n");
}
} else if (StriCmp (CommandArg, L"on") == 0) {
DebuggerPrivate->FeatureFlags |= EFI_DEBUG_FLAG_EBC_BOC;
EDBPrint (L"BOC on\n");
} else if (StriCmp (CommandArg, L"off") == 0) {
DebuggerPrivate->FeatureFlags &= ~EFI_DEBUG_FLAG_EBC_B_BOC;
EDBPrint (L"BOC off\n");
} else {
EDBPrint (L"BOC - argument error\n");
}
//
// Done
//
return EFI_DEBUG_CONTINUE;
}
EFI_DEBUG_STATUS
DebuggerBreakOnCALLEX (
IN CHAR16 *CommandArg,
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
/*++
Routine Description:
DebuggerCommand - BreakOnCALLEX
Arguments:
CommandArg - The argument for this command
DebuggerPrivate - EBC Debugger private data structure
InterruptType - Interrupt type.
SystemContext - EBC system context.
Returns:
EFI_DEBUG_CONTINUE - formal return value
--*/
{
//
// Check argument
//
if (CommandArg == NULL) {
if ((DebuggerPrivate->FeatureFlags & EFI_DEBUG_FLAG_EBC_BOCX) == EFI_DEBUG_FLAG_EBC_BOCX) {
EDBPrint (L"BOCX on\n");
} else {
EDBPrint (L"BOCX off\n");
}
} else if (StriCmp (CommandArg, L"on") == 0) {
DebuggerPrivate->FeatureFlags |= EFI_DEBUG_FLAG_EBC_BOCX;
EDBPrint (L"BOCX on\n");
} else if (StriCmp (CommandArg, L"off") == 0) {
DebuggerPrivate->FeatureFlags &= ~EFI_DEBUG_FLAG_EBC_B_BOCX;
EDBPrint (L"BOCX off\n");
} else {
EDBPrint (L"BOCX - argument error\n");
}
//
// Done
//
return EFI_DEBUG_CONTINUE;
}
EFI_DEBUG_STATUS
DebuggerBreakOnRET (
IN CHAR16 *CommandArg,
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
/*++
Routine Description:
DebuggerCommand - BreakOnRET
Arguments:
CommandArg - The argument for this command
DebuggerPrivate - EBC Debugger private data structure
InterruptType - Interrupt type.
SystemContext - EBC system context.
Returns:
EFI_DEBUG_CONTINUE - formal return value
--*/
{
//
// Check argument
//
if (CommandArg == NULL) {
if ((DebuggerPrivate->FeatureFlags & EFI_DEBUG_FLAG_EBC_BOR) == EFI_DEBUG_FLAG_EBC_BOR) {
EDBPrint (L"BOR on\n");
} else {
EDBPrint (L"BOR off\n");
}
} else if (StriCmp (CommandArg, L"on") == 0) {
DebuggerPrivate->FeatureFlags |= EFI_DEBUG_FLAG_EBC_BOR;
EDBPrint (L"BOR on\n");
} else if (StriCmp (CommandArg, L"off") == 0) {
DebuggerPrivate->FeatureFlags &= ~EFI_DEBUG_FLAG_EBC_B_BOR;
EDBPrint (L"BOR off\n");
} else {
EDBPrint (L"BOR - argument error\n");
}
//
// Done
//
return EFI_DEBUG_CONTINUE;
}
EFI_DEBUG_STATUS
DebuggerBreakOnEntrypoint (
IN CHAR16 *CommandArg,
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
/*++
Routine Description:
DebuggerCommand - BreakOnEntrypoint
Arguments:
CommandArg - The argument for this command
DebuggerPrivate - EBC Debugger private data structure
InterruptType - Interrupt type.
SystemContext - EBC system context.
Returns:
EFI_DEBUG_CONTINUE - formal return value
--*/
{
//
// Check argument
//
if (CommandArg == NULL) {
if ((DebuggerPrivate->FeatureFlags & EFI_DEBUG_FLAG_EBC_BOE) == EFI_DEBUG_FLAG_EBC_BOE) {
EDBPrint (L"BOE on\n");
} else {
EDBPrint (L"BOE off\n");
}
} else if (StriCmp (CommandArg, L"on") == 0) {
DebuggerPrivate->FeatureFlags |= EFI_DEBUG_FLAG_EBC_BOE;
EDBPrint (L"BOE on\n");
} else if (StriCmp (CommandArg, L"off") == 0) {
DebuggerPrivate->FeatureFlags &= ~EFI_DEBUG_FLAG_EBC_B_BOE;
EDBPrint (L"BOE off\n");
} else {
EDBPrint (L"BOE - argument error\n");
}
//
// Done
//
return EFI_DEBUG_CONTINUE;
}
EFI_DEBUG_STATUS
DebuggerBreakOnThunk (
IN CHAR16 *CommandArg,
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
/*++
Routine Description:
DebuggerCommand - BreakOnThunk
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
//
if (CommandArg == NULL) {
if ((DebuggerPrivate->FeatureFlags & EFI_DEBUG_FLAG_EBC_BOT) == EFI_DEBUG_FLAG_EBC_BOT) {
EDBPrint (L"BOT on\n");
} else {
EDBPrint (L"BOT off\n");
}
} else if (StriCmp (CommandArg, L"on") == 0) {
DebuggerPrivate->FeatureFlags |= EFI_DEBUG_FLAG_EBC_BOT;
EDBPrint (L"BOT on\n");
} else if (StriCmp (CommandArg, L"off") == 0) {
DebuggerPrivate->FeatureFlags &= ~EFI_DEBUG_FLAG_EBC_B_BOT;
EDBPrint (L"BOT off\n");
} else {
EDBPrint (L"BOT - argument error\n");
}
//
// Done
//
return EFI_DEBUG_CONTINUE;
}
EFI_DEBUG_STATUS
DebuggerBreakOnKey (
IN CHAR16 *CommandArg,
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
/*++
Routine Description:
DebuggerCommand - BreakOnKey
Arguments:
CommandArg - The argument for this command
DebuggerPrivate - EBC Debugger private data structure
InterruptType - Interrupt type.
SystemContext - EBC system context.
Returns:
EFI_DEBUG_CONTINUE - formal return value
--*/
{
//
// Check argument
//
if (CommandArg == NULL) {
if ((DebuggerPrivate->FeatureFlags & EFI_DEBUG_FLAG_EBC_BOK) == EFI_DEBUG_FLAG_EBC_BOK) {
EDBPrint (L"BOK on\n");
} else {
EDBPrint (L"BOK off\n");
}
} else if (StriCmp (CommandArg, L"on") == 0) {
DebuggerPrivate->FeatureFlags |= EFI_DEBUG_FLAG_EBC_BOK;
EDBPrint (L"BOK on\n");
} else if (StriCmp (CommandArg, L"off") == 0) {
DebuggerPrivate->FeatureFlags &= ~EFI_DEBUG_FLAG_EBC_B_BOK;
EDBPrint (L"BOK off\n");
} else {
EDBPrint (L"BOK - argument error\n");
}
//
// Done
//
return EFI_DEBUG_CONTINUE;
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,219 @@
/*++
Copyright (c) 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdbCmdExtIo.c
Abstract:
--*/
#include "Edb.h"
EFI_DEBUG_STATUS
DebuggerExtIoIB (
IN CHAR16 *CommandArg,
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
/*++
Routine Description:
DebuggerCommand - IB
Arguments:
CommandArg - The argument for this command
DebuggerPrivate - EBC Debugger private data structure
InterruptType - Interrupt type.
SystemContext - EBC system context.
Returns:
EFI_DEBUG_CONTINUE - formal return value
--*/
{
EDBPrint (L"Unsupported\n");
//
// TBD
//
return EFI_DEBUG_CONTINUE;
}
EFI_DEBUG_STATUS
DebuggerExtIoIW (
IN CHAR16 *CommandArg,
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
/*++
Routine Description:
DebuggerCommand - IW
Arguments:
CommandArg - The argument for this command
DebuggerPrivate - EBC Debugger private data structure
InterruptType - Interrupt type.
SystemContext - EBC system context.
Returns:
EFI_DEBUG_CONTINUE - formal return value
--*/
{
EDBPrint (L"Unsupported\n");
//
// TBD
//
return EFI_DEBUG_CONTINUE;
}
EFI_DEBUG_STATUS
DebuggerExtIoID (
IN CHAR16 *CommandArg,
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
/*++
Routine Description:
DebuggerCommand - ID
Arguments:
CommandArg - The argument for this command
DebuggerPrivate - EBC Debugger private data structure
InterruptType - Interrupt type.
SystemContext - EBC system context.
Returns:
EFI_DEBUG_CONTINUE - formal return value
--*/
{
EDBPrint (L"Unsupported\n");
//
// TBD
//
return EFI_DEBUG_CONTINUE;
}
EFI_DEBUG_STATUS
DebuggerExtIoOB (
IN CHAR16 *CommandArg,
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
/*++
Routine Description:
DebuggerCommand - OB
Arguments:
CommandArg - The argument for this command
DebuggerPrivate - EBC Debugger private data structure
InterruptType - Interrupt type.
SystemContext - EBC system context.
Returns:
EFI_DEBUG_CONTINUE - formal return value
--*/
{
EDBPrint (L"Unsupported\n");
//
// TBD
//
return EFI_DEBUG_CONTINUE;
}
EFI_DEBUG_STATUS
DebuggerExtIoOW (
IN CHAR16 *CommandArg,
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
/*++
Routine Description:
DebuggerCommand - OW
Arguments:
CommandArg - The argument for this command
DebuggerPrivate - EBC Debugger private data structure
InterruptType - Interrupt type.
SystemContext - EBC system context.
Returns:
EFI_DEBUG_CONTINUE - formal return value
--*/
{
EDBPrint (L"Unsupported\n");
//
// TBD
//
return EFI_DEBUG_CONTINUE;
}
EFI_DEBUG_STATUS
DebuggerExtIoOD (
IN CHAR16 *CommandArg,
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
/*++
Routine Description:
DebuggerCommand - OD
Arguments:
CommandArg - The argument for this command
DebuggerPrivate - EBC Debugger private data structure
InterruptType - Interrupt type.
SystemContext - EBC system context.
Returns:
EFI_DEBUG_CONTINUE - formal return value
--*/
{
EDBPrint (L"Unsupported\n");
//
// TBD
//
return EFI_DEBUG_CONTINUE;
}
@@ -0,0 +1,186 @@
/*++
Copyright (c) 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdbCmdExtPci.c
Abstract:
--*/
#include "Edb.h"
EFI_DEBUG_STATUS
DebuggerExtPciPCIL (
IN CHAR16 *CommandArg,
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
/*++
Routine Description:
DebuggerCommand - PCIL
Arguments:
CommandArg - The argument for this command
DebuggerPrivate - EBC Debugger private data structure
InterruptType - Interrupt type.
SystemContext - EBC system context.
Returns:
EFI_DEBUG_CONTINUE - formal return value
--*/
{
EDBPrint (L"Unsupported\n");
//
// TBD
//
return EFI_DEBUG_CONTINUE;
}
EFI_DEBUG_STATUS
DebuggerExtPciPCID (
IN CHAR16 *CommandArg,
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
/*++
Routine Description:
DebuggerCommand - PCID
Arguments:
CommandArg - The argument for this command
DebuggerPrivate - EBC Debugger private data structure
InterruptType - Interrupt type.
SystemContext - EBC system context.
Returns:
EFI_DEBUG_CONTINUE - formal return value
--*/
{
EDBPrint (L"Unsupported\n");
//
// TBD
//
return EFI_DEBUG_CONTINUE;
}
EFI_DEBUG_STATUS
DebuggerExtPciCFGB (
IN CHAR16 *CommandArg,
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
/*++
Routine Description:
DebuggerCommand - CFGB
Arguments:
CommandArg - The argument for this command
DebuggerPrivate - EBC Debugger private data structure
InterruptType - Interrupt type.
SystemContext - EBC system context.
Returns:
EFI_DEBUG_CONTINUE - formal return value
--*/
{
EDBPrint (L"Unsupported\n");
//
// TBD
//
return EFI_DEBUG_CONTINUE;
}
EFI_DEBUG_STATUS
DebuggerExtPciCFGW (
IN CHAR16 *CommandArg,
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
/*++
Routine Description:
DebuggerCommand - CFGW
Arguments:
CommandArg - The argument for this command
DebuggerPrivate - EBC Debugger private data structure
InterruptType - Interrupt type.
SystemContext - EBC system context.
Returns:
EFI_DEBUG_CONTINUE - formal return value
--*/
{
EDBPrint (L"Unsupported\n");
//
// TBD
//
return EFI_DEBUG_CONTINUE;
}
EFI_DEBUG_STATUS
DebuggerExtPciCFGD (
IN CHAR16 *CommandArg,
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
/*++
Routine Description:
DebuggerCommand - CFGD
Arguments:
CommandArg - The argument for this command
DebuggerPrivate - EBC Debugger private data structure
InterruptType - Interrupt type.
SystemContext - EBC system context.
Returns:
EFI_DEBUG_CONTINUE - formal return value
--*/
{
EDBPrint (L"Unsupported\n");
//
// TBD
//
return EFI_DEBUG_CONTINUE;
}
@@ -0,0 +1,93 @@
/*++
Copyright (c) 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdbCmdGo.c
Abstract:
--*/
#include "Edb.h"
EFI_DEBUG_STATUS
DebuggerGo (
IN CHAR16 *CommandArg,
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
/*++
Routine Description:
DebuggerCommand - Go
Arguments:
CommandArg - The argument for this command
DebuggerPrivate - EBC Debugger private data structure
InterruptType - Interrupt type.
SystemContext - EBC system context.
Returns:
EFI_DEBUG_BREAK - formal return value
EFI_DEBUG_CONTINUE - something wrong
--*/
{
UINTN Address;
CHAR16 *CommandStr;
EFI_STATUS Status;
//
// Check argument
//
if (CommandArg != NULL) {
if (StriCmp (CommandArg, L"til") == 0) {
CommandStr = StrGetNextTokenLine (L" ");
if (CommandStr != NULL) {
//
// Enable GoTil break now
// set BreakAddress, and set feature flag.
//
Status = Symboltoi (CommandStr, &Address);
if (EFI_ERROR (Status)) {
if (Status == EFI_NOT_FOUND) {
Address = Xtoi(CommandStr);
} else {
//
// Something wrong, let Symboltoi print error info.
//
EDBPrint (L"Command Argument error!\n");
return EFI_DEBUG_CONTINUE;
}
}
DebuggerPrivate->GoTilContext.BreakAddress = Address;
DebuggerPrivate->FeatureFlags |= EFI_DEBUG_FLAG_EBC_GT;
} else {
EDBPrint (L"Command Argument error!\n");
return EFI_DEBUG_CONTINUE;
}
} else {
EDBPrint (L"Command Argument error!\n");
return EFI_DEBUG_CONTINUE;
}
}
//
// Done
//
return EFI_DEBUG_BREAK;
}
@@ -0,0 +1,86 @@
/*++
Copyright (c) 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdbCmdHelp.c
Abstract:
--*/
#include "Edb.h"
EFI_DEBUG_STATUS
DebuggerHelp (
IN CHAR16 *CommandArg,
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
/*++
Routine Description:
DebuggerCommand - Help
Arguments:
CommandArg - The argument for this command
DebuggerPrivate - EBC Debugger private data structure
InterruptType - Interrupt type.
SystemContext - EBC system context.
Returns:
EFI_DEBUG_CONTINUE - formal return value
--*/
{
UINTN Index;
//
// if no argument, print all the command title
//
if (CommandArg == NULL) {
for (Index = 0; DebuggerPrivate->DebuggerCommandSet[Index].CommandName != NULL; Index++) {
EDBPrint (DebuggerPrivate->DebuggerCommandSet[Index].ClassName);
if (StrCmp (DebuggerPrivate->DebuggerCommandSet[Index].CommandTitle, L"") != 0) {
EDBPrint (L" ");
EDBPrint (DebuggerPrivate->DebuggerCommandSet[Index].CommandTitle);
}
}
return EFI_DEBUG_CONTINUE;
}
//
// If there is argument, the argument should be command name.
// Find the command and print the detail information.
//
for (Index = 0; DebuggerPrivate->DebuggerCommandSet[Index].CommandName != NULL; Index++) {
if (StriCmp (CommandArg, DebuggerPrivate->DebuggerCommandSet[Index].CommandName) == 0) {
EDBPrint (DebuggerPrivate->DebuggerCommandSet[Index].CommandHelp);
EDBPrint (DebuggerPrivate->DebuggerCommandSet[Index].CommandSyntax);
return EFI_DEBUG_CONTINUE;
}
}
//
// Command not found.
//
EDBPrint (L"No help info for this command\n");
//
// Done
//
return EFI_DEBUG_CONTINUE;
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,50 @@
/*++
Copyright (c) 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdbCmdQuit.c
Abstract:
--*/
#include "Edb.h"
EFI_DEBUG_STATUS
DebuggerQuit (
IN CHAR16 *CommandArg,
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
/*++
Routine Description:
DebuggerCommand - Quit
Arguments:
CommandArg - The argument for this command
DebuggerPrivate - EBC Debugger private data structure
InterruptType - Interrupt type.
SystemContext - EBC system context.
Returns:
EFI_DEBUG_RETURN - formal return value
--*/
{
return EFI_DEBUG_RETURN;
}
@@ -0,0 +1,136 @@
/*++
Copyright (c) 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdbCmdRegister.c
Abstract:
--*/
#include "Edb.h"
EFI_DEBUG_STATUS
DebuggerRegister (
IN CHAR16 *CommandArg,
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
/*++
Routine Description:
DebuggerCommand - Register
Arguments:
CommandArg - The argument for this command
DebuggerPrivate - EBC Debugger private data structure
InterruptType - Interrupt type.
SystemContext - EBC system context.
Returns:
EFI_DEBUG_CONTINUE - formal return value
--*/
{
CHAR16 *RegName;
CHAR16 *RegValStr;
UINT64 RegVal;
//
// Check Argument, NULL means print all register
//
if (CommandArg == 0) {
EDBPrint (
L" R0 - 0x%016lx, R1 - 0x%016lx\n",
SystemContext.SystemContextEbc->R0,
SystemContext.SystemContextEbc->R1
);
EDBPrint (
L" R2 - 0x%016lx, R3 - 0x%016lx\n",
SystemContext.SystemContextEbc->R2,
SystemContext.SystemContextEbc->R3
);
EDBPrint (
L" R4 - 0x%016lx, R5 - 0x%016lx\n",
SystemContext.SystemContextEbc->R4,
SystemContext.SystemContextEbc->R5
);
EDBPrint (
L" R6 - 0x%016lx, R7 - 0x%016lx\n",
SystemContext.SystemContextEbc->R6,
SystemContext.SystemContextEbc->R7
);
EDBPrint (
L" Flags - 0x%016lx, ControlFlags - 0x%016lx\n",
SystemContext.SystemContextEbc->Flags,
SystemContext.SystemContextEbc->ControlFlags
);
EDBPrint (
L" Ip - 0x%016lx\n",
SystemContext.SystemContextEbc->Ip
);
return EFI_DEBUG_CONTINUE;
}
//
// Get register name
//
RegName = CommandArg;
//
// Get register value
//
RegValStr = StrGetNextTokenLine (L" ");
if (RegValStr == NULL) {
EDBPrint (L"Invalid Register Value\n");
return EFI_DEBUG_CONTINUE;
}
RegVal = LXtoi (RegValStr);
//
// Assign register value
//
if (StriCmp (RegName, L"R0") == 0) {
SystemContext.SystemContextEbc->R0 = RegVal;
} else if (StriCmp (RegName, L"R1") == 0) {
SystemContext.SystemContextEbc->R1 = RegVal;
} else if (StriCmp (RegName, L"R2") == 0) {
SystemContext.SystemContextEbc->R2 = RegVal;
} else if (StriCmp (RegName, L"R3") == 0) {
SystemContext.SystemContextEbc->R3 = RegVal;
} else if (StriCmp (RegName, L"R4") == 0) {
SystemContext.SystemContextEbc->R4 = RegVal;
} else if (StriCmp (RegName, L"R5") == 0) {
SystemContext.SystemContextEbc->R5 = RegVal;
} else if (StriCmp (RegName, L"R6") == 0) {
SystemContext.SystemContextEbc->R6 = RegVal;
} else if (StriCmp (RegName, L"R7") == 0) {
SystemContext.SystemContextEbc->R7 = RegVal;
} else if (StriCmp (RegName, L"Flags") == 0) {
SystemContext.SystemContextEbc->Flags = RegVal;
} else if (StriCmp (RegName, L"ControlFlags") == 0) {
SystemContext.SystemContextEbc->ControlFlags = RegVal;
} else if (StriCmp (RegName, L"Ip") == 0) {
SystemContext.SystemContextEbc->Ip = RegVal;
} else {
EDBPrint (L"Invalid Register - %s\n", RegName);
}
//
// Done
//
return EFI_DEBUG_CONTINUE;
}
@@ -0,0 +1,123 @@
/*++
Copyright (c) 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdbCmdScope.c
Abstract:
--*/
#include "Edb.h"
EFI_DEBUG_STATUS
DebuggerScope (
IN CHAR16 *CommandArg,
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
/*++
Routine Description:
DebuggerCommand - Scope
Arguments:
CommandArg - The argument for this command
DebuggerPrivate - EBC Debugger private data structure
InterruptType - Interrupt type.
SystemContext - EBC system context.
Returns:
EFI_DEBUG_CONTINUE - formal return value
--*/
{
EFI_STATUS Status;
UINTN Address;
if (CommandArg == NULL) {
EDBPrint (L"Scope: invalid Address\n");
return EFI_DEBUG_CONTINUE;
}
//
// Load new scope
//
Status = Symboltoi (CommandArg, &Address);
if (EFI_ERROR (Status)) {
if (Status == EFI_NOT_FOUND) {
Address = Xtoi(CommandArg);
} else {
//
// Something wrong, let Symboltoi print error info.
//
EDBPrint (L"Command Argument error!\n");
return EFI_DEBUG_CONTINUE;
}
}
DebuggerPrivate->InstructionScope = Address;
EDBPrint (L"Scope: 0x%x\n", DebuggerPrivate->InstructionScope);
EdbShowDisasm (DebuggerPrivate, SystemContext);
//
// Done
//
return EFI_DEBUG_CONTINUE;
}
EFI_DEBUG_STATUS
DebuggerList (
IN CHAR16 *CommandArg,
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
/*++
Routine Description:
DebuggerCommand - List
Arguments:
CommandArg - The argument for this command
DebuggerPrivate - EBC Debugger private data structure
InterruptType - Interrupt type.
SystemContext - EBC system context.
Returns:
EFI_DEBUG_CONTINUE - formal return value
--*/
{
if (CommandArg == NULL) {
EdbShowDisasm (DebuggerPrivate, SystemContext);
} else {
//
// Load new list number
//
DebuggerPrivate->InstructionNumber = Atoi(CommandArg);
EDBPrint (L"List Number: %d\n", DebuggerPrivate->InstructionNumber);
EdbShowDisasm (DebuggerPrivate, SystemContext);
}
//
// Done
//
return EFI_DEBUG_CONTINUE;
}
@@ -0,0 +1,198 @@
/*++
Copyright (c) 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdbCmdStep.c
Abstract:
--*/
#include "Edb.h"
BOOLEAN
IsEBCCALL (
IN UINTN Address
)
/*++
Routine Description:
Check whether current IP is EBC CALL instruction (NOTE: CALLEX is exclusive)
Arguments:
Address - EBC IP address.
Returns:
TRUE - Current IP is EBC CALL instruction
FALSE - Current IP is not EBC CALL instruction
--*/
{
if (GET_OPCODE(Address) != OPCODE_CALL) {
return FALSE;
}
if (GET_OPERANDS (Address) & OPERAND_M_NATIVE_CALL) {
return FALSE;
} else {
return TRUE;
}
}
BOOLEAN
IsEBCRET (
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) {
return FALSE;
}
if (GET_OPERANDS (Address) != 0) {
return FALSE;
} else {
return TRUE;
}
}
EFI_DEBUG_STATUS
DebuggerStepInto (
IN CHAR16 *CommandArg,
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
/*++
Routine Description:
DebuggerCommand - StepInto
Arguments:
CommandArg - The argument for this command
DebuggerPrivate - EBC Debugger private data structure
InterruptType - Interrupt type.
SystemContext - EBC system context.
Returns:
EFI_DEBUG_CONTINUE - formal return value
--*/
{
SystemContext.SystemContextEbc->Flags |= VMFLAGS_STEP;
return EFI_DEBUG_BREAK;
}
EFI_DEBUG_STATUS
DebuggerStepOver (
IN CHAR16 *CommandArg,
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
/*++
Routine Description:
DebuggerCommand - StepOver
Arguments:
CommandArg - The argument for this command
DebuggerPrivate - EBC Debugger private data structure
InterruptType - Interrupt type.
SystemContext - EBC system context.
Returns:
EFI_DEBUG_CONTINUE - formal return value
--*/
{
if (IsEBCCALL((UINTN)SystemContext.SystemContextEbc->Ip)) {
//
// Check CALL (NOTE: CALLEX is exclusive)
//
DebuggerPrivate->FeatureFlags |= EFI_DEBUG_FLAG_EBC_STEPOVER;
} else {
//
// Other instruction including CALLEX
//
SystemContext.SystemContextEbc->Flags |= VMFLAGS_STEP;
}
return EFI_DEBUG_BREAK;
}
EFI_DEBUG_STATUS
DebuggerStepOut (
IN CHAR16 *CommandArg,
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate,
IN EFI_EXCEPTION_TYPE ExceptionType,
IN OUT EFI_SYSTEM_CONTEXT SystemContext
)
/*++
Routine Description:
DebuggerCommand - StepOut
Arguments:
CommandArg - The argument for this command
DebuggerPrivate - EBC Debugger private data structure
InterruptType - Interrupt type.
SystemContext - EBC system context.
Returns:
EFI_DEBUG_CONTINUE - formal return value
--*/
{
if (IsEBCRET((UINTN)SystemContext.SystemContextEbc->Ip)) {
//
// Check RET
//
SystemContext.SystemContextEbc->Flags |= VMFLAGS_STEP;
} else {
//
// Other instruction
//
DebuggerPrivate->FeatureFlags |= EFI_DEBUG_FLAG_EBC_STEPOUT;
}
return EFI_DEBUG_BREAK;
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,106 @@
/*++
Copyright (c) 2007, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
EdbCommand.h
Abstract:
--*/
#ifndef _EFI_EDB_COMMAND_H_
#define _EFI_EDB_COMMAND_H_
typedef enum {
EdbWidthUint8,
EdbWidthUint16,
EdbWidthUint32,
EdbWidthUint64,
EdbWidthMax
} EDB_DATA_WIDTH;
EFI_DEBUGGER_COMMAND
MatchDebuggerCommand (
IN CHAR16 *CommandName,
IN CHAR16 **CommandArg
);
CHAR16 *
GetCommandNameByKey (
IN EFI_INPUT_KEY CommandKey
);
//
// Definition for Command Table
//
#define EDB_COMMAND_DEFINE(func) \
EFI_DEBUG_STATUS \
func ( \
IN CHAR16 *CommandArg, \
IN EFI_DEBUGGER_PRIVATE_DATA *DebuggerPrivate, \
IN EFI_EXCEPTION_TYPE ExceptionType, \
IN OUT EFI_SYSTEM_CONTEXT SystemContext \
)
EDB_COMMAND_DEFINE (DebuggerCallStack);
EDB_COMMAND_DEFINE (DebuggerInstructionBranch);
EDB_COMMAND_DEFINE (DebuggerBreakOnCALL);
EDB_COMMAND_DEFINE (DebuggerBreakOnCALLEX);
EDB_COMMAND_DEFINE (DebuggerBreakOnRET);
EDB_COMMAND_DEFINE (DebuggerBreakOnEntrypoint);
EDB_COMMAND_DEFINE (DebuggerBreakOnThunk);
EDB_COMMAND_DEFINE (DebuggerBreakOnKey);
EDB_COMMAND_DEFINE (DebuggerBreakpointList);
EDB_COMMAND_DEFINE (DebuggerBreakpointSet);
EDB_COMMAND_DEFINE (DebuggerBreakpointClear);
EDB_COMMAND_DEFINE (DebuggerBreakpointDisable);
EDB_COMMAND_DEFINE (DebuggerBreakpointEnable);
EDB_COMMAND_DEFINE (DebuggerGo);
EDB_COMMAND_DEFINE (DebuggerHelp);
EDB_COMMAND_DEFINE (DebuggerMemoryDB);
EDB_COMMAND_DEFINE (DebuggerMemoryDW);
EDB_COMMAND_DEFINE (DebuggerMemoryDD);
EDB_COMMAND_DEFINE (DebuggerMemoryDQ);
EDB_COMMAND_DEFINE (DebuggerMemoryEB);
EDB_COMMAND_DEFINE (DebuggerMemoryEW);
EDB_COMMAND_DEFINE (DebuggerMemoryED);
EDB_COMMAND_DEFINE (DebuggerMemoryEQ);
EDB_COMMAND_DEFINE (DebuggerQuit);
EDB_COMMAND_DEFINE (DebuggerRegister);
EDB_COMMAND_DEFINE (DebuggerScope);
EDB_COMMAND_DEFINE (DebuggerList);
EDB_COMMAND_DEFINE (DebuggerStepInto);
EDB_COMMAND_DEFINE (DebuggerStepOver);
EDB_COMMAND_DEFINE (DebuggerStepOut);
EDB_COMMAND_DEFINE (DebuggerListSymbol);
EDB_COMMAND_DEFINE (DebuggerLoadSymbol);
EDB_COMMAND_DEFINE (DebuggerUnloadSymbol);
EDB_COMMAND_DEFINE (DebuggerDisplaySymbol);
EDB_COMMAND_DEFINE (DebuggerLoadCode);
EDB_COMMAND_DEFINE (DebuggerUnloadCode);
EDB_COMMAND_DEFINE (DebuggerDisplayCode);
EDB_COMMAND_DEFINE (DebuggerExtIoIB);
EDB_COMMAND_DEFINE (DebuggerExtIoIW);
EDB_COMMAND_DEFINE (DebuggerExtIoID);
EDB_COMMAND_DEFINE (DebuggerExtIoOB);
EDB_COMMAND_DEFINE (DebuggerExtIoOW);
EDB_COMMAND_DEFINE (DebuggerExtIoOD);
EDB_COMMAND_DEFINE (DebuggerExtPciPCIL);
EDB_COMMAND_DEFINE (DebuggerExtPciPCID);
EDB_COMMAND_DEFINE (DebuggerExtPciCFGB);
EDB_COMMAND_DEFINE (DebuggerExtPciCFGW);
EDB_COMMAND_DEFINE (DebuggerExtPciCFGD);
extern EFI_DEBUGGER_COMMAND_SET mDebuggerCommandSet[];
#endif

Some files were not shown because too many files have changed in this diff Show More