Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .azurepipelines/Windows-VS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
##

variables:
- group: architectures-arm64-x86-64
- group: architectures-x86-64
- group: tool-chain-windows-visual-studio-latest
- group: coverage

Expand Down
34 changes: 34 additions & 0 deletions DebuggerFeaturePkg/DebugAgentPei/DebugAgentPei.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/** @file
Comment thread
cfernald marked this conversation as resolved.
Thin PEIM wrapper that invokes the PEI debug agent library.

This PEIM is dispatched after permanent memory is available (DEPEX on
gEfiPeiMemoryDiscoveredPpiGuid). It simply calls InitializeDebugAgent
to let the library perform all initialization.

Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent

**/

#include <PiPei.h>
#include <Library/DebugAgentLib.h>

/**
PEIM entry point. Invokes the debug agent library initialization.

@param[in] FileHandle Handle of the file being loaded.
@param[in] PeiServices Pointer to PEI Services table.

@retval EFI_SUCCESS Debug agent initialized successfully.

**/
EFI_STATUS
EFIAPI
DebugAgentPeiEntry (
IN EFI_PEI_FILE_HANDLE FileHandle,
IN CONST EFI_PEI_SERVICES **PeiServices
)
{
InitializeDebugAgent (DEBUG_AGENT_INIT_PEI, NULL, NULL);
return EFI_SUCCESS;
}
38 changes: 38 additions & 0 deletions DebuggerFeaturePkg/DebugAgentPei/DebugAgentPei.inf
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## @file
#
# Thin PEIM wrapper for the PEI debug agent. All logic lives in
# DebugAgentLib (PeiDebugAgentLib). This PEIM is dispatched after
# permanent memory is installed.
#
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##


[Defines]
INF_VERSION = 1.27
BASE_NAME = DebugAgentPei
FILE_GUID = 7A4F8B72-E12D-4A62-B5C4-D43F89735E28
MODULE_TYPE = PEIM
VERSION_STRING = 1.0
ENTRY_POINT = DebugAgentPeiEntry

[Sources]
DebugAgentPei.c

[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
DebuggerFeaturePkg/DebuggerFeaturePkg.dec

[LibraryClasses]
PeimEntryPoint
DebugAgentLib
PrintLib
Comment thread
cfernald marked this conversation as resolved.

[Ppis]
gEfiPeiMemoryDiscoveredPpiGuid ## CONSUMES
Comment thread
cfernald marked this conversation as resolved.

[Depex]
gEfiPeiMemoryDiscoveredPpiGuid
4 changes: 4 additions & 0 deletions DebuggerFeaturePkg/DebuggerFeaturePkg.dec
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@
# phase implementation.
DebuggerFeaturePkgTokenSpaceGuid.PcdForceEnableDebugger|FALSE|BOOLEAN|0x00000003

## Forcibly enables the PEI debugger. This is the only way to enable the PEI
# phase debugger. No HOB or dynamic configuration is supported for PEI.
DebuggerFeaturePkgTokenSpaceGuid.PcdForceEnablePeiDebugger|FALSE|BOOLEAN|0x00000005

## Enabled work-arounds in the debugger for bugs in windbg's GDB implementation.
# This should not break GDB debuggers, but may cause slightly unexpected behavior.
DebuggerFeaturePkgTokenSpaceGuid.PcdEnableWindbgWorkarounds|TRUE|BOOLEAN|0x00000004
12 changes: 12 additions & 0 deletions DebuggerFeaturePkg/DebuggerFeaturePkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@
WatchdogTimerLib|DebuggerFeaturePkg/Library/WatchdogTimerLibNull/WatchdogTimerLibNull.inf
TransportLogControlLib|DebuggerFeaturePkg/Library/TransportLogControlLibNull/TransportLogControlLibNull.inf

CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLibNull/BaseCacheMaintenanceLibNull.inf
CpuExceptionHandlerLib|MdeModulePkg/Library/CpuExceptionHandlerLibNull/CpuExceptionHandlerLibNull.inf
SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf
PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
HwResetSystemLib|MdeModulePkg/Library/BaseResetSystemLibNull/BaseResetSystemLibNull.inf

StackCheckLib|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf

[LibraryClasses.common.PEIM]
Expand All @@ -54,3 +61,8 @@
[Components.X64, Components.AARCH64]
DebuggerFeaturePkg/Library/DebugAgent/DebugAgentDxe.inf
DebuggerFeaturePkg/Library/DebugAgent/DebugAgentMm.inf
DebuggerFeaturePkg/Library/DebugAgent/DebugAgentPeiLib.inf
DebuggerFeaturePkg/DebugAgentPei/DebugAgentPei.inf {
<LibraryClasses>
DebugAgentLib|DebuggerFeaturePkg/Library/DebugAgent/DebugAgentPeiLib.inf
}
16 changes: 7 additions & 9 deletions DebuggerFeaturePkg/Library/DebugAgent/AARCH64/DebugAarch64.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

**/

#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h>
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/WatchdogTimerLib.h>
Expand Down Expand Up @@ -54,10 +52,10 @@ typedef union _DBG_WCR {
// Structures used by the arch-agnostic code.
//

UINT8 ArchBreakpointInstruction[] = { 0x00, 0x00, 0x3E, 0xD4 };
UINTN ArchBreakpointInstructionSize = sizeof (ArchBreakpointInstruction);
UINT8 mArchBreakpointInstruction[] = { 0x00, 0x00, 0x3E, 0xD4 };
UINTN mArchBreakpointInstructionSize = sizeof (mArchBreakpointInstruction);

UINT32 ArchExceptionTypes[] = {
UINT32 mArchExceptionTypes[] = {
EXCEPT_AARCH64_SYNCHRONOUS_EXCEPTIONS,
MAX_UINT32 // End of list
};
Expand Down Expand Up @@ -106,8 +104,8 @@ DEBUG_WATCHPOINT_REGISTERS DebugWatchpointRegisters[] = {
VOID
EFIAPI
DebuggerExceptionHandler (
EFI_EXCEPTION_TYPE InterruptType,
EFI_SYSTEM_CONTEXT SystemContext
IN EFI_EXCEPTION_TYPE InterruptType,
IN EFI_SYSTEM_CONTEXT SystemContext
)
{
EFI_SYSTEM_CONTEXT_AARCH64 *Context;
Expand Down Expand Up @@ -194,9 +192,9 @@ DebuggerExceptionHandler (
//

if ((ExceptionType == 0x3c) &&
(CompareMem ((UINT8 *)Context->ELR, &ArchBreakpointInstruction[0], ArchBreakpointInstructionSize) == 0))
(CompareMem ((UINT8 *)Context->ELR, &mArchBreakpointInstruction[0], mArchBreakpointInstructionSize) == 0))
{
Context->ELR += ArchBreakpointInstructionSize;
Context->ELR += mArchBreakpointInstructionSize;
}

//
Expand Down
201 changes: 0 additions & 201 deletions DebuggerFeaturePkg/Library/DebugAgent/AARCH64/Registers.masm

This file was deleted.

Loading
Loading