Skip to content

Latest commit

 

History

History
71 lines (52 loc) · 2.8 KB

README.md

File metadata and controls

71 lines (52 loc) · 2.8 KB

dk WinDbg extension

Summary

dk is the enhanced refactored version of tokenext. The goal is to improve the readability and extensibility, as well as to leverage the powerful Debugger Data Model and Time Travel Debugging. SVG document will be generated for an intuitive visualization in certain circumstances.

Run !dk help for supported command list.

Check page_2_svg demo here.

Run following commands to generate callstack forest visualization in svg format(small projects only!), demos for helloworld project can be found here.

0:001> !dk ldttd
0:001> !dk dump_ttd_events d:\helloworld_viz

Reference

  1. TTD.hpp from Bindings for Microsoft WinDBG TTD

How to start a new WinDbg C++ extension?

1. Add Windows Kits related folder to Visual Studio project setting:

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    ......
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <IncludePath>C:\Program Files (x86)\Windows Kits\10\Debuggers\inc;$(IncludePath)</IncludePath>
    <LibraryPath>C:\Program Files (x86)\Windows Kits\10\Debuggers\lib\x64;$(LibraryPath)</LibraryPath>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <IncludePath>C:\Program Files (x86)\Windows Kits\10\Debuggers\inc;$(IncludePath)</IncludePath>
    <LibraryPath>C:\Program Files (x86)\Windows Kits\10\Debuggers\lib\x64;$(LibraryPath)</LibraryPath>
  </PropertyGroup>
    ......
</Project>

2. Include engextcpp.cpp from C:\Program Files (x86)\Windows Kits\10\Debuggers\inc to Visual Studio project, and make the following changes:

diff -r C:\Program Files (x86)\Windows Kits\10\Debuggers\inc\engextcpp.cpp C:\Users\dk\source\repos\dk\engextcpp.cpp
248c248
<     m_OptionChars = "/-";
---
>     m_OptionChars = const_cast<PSTR>("/-");
286c286
<     PSTR Value = "";
---
>     PSTR Value = const_cast<PSTR>("");
2673c2673
<              BufferChars > 0)
---
>              *BufferChars > 0)

3. Define exported symbols in dk.def file, and don't forget the 4 default exports:

DebugExtensionInitialize
DebugExtensionUninitialize
DebugExtensionNotify
help