Quantcast
Channel: Debugging – Ofek's Visual C++ stuff
Browsing all 16 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Viewing types, part 2: the manual way

Compiling with /d1reportAllClassLayout, even an empty file, dumps many compiler-intrinsic types. Six of these are interesting in the present context:  _PMD, _TypeDescriptor,...

View Article


Image may be NSFW.
Clik here to view.

Viewing types, part 3: Exceptions

Last time a way was shown to use internal RTTI mechanics to view C++ type names without direct debugger aid. There is one place in particular where such type names carry substantial information, and...

View Article


Image may be NSFW.
Clik here to view.

_DllMain@12 already defined

We recently faced this linkage error: error LNK2005: _DllMain@12 already defined in MSVCRT.lib(dllmain.obj) Searching gives ~36K results as of July 2012, many of which seem high quality (StackOverflow,...

View Article

Image may be NSFW.
Clik here to view.

Entry Point Not Found, and other DLL Loading Problems

Occasionally I come across DLL load problems: The verbosity of the error messages varies greatly. In their raw form these include at least the DLL name, but as various frameworks come into play (for...

View Article

Image may be NSFW.
Clik here to view.

VS2012 Migration #3: autoexp and NoStepInto Replacements

In the past I blogged quite a few times about two immensely useful albeit mostly-unofficial debugger features: watch modification via autoexp.dat, and step-into modification via NoStepInto registry...

View Article


Image may be NSFW.
Clik here to view.

Setting a Watch on Wide Registers in VS

General-purpose registers can be watched from the watch window pretty much as regular variables: (the ‘$’ prefix is optional, but is recommended by MS – probably as means to minimize clashes with code...

View Article

Image may be NSFW.
Clik here to view.

Debugging Handle Leaks

This is all well documented stuff and I won’t go into details – it’s here mostly for self reference (3rd time I had to chase this down in google). Steps are: (1) Install WDK to integrate the WinDbg...

View Article

Image may be NSFW.
Clik here to view.

Debugging Memory Corruption II

Some years ago I shared a trick that let’s you call _CrtCheckMemory from the debugger anywhere, without re-compilation.   The updated (as of VS2013) string to type at a watch window is:...

View Article


Image may be NSFW.
Clik here to view.

Accelerating Debug Runs, Part 1: _NO_DEBUG_HEAP

(A more appropriate but even-less-catchy title might have been ‘accelerating runs from the debugger‘. As elaborated below, these two are not strictly equal). A common notion is that debug builds can...

View Article


Image may be NSFW.
Clik here to view.

Accelerating Debug Runs, Part 2: _ITERATOR_DEBUG_LEVEL

A previous post discussed the Windows Debug Heap – with the main motivation being how to avoid it, as it is just empty, expensive overhead, and it isn’t clear why it is on by default in the first...

View Article

Image may be NSFW.
Clik here to view.

Tinkering with VS2015 (CTP 6)

Today I downloaded the latest VS bits and played around with the native debugger. It was a brief session and so would be the records of my impressions. J Universal CRT is here! And seems like a great...

View Article

Image may be NSFW.
Clik here to view.

Data Read Breakpoints – redux

The Problem ~5Y ago I blogged about data breakpoints. A hefty bit of the discussion was devoted to persistence of hardware breakpoints across a thread switch: all four implementations linked to assumed...

View Article

Image may be NSFW.
Clik here to view.

_DllMain@12 already defined

We recently faced this linkage error: error LNK2005: _DllMain@12 already defined in MSVCRT.lib(dllmain.obj) Searching gives ~36K results as of July 2012, many of which seem high quality (StackOverflow,...

View Article


Image may be NSFW.
Clik here to view.

Checking Memory Corruption from the debugger in 2016

It used to be something like {,,msvcr80d.dll}_CrtCheckMemory() But this trick requires quite a bit of adaptation to use on modern VS versions. First, the relevant module is now ucrtbased.dll – thanks...

View Article

Image may be NSFW.
Clik here to view.

Tracking the Current Directory from the debugger: RtlpCurDirRef

Some rogue code was changing our current directory from under our feet, and we needed to catch it in action. I was looking for a memory location to set a data breakpoint on. (Note: for the remainder of...

View Article


Image may be NSFW.
Clik here to view.

Matlab’s mxArray Internals

Everything in Matlab is a Matrix. The scalar 4 is a 1×1 matrix with the single value 4. The string ‘asdf’ is a 4×1 (not a typo – it is in fact a column vector) matrix, with the 4 char values ‘a’, ‘s’,...

View Article
Browsing all 16 articles
Browse latest View live