efi_loader: add dbginfodump.efi
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Tue, 29 Apr 2025 08:41:38 +0000 (10:41 +0200)
committerIlias Apalodimas <ilias.apalodimas@linaro.org>
Thu, 3 Jul 2025 09:26:45 +0000 (12:26 +0300)
commit95732f2bf8700f9ec17983b419073b6a16b79aef
treec724c584750b3f0d1d6e786bc9c0243557c847e3
parent2e5ca84aad3df9f3d6e1f844a29012d42291b42b
efi_loader: add dbginfodump.efi

Provide a test application to dump the EFI_DEBUG_IMAGE_INFO_TABLE
as implemented in EDK II.

EFI_DEBUG_IMAGE_INFO is not packed in contrast to many other EFI
structures.

As of today EDK II when removing an entry in the EfiDebugImageInfoTable
just sets NormalImage = NULL but does not compact the array. So
TableSize reflects the number of non-NULL entries and not the array
size as reported independently in
https://github.com/tianocore/edk2/pull/11013 and
https://github.com/tianocore/edk2/pull/11019.

The current implementation tolerates this deviation from the UEFI
specification.

This is what the output may look like:

    Debug Info Table Dump
    =====================

    => dump
    Modified
    Number of entries: 0x0000004a
    Info type 0x00000001
      Address: [0x000000008315a000, 0x00000000831bafff]
      File: FvFile(D6A2CB7F-6A18-4E2F-B43B-9920A733700A)
      Handle: 0x000000017fe3cb18
    ...
    Info type 0x00000001
      Address: [0x000000017e8db000, 0x000000017ea00f3f]
      File: FvFile(7C04A583-9E3E-4F1C-AD65-E05268D0B4D1)
      Handle: 0x000000017f358e98
    Info type 0x00000001
      Address: [0x000000017eae5000, 0x000000017eae81ff]
      File: \dbginfodump.efi
      Handle: 0x000000017eaf0298
    =>

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
lib/efi_loader/Makefile
lib/efi_loader/dbginfodump.c [new file with mode: 0644]