Skip to content

Commit 2f2673c

Browse files
committed
Add !pt extension
This commit adds the !pt extension for AMD64 and ARM64 to analyze page table pages. Refer to the !uefiext.help for information on running it.
1 parent dc5d241 commit 2f2673c

7 files changed

Lines changed: 1320 additions & 27 deletions

File tree

UefiDbgExt/dbgexts.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ Module Name:
1818
#include "dbgexts.h"
1919
#include <strsafe.h>
2020

21-
PDEBUG_CLIENT4 g_ExtClient;
22-
PDEBUG_CONTROL g_ExtControl;
23-
PDEBUG_SYMBOLS2 g_ExtSymbols;
21+
PDEBUG_CLIENT4 g_ExtClient;
22+
PDEBUG_CONTROL g_ExtControl;
23+
PDEBUG_SYMBOLS2 g_ExtSymbols;
24+
PDEBUG_REGISTERS g_ExtRegisters;
2425

2526
WINDBG_EXTENSION_APIS ExtensionApis;
2627

UefiDbgExt/dbgexts.h

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ Module Name:
1414
#include <stdio.h>
1515
#include <stdlib.h>
1616
#include <string.h>
17+
#include <string>
18+
#include <vector>
1719

1820
//
1921
// Define KDEXT_64BIT to make all wdbgexts APIs recognize 64 bit addresses
@@ -31,6 +33,25 @@ Module Name:
3133
extern "C" {
3234
#endif
3335

36+
typedef enum _PRINTF_DML_COLOR {
37+
Normal,
38+
Verbose,
39+
Warning,
40+
Err,
41+
Subdued,
42+
Header,
43+
Emphasized,
44+
Changed,
45+
ColorMax
46+
} PRINTF_DML_COLOR, *PPRINTF_DML_COLOR;
47+
48+
VOID
49+
PrintDml (
50+
__in PRINTF_DML_COLOR Mask,
51+
__in PCSTR Format,
52+
...
53+
);
54+
3455
#define INIT_API() \
3556
HRESULT Status; \
3657
if ((Status = ExtQuery(Client)) != S_OK) return Status;
@@ -41,9 +62,11 @@ extern "C" {
4162
#define EXIT_API ExtRelease
4263

4364
// Global variables initialized by query.
44-
extern PDEBUG_CLIENT4 g_ExtClient;
45-
extern PDEBUG_CONTROL g_ExtControl;
46-
extern PDEBUG_SYMBOLS2 g_ExtSymbols;
65+
extern PDEBUG_CLIENT4 g_ExtClient;
66+
extern PDEBUG_CONTROL g_ExtControl;
67+
extern PDEBUG_SYMBOLS2 g_ExtSymbols;
68+
extern PDEBUG_REGISTERS g_ExtRegisters;
69+
extern ULONG g_TargetMachine;
4770

4871
extern BOOL Connected;
4972
extern ULONG TargetMachine;

0 commit comments

Comments
 (0)