DCSIMG
Debugging - Pavel's Blog
Sign in | Join | Help

Pavel's Blog

Pavel is a software guy that is interested in almost everything
software related... way too much for too little time

Browse by Tags

Reminder: WPDUG September Meeting
04 September 11 01:05 AM | pavely | with no comments
This Wednesday (the 7th) will hold a Windows Platform Developer User Group meeting in Microsoft’s offices in Ra’anana (Israel). Our first session will be about adding realtime and deterministic capabilities to Windows and its impact on the system and the ways to program such a system (all based on addons by a company called TenAsys ). The second session will demonstrate useful (and undocumented) debugging tips and tricks in Visual Studio (primarily for native developers). Should be interesting for...
Windows Platform Developers User Group (Sep 2011) Meeting
11 August 11 10:37 AM | pavely | with no comments
After some time of inactivity, the WPDUG is back! Our next meeting will be held on September 7th, in Microsoft Offices in Ra’anana. The agenda and registration form is here . Please register so you’d have a parking space and enough food is presented… See you there!
Tip: Using a Console in a GUI Application
11 May 11 02:06 PM | pavely | 4 comment(s)
When working with a WinForms or a WPF application in .NET, a console application is not created by default, so statements involving the Console class normally go to the trash. The console window may be a useful debugging aid, printing anything that may be important during runtime. Fortunately, there is a way to get it back. Actually, there are two ways. The first, the “hard way” is to create the console explicitly using the native AllocConsole function: [ DllImport ( "kernel32" )] private...
PSSCOR4 Debugger Extension Released
29 April 11 07:04 PM | pavely | with no comments
A while back, Microsoft released the PSSCOR2 debugger extension for WinDbg, supporting more command than the classic SOS.DLL. This was for CLR v2 (.NET 2-3.5). Now a similar extension has been released for CLR 4 (.NET 4). You can download it here . There are versions for x86 and x64. The easiest way to use them is copy the relevant DLL to the .NET framework directory for the corresponding “bitness” (where SOS lives, something like C:\Windows\Microsoft.NET\Framework\v4.0.30319 (32bit) or C:\Windows...
How to Annoy Your Boss (or get yourself fired)
04 September 10 05:24 PM | pavely | 6 comment(s)
If you want to make your boss a bit crazy, here’s what you can do: First, get him away from his computer. You can explain you need to run some connectivity test or configure some important service for the sake of the project. Once he’s out of the way, you can proceed: 1. Install the Debugging Tools For Windows package (if you don’t have it already). You can get the latest version from the Windows SDK installation , but any previous version will do. We’ll need the Global Flags utility from that package...
Strange Bundle: WDK & Debugging Tools
03 March 10 02:20 PM | pavely | 3 comment(s)
Microsoft has released an update Windows Driver Kit (WDK) a few days ago, but with a new twist: The Debugging Tools for Windows are now bundled with the WDK and are no longer available as a free (and easy) download. The WDK is only available to MSDN subscribers and via the Microsoft Connect web site. This doesn’t make sense to me. Although WinDbg and friends are essential in the device driver world, they are just as important in the user mode world. I hope Microsoft reverts this decision and will...
Local Kernel Debugging and LiveKd Update
27 October 09 10:13 AM | pavely | 7 comment(s)
Local kernel debugging is the ability to view kernel data structures in a live system (i.e. not connecting to a target system through a null cable modem or USB or other alternatives), and is supported since Windows XP. This is a great way to explore windows on its darker side (the kernel and related subsystems) with all its mysteries and secrets. With Windows XP, starting local kernel debugging is pretty easy. Just fire up WinDbg (or kd for that matter), select from the menu File->Kernel Debug...
How to Kill Visual Studio 2008 Elegantly
12 October 09 09:39 PM | pavely | 2 comment(s)
Here’s an elegant (in my opinion) way to kill Visual Studio 2008 immediately without leaving any trace. Here’s what you need to do: 1. Open up VS 2008 and create a new project of type C# WPF Application . 2. Open Window1.xaml and make sure you get a split view of XAML and preview. 3. The top level layout panel is a Grid (by default). Add two rows, and in one place a button. Also name the window (e.g. “win”). The markup should be something like this: < Window x : Class ="WpfApplication3.Window1"...
New Version of SOSEX published
09 March 09 09:08 AM | pavely | with no comments
For all those WinDbg + SOS/SOSEX lovers, a new version of SOSEX was published, which includes some new commands and enhancements to existing ones. Here’s a brief description of each command. More info can be found in the readme file and using !help <command> inside WinDbg. dlk        (no parameters)                                  ...
PDC Report Day 0: Pre-conference
26 October 08 09:16 PM | pavely | with no comments
The “real” PDC only starts tomorrow, but today was the pre-conference, meaning it deals with current issues and technologies, as opposed to the PDC itself, which mainly deals with future technologies. Every attendee that signed up for the pre-conference day (an extra $400) had to choose a specific track, although technically you could switch tracks midway and no one would be the wiser. Personally, I enrolled in the “ Advanced Windows Debugging ” track; although I know this stuff pretty well, there...
Undocumented Helpful Command in WinDbg
16 October 08 08:08 AM | pavely | with no comments
When using WinDbg, one must type a lot… although the history (up/down arrow keys) is helpful, still… An undocumented command, .cmdtree in WinDbg allows reading a formatted text file that creates a nice looking window with the command tree just waiting to be double clicked. John Robbins ’ post explains further. Here’s a sample file that can be used to create a nice looking command tree. it also includes SOSEX commands. Copy the file somewhere and then…   In WinDbg, type .cmdtree c:\tools\cmdtree...
CLR Explorer Tool
10 August 08 11:14 AM | pavely | 6 comment(s)
In the last few days I created the first version of a tool I call "CLR Explorer". This tool allows viewing live CLR-enabled processes, showing the AppDomains, threads and assemblies in those processes. The application is similar in look to Windows Explorer, with a tree-like view on the left and a list view on the right. Here's a screen shot: The tool works by utilizing the native debug interfaces the CLR provides, namely ICorDebug and its derivatives, such as ICorDebugProcess and the...