Skip to content

Debugger pretty printer for MSVC #463

Description

@MarekKnapek

Hi, various debuggers have various ways how to pretty-print a data type in their UI. The Visual Studio debugger supports the NATVIS declarative format. Sadly, this format does not support loops nor recursion. I tried very hard to write bunch of <Intrinsic> functions in order to compute u128 divided by- or modulo by- 10 so I could then reconstruct the 128bit number digit-by-digit. I succeeded, sort of, the Visual Studio IDE took very long time to compute/display the value, and later it crashed on out-of-memory problem.

Boost documentation itself at https://develop.int128.cpp.al/printer.html says that:

Full decimal display for values beyond 64 bits is not possible in NATVIS. The NATVIS expression evaluator does not support 128-bit arithmetic, so values that exceed the 64-bit range are shown in hexadecimal.

I kept digging and found what is now considered a legacy debugging API provided by a class named CppDebug.dll!CppEE. I tested it, and it worked just fine with the latest Visual Studio 2026. Other debuggers support arbitrary code execution with a scripting language (Python). Visual Studio supports this via a DLL file produced by any programming language. I wrote a small visualizer program and compiled it into a DLL. Everything worked just fine. PR coming soon.

Marek

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions