mu_tiano_platforms/UefiDbgExt
Michael Kubacki ccf50fc6b0
Bump MU_BASECORE from `6d6647e0` to `de31cb54` (#238)
# Preface

Please ensure you have read the [contribution
docs](https://github.com/microsoft/mu/blob/master/CONTRIBUTING.md) prior
to submitting the pull request. In particular,
[pull request
guidelines](https://github.com/microsoft/mu/blob/master/CONTRIBUTING.md#pull-request-best-practices).

## Description

Includes the following commits:

- .pytool/Plugin/LineEndingCheck: Add git ignore support
-
de31cb54ee
- .pytool/Plugin/LineEndingCheck: Fix scanning and other changes
-
a63a4f18e6
- BaseTools.ci.yaml: Exclude line ending check
-
091275ad6c
- Convert relevant files to CRLF
-
81a0070f16

This is manually updated to account for the line ending changes needed
for integration.

- [ ] Impacts functionality?
- [ ] Impacts security?
- [ ] Breaking change?
- [x] Includes tests?
- [ ] Includes documentation?

## How This Was Tested

CI status checks.

## Integration Instructions

N/A

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2023-01-13 19:44:22 -08:00
..
dbgexts.cpp Bump MU_BASECORE from `6d6647e0` to `de31cb54` (#238) 2023-01-13 19:44:22 -08:00
dbgexts.h Bump MU_BASECORE from `6d6647e0` to `de31cb54` (#238) 2023-01-13 19:44:22 -08:00
memory.cpp Bump MU_BASECORE from `6d6647e0` to `de31cb54` (#238) 2023-01-13 19:44:22 -08:00
modules.cpp Bump MU_BASECORE from `6d6647e0` to `de31cb54` (#238) 2023-01-13 19:44:22 -08:00
readme.md Bump MU_BASECORE from `6d6647e0` to `de31cb54` (#238) 2023-01-13 19:44:22 -08:00
tables.cpp Bump MU_BASECORE from `6d6647e0` to `de31cb54` (#238) 2023-01-13 19:44:22 -08:00
uefiext.cpp Bump MU_BASECORE from `6d6647e0` to `de31cb54` (#238) 2023-01-13 19:44:22 -08:00
uefiext.def Bump MU_BASECORE from `6d6647e0` to `de31cb54` (#238) 2023-01-13 19:44:22 -08:00
uefiext.h Bump MU_BASECORE from `6d6647e0` to `de31cb54` (#238) 2023-01-13 19:44:22 -08:00
uefiext.rc Bump MU_BASECORE from `6d6647e0` to `de31cb54` (#238) 2023-01-13 19:44:22 -08:00
uefiext.sln Bump MU_BASECORE from `6d6647e0` to `de31cb54` (#238) 2023-01-13 19:44:22 -08:00
uefiext.vcxproj Bump MU_BASECORE from `6d6647e0` to `de31cb54` (#238) 2023-01-13 19:44:22 -08:00

readme.md

UEFI Debugger Extension

Build UEFI Debug Extension

This folder contains the source for the UEFI debugger extension. This provides functionality within windbg for debugging the UEFI environment. Using the UEFI extension requires that Windbgx has access to the symbol files for the target UEFI code.

The most recent compiled version of this binary can be found as a build artifact in the debug extension workflow.

Compiling

Windbg debugger extensions need to be compiled with the Microsoft build tools. The easiest way to do this is to use the Developer Command Prompt that comes with the Visual Studio tools installation. In the command prompt, navigate to the folder and run "msbuild".

msbuild -property:Configuration=Release -property:Platform=x64

The project can also be loaded and built in Visual Studio using the solution file. This project requires the Windows SDK and the Windows Driver Kit.

Installing the Extension

Debugger extensions can be loaded into windbg several ways. First, by manually loading once already in windbg. This can be done with the .load command. Though this will not persist across windbg sessions.

.load <path to uefiext.dll>

The second is to place the DLL in the windbg application folder, or another place in windbg's extpath which can be enumerating using the .extpath command. This will make the extension available to all future windbg sessions.

e.g. C:\Users\<user>\AppData\Local\dbg\UI

For more information about loading debugger extensions see the Microsoft documentation page.

Using the Extension

Once the extension is loaded into windbg, you can use it by running any of its commands. To see its commands, use the help command to get started.

!uefiext.help

One particularly useful instruction will be the !uefiext.findall instruction to load the needed modules.

Design

Windbg debug extensions allow for programmatic decoding and outputting of data from to debugger. The UEFI debug extension is designed to help finding, parsing, and changing data in the UEFI environment more accessible from the debugger.

Because UEFI has various environments, SEC, DXE, MM, the extension has a concept of the current running environment. This can be manually set using !uefiext.setenv. This environment should be used to change the operation of various routines based on the current context. For example, enumerating the hobs or loaded modules is done differently in DXE then it is in MM. At the time of writing this, most functions are only implemented in DXE, but this environment should always be checked before accessing environment specific information.

Creating new commands

New commands can be exported by added them to the exports in uefiext.def. New commands should also be added to the help command in uefiext.cpp. For reference on how to write debugger extension code, see the Microsoft API Docs.