public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] UefiPayloadPkg debugging
@ 2025-03-17 11:01 Stepan via groups.io
  2025-03-18  4:20 ` Stepan via groups.io
  0 siblings, 1 reply; 5+ messages in thread
From: Stepan via groups.io @ 2025-03-17 11:01 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 4532 bytes --]

Hello EDK2 community,

I have encountered a strange error. I am trying to activate source code debugging with the following changes:

Index: UefiPayloadPkg/UefiPayloadPkg.dsc
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc
--- a/UefiPayloadPkg/UefiPayloadPkg.dsc	(revision f19361fd31354003185eef2dba6374805bc6ca9f)
+++ b/UefiPayloadPkg/UefiPayloadPkg.dsc	(revision 111c1f14db9b0876f66640101fcb2d498d65e8dd)
@@ -26,7 +26,7 @@
  FLASH_DEFINITION                    = UefiPayloadPkg/UefiPayloadPkg.fdf
  PCD_DYNAMIC_AS_DYNAMICEX            = TRUE

-  DEFINE SOURCE_DEBUG_ENABLE          = FALSE
+  DEFINE SOURCE_DEBUG_ENABLE          = TRUE
  DEFINE PS2_KEYBOARD_ENABLE          = TRUE
  DEFINE RAM_DISK_ENABLE              = FALSE
  DEFINE SIO_BUS_ENABLE               = TRUE
@@ -59,7 +59,7 @@
  #
  DEFINE UNIVERSAL_PAYLOAD            = TRUE
  #DEFINE UNIVERSAL_PAYLOAD            = FALSE
-  DEFINE UNIVERSAL_PAYLOAD_FORMAT     = ELF
+  DEFINE UNIVERSAL_PAYLOAD_FORMAT     = FIT

  #
  # NULL:    NullMemoryTestDxe
@@ -293,6 +293,7 @@
!if $(SOURCE_DEBUG_ENABLE) == TRUE
  PeCoffExtraActionLib|SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug/PeCoffExtraActionLibDebug.inf
  DebugCommunicationLib|SourceLevelDebugPkg/Library/DebugCommunicationLibSerialPort/DebugCommunicationLibSerialPort.inf
+  DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf
!else
  PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf
  DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf
@@ -435,6 +436,10 @@
  PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf
  SmmServicesTableLib|MdeModulePkg/Library/PiSmmCoreSmmServicesTableLib/PiSmmCoreSmmServicesTableLib.inf

+  !if $(SOURCE_DEBUG_ENABLE)
+    DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf
+  !endif
+
  MemoryAllocationLib|MdeModulePkg/Library/PiSmmCoreMemoryAllocationLib/PiSmmCoreMemoryAllocationLib.inf
  SmmCorePlatformHookLib|MdeModulePkg/Library/SmmCorePlatformHookLibNull/SmmCorePlatformHookLibNull.inf
  SmmMemLib|MdePkg/Library/SmmMemLib/SmmMemLib.inf
@@ -449,6 +454,10 @@
!if $(SMM_SUPPORT) == TRUE
  PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf

+  !if $(SOURCE_DEBUG_ENABLE)
+    DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SmmDebugAgentLib.inf
+  !endif
+
  MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf
  SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf
  SmmMemLib|MdePkg/Library/SmmMemLib/SmmMemLib.inf

I drew information from the following sources: https://raw.githubusercontent.com/wiki/tianocore/tianocore.github.io/OSFC/Debugging_UEFI_Firmware_Linux_Workshop_OSFC_19.pdf , https://cdrdv2-public.intel.com/671474/udk-debugger-tool-user-manual-v1-11.pdf.
Building and running on the target platform causes execution to stop at the following message:

Updated SBL Performance Table: S1 = 692000000ns, S2 = 2179000000ns, OSL = 37000000ns
Payload entry: 0x008085BB
Switch to x64 mode
Jump to payload

Entering Universal Payload...
sizeof(UINTN) = 0x8
BootloaderParameter = 0x47810000
Start init Hobs...

...

HOB[63]: Type = EFI_HOB_TYPE_FV, Offset = 0x1AF0, Length = 0x18
  BaseAddress = 0xB71000
  Length      = 0x59000
There are totally 64 Hobs, the End Hob address is 42DB9B08
===============================
   PDB = /edk/Build/UefiPayloadPkg/DEBUG_GCC5/X64/MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll

Then the download is interrupted. I don't understand why this is happening. Just a few days ago it was working and the log was as follows:

...
Updated SBL Performance Table: S1 = 694000000ns, S2 = 2136000000ns, OSL = 38000000ns
Payload entry: 0x008015A8
Jump to payload

Send INIT break packet and try to connect the HOST (Intel(R) UDK Debugger Tool v1.5) ...
\xFE \x3F \x06 \x59 \xBA HOST connection is successful! ...


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121203): https://edk2.groups.io/g/devel/message/121203
Mute This Topic: https://groups.io/mt/111746873/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: Type: text/html, Size: 5549 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-03-24  6:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-17 11:01 [edk2-devel] UefiPayloadPkg debugging Stepan via groups.io
2025-03-18  4:20 ` Stepan via groups.io
2025-03-18  5:00   ` Chiu, Chasel via groups.io
2025-03-18  5:19     ` Guo Dong via groups.io
2025-03-24  6:05       ` Stepan via groups.io

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox