Skip to content
/ ExtCS Public
forked from rohithkrajan/ExtCS

Windows Debugger extension to execute C# Scripts

License

Notifications You must be signed in to change notification settings

Vegamm/ExtCS

 
 

Repository files navigation

ExtCS

C# Extension to access the windows DebugEngine.

This repo was forked to make this code usable in newer versions of Visual Studio and Windows Debugging Tools. The Web/ScriptApi has been removed and further improvements have been made to provide more functionality against WinDbg.

Purpose

This extension allows you to write C# scripts against WinDbg.

Why do I need this?

If you want to automate the debugger but dislike the WinDbg built-in scripting, now you can use C# language and all the framework libraries.

Getting Started

Example Script

/// Contents of sosheap.csx

// Get an instance of the debugger
var debugger = Debugger.GetCurrentDebugger();

// Load the sos extension
var sos = new Extension(@"C:\Windows\Microsoft.NET\Framework\v4.0.30319\sos.dll");

// Call '!dumpheap -stat' on sos
sos.CallExtensionMethod("dumpheap", "-stat");

Supported Features

  • Full intellisense support on Visual Studio Code when writing scripts and partial support in Visual Studio.
  • Supports all the Windows Debugging Tools that utilize the debug engine.
  • Complete debugging support. Add a breakpoint in the C# script and attach Visual Studio to windbg to do debugging.
  • REPL support – You can use your debugger to execute C# statements directly in the command window.

License

This project is licensed under the MIT License - see LICENSE.md.

Releases

No releases published

Packages

No packages published

Languages

  • C# 46.7%
  • JavaScript 44.9%
  • PowerShell 7.2%
  • CSS 0.8%
  • C++ 0.4%
  • Shell 0.0%