An advanced in-memory image visualization plugin for GDB and LLDB on Linux, with experimental support for MacOS and Windows. Previously known as gdb-imagewatch. Also available as an extension for VSCode and forks
Open Image Debugger: Enabling visualization of in-memory buffers on GDB/LLDB
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
Open Image Debugger is a tool for visualizing in-memory buffers during debug
sessions, compatible with both GDB and LLDB. It works out of the box with
instances of the OpenCV Mat class and Eigen matrices, but can also be
customized to work with any arbitrary data structure.
> **Prefer VS Code or a fork (Cursor, VSCodium, Windsurf, …)?** Skip the manual
> build — install the extension from the
> VS Code Marketplace
> or Open VSX.
> See Installation below.
> **New — using CLion or Android Studio?** The Open Image Debugger plugin is
> now on the
> JetBrains Marketplace:
> plot buffers straight from the native C/C++ debugger, inside the IDE. See
> Installation below.
> **New — declarative custom types.** You can now describe your own buffer types
> in a .oid/types.json file instead of writing Python; the same file works in
> gdb, lldb, and the VS Code and JetBrains extensions. See
> doc/declarative-types.md.
Download (experimental)
A bit experimental, better to compile manually
Features
* GUI interactivity:
* Scroll to zoom, left click+drag to move the buffer around;
* Rotate buffers 90° clockwise or counterclockwise;
* Go-to widget that quickly takes you to any arbitrary pixel location;
* Buffer values: Zoom in close enough to inspect the numerical contents of any pixel.
* Auto update: Whenever a breakpoint is hit, the buffer view is automatically
updated.
* Auto contrast: The entire range of values present in the buffer can be
automatically mapped to the visualization range [0, 1], where 0
represents black and 1 represents white.
* The contrast range can be manually adjusted, which is useful for inspecting
buffers with extreme values (e.g. infinity, nan and other outliers).
* Link views together, moving all watched buffers simultaneously when any
single buffer is moved on the screen
* Supported buffer types: uint8_t, int16_t, uint16_t, int32_t, uint32_t,
float and double
* Supported buffer channels: Up to four channels (Grayscale, two-channels, RGB
and RGBA)
* GPU accelerated
* Supports large buffers whose dimensions exceed GL_MAX_TEXTURE_SIZE.
* Supports data structures that map to a ROI of a larger buffer.
* Exports buffers as png images (with auto contrast) or octave/matlab matrix
files (unprocessed).
* Auto-load buffers being visualized in the previous debug session
* Designed to scale well for HighDPI displays
* Works on Linux, macOS X and Windows (experimental)
Supported OSes
* OID is developed with Ubuntu as the main target. The goal is to support the two latest LTS versions at a given time.
* Ubuntu is also used as a basis for the minimum versions of the dependencies: we try to support the default versions of the packages you get via apt install
* There are currently no plans to support other Linux distros. OID may or may not compile on your favorite distro, your mileage may vary.
* Support for MacOS and Windows are somewhat experimental now - the code should be able to compile (see ), but the binaries are not actively tested - in fact we currently have no automated tests at all for any OS - help is more than welcome in this regard. Also, we haven't come up with a simple installation/usage guides for these OSes yet.
Requirements
* A C++20 compliant compiler
* GDB **15.0.50+** or LLDB **18.1.3+**
* CMake **3.28.3+**
* Python **3.12.3+** development packages
* OpenGL **2.1+** support
* Linux only: Wayland and X11 development packages (needed to build the bundled GLFW) and GTK 3 development packages (needed by the native file-open dialog); see the apt install command below. Alternatively, configure with -DNFD_PORTAL=ON to use the xdg-desktop-portal (D-Bus) dialog backend instead of GTK.
All other third-party libraries are bundled as git submodules and built from source, so they don't need to be installed:
* Dear ImGui — viewer UI
* GLFW — window and OpenGL context management
* Eigen — linear algebra for the visualization layer
* Asio (standalone) — IPC between the debugger bridge and the viewer