COM objects that don’t have the expected lifetime can cause chaos when combined with .NETs garbage collection system.
Category Archives: Debugging
Don’t do anything in DllMain… Please
Thinking of adding some code to your DLLs DllMain function? STOP!
Pinned DataTips in Visual Studio 2010 Beta 2
I’ve just noticed a nice little feature in Visual Studio 2010 Beta 2: pinned DataTips. Values displayed in the debugger as you hover over a variable can now be pinned in place and remain aligned with the source. They can even have annotations added… Tasty!
Getting IUnknown from __ComObject
How do you find the unmanaged COM object that’s being referenced by a .NET object?
Diagnosing out of memory errors with VMMap
VMMap is a new tool from Mark Russinovich et al that’s very useful for diagnosing virtual memory/address space exhaustion issues. I describe it here, and give some information that should help you interpret what it reports.
WinDbg !locks command broken
It seems that the extremely useful !locks command is broken in 6.11.1.40x, the current and previous release of WinDbg from the debugging tools for Windows.
You’ll get errors like:
0:007> !locks
NTSDEXTS: Unable to resolve ntdll!RTL_CRITICAL_SECTION_DEBUG type
NTSDEXTS: Please check your symbols
The suggested solution seems to be to roll-back to version 6.10.3.233, available from here, or you can just [...]
Getting .NET type information in the unmanaged world
One of the tools that I write and maintain displays type information for COM objects hidden behind “handles” in Excel spreadsheets. The underlying objects can either support an interface that allows them to be richly rendered to XML, or the viewer will fall-back to using metadata and displaying the supported interfaces and their properties and methods. It [...]
Beware cached IDispatch
I’ve kinda given it away there with the title, but we had an interesting set of symptoms exhibited the other day while trying to call a function in an Excel workbook via F#. It appeared that the function being called would fail depending on what had been called previously. Very odd.
A bit of background: as you [...]
Creating a featherweight debugger
What do I mean by “featherweight debugger”? I mean implementing just enough of the debugging framework to get what we need from the debuggee and nothing more.
The problem I was trying to solve was how to get more information from first chance exceptions. We have a great deal of library code that uses catch(…) blocks [...]
Dumping Excel XLL add-in calls
Using WinDbg it’s possible to get a dump of each XLL call that is made by Excel as it calculates. If you’re using Excel 2003, create the following breakpoint that dumps the symbol at eax+4 (the entry point that is about to be called), then continues.:
bu EXCEL!MdCallBack+0xa880 “dds @eax+0×4 L1; g”
You’ll need to adjust the [...]
