Skip to content

Commit

Permalink
Clarify launching windbgx from command line using provided config (#18)
Browse files Browse the repository at this point in the history
## Description

Clarify how to launch windbgx using the provided config file.

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

## How This Was Tested

N/A

## Integration Instructions

N/A
  • Loading branch information
cfernald authored Apr 16, 2024
1 parent 17806a9 commit 6fa8e9f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions DebuggerFeaturePkg/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,17 @@ Image scanning heuristics size, and select the correct IP and port.
Windbg can attach to the GDB port exposed by the debugger using the [Windbg EXDI
GDB Server](https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/configuring-the-exdi-debugger-transport).
For recent builds of windbg this can be invoked using the following command from
and administrator prompt.
and administrator prompt. Since only the most recent windbgx builds will have the
configuration by default, you can provide the PathToSrvCfgFiles path as shown before
to load the config from the included [exdiConfigData.xml](../Scripts/exdiConfigData.xml).

```cmd
windbg.exe -noredirect -v -kx exdi:CLSID={29f9906e-9dbe-4d4b-b0fb-6acf7fb6d014},Kd=Guess,Inproc=ExdiGdbSrv.dll,DataBreaks=Exdi
Windbgx -v -kx exdi:CLSID={29f9906e-9dbe-4d4b-b0fb-6acf7fb6d014},Kd=Guess,Inproc=ExdiGdbSrv.dll,DataBreaks=Exdi,PathToSrvCfgFiles=PATH_TO_MU_FEATURE_DEBUGGER_REPO\Scripts\
```

In order to connect to the UEFI debugger using this method, you will need to modify
the `exdiConfigData.xml` to have `UEFI` set for `CurrentTarget`, and customizing
the default port for UEFI devices if required. For more details see
[Customizing EXDI Configuration](#customizing-exdi-configuration).
Note that this by default is configured to use the port `5555`. Also running the
above from PowerShell might leads to issues as PowerShell will interpret the brackets
in the guid as language components rather then passing them as arguments to Windbgx.

### Customizing EXDI Configuration

Expand Down
2 changes: 1 addition & 1 deletion Scripts/exdiConfigData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ExdiGdbServerConfigData agentNamePacket = "" uuid = "9F7AA64A-55AF-476E-AABA-87518C04F979" displayCommPackets = "yes" debuggerSessionByCore = "no" enableThrowExceptionOnMemoryErrors = "yes" qSupportedPacket="qSupported:xmlRegisters=aarch64,i386">
<ExdiGdbServerTargetData targetArchitecture = "ARM64" targetFamily = "ProcessorFamilyARM64" numberOfCores = "1" EnableSseContext = "no" heuristicScanSize = "0" targetDescriptionFile = "target.xml" />
<GdbServerConnectionParameters MultiCoreGdbServerSessions = "no" MaximumGdbServerPacketLength = "1024" MaximumConnectAttempts = "3" SendPacketTimeout = "100" ReceivePacketTimeout = "3000">
<Value HostNameAndPort="localhost:5556" />
<Value HostNameAndPort="localhost:5555" />
</GdbServerConnectionParameters>
<ExdiGdbServerMemoryCommands GdbSpecialMemoryCommand = "no" PhysicalMemory = "no" SupervisorMemory = "no" HypervisorMemory = "no" SpecialMemoryRegister = "no" SystemRegistersGdbMonitor = "no" SystemRegisterDecoding = "no">
</ExdiGdbServerMemoryCommands>
Expand Down

0 comments on commit 6fa8e9f

Please sign in to comment.