Pretty printers for various dlang types for GDB, LLDB and VSDBG.
TODO:
- GDB
- Test & make work on all OS
- Linux x64
- DMD
- DMD
-gc
- LDC
- LDC
-gc
- OSX x64
- DMD
- DMD
-gc
- LDC
- LDC
-gc
- Windows x64
- DMD
- DMD
-gc
- LDC
- LDC
-gc
- Linux x64
- Associative Arrays
- Arrays
- Strings (bug: doesn't respect length, stops at null characters)
- phobos types (tbd)
- Test & make work on all OS
- LLDB
- Test & make work on all OS
- Linux x64
- DMD
- DMD
-gc
- LDC
- LDC
-gc
- OSX x64
- DMD
- DMD
-gc
- LDC
- LDC
-gc
-
Windows x64broken (LLDB not working with D Windows binaries)-
DMD-> LLDB broken -
DMD-> LLDB broken-gc
-
LDC-> LLDB broken -
LDC-> LLDB broken-gc
-
- Linux x64
- Associative Arrays
- Arrays
- Strings
- phobos types (tbd)
- Test & make work on all OS
- VSDBG (NatVis)
- Windows Support only
- Make work with all Compilers
- Windows x64
-
LDC-> broken, not implementable - LDC
-gc
-
DMD-> broken, not implementable -
DMD-> broken, does not seem to work-gc
-
- Windows x64
- Associative Arrays
- Arrays
- Strings
- phobos types (tbd)
Due to the pretty printing API, LLDB offers better type displays.
Boilerplate code for LLDB taken from vscode-lldb.
VSCode with webfreak.code-d
(recommends extensions C/C++ on Windows or CodeLLDB on other platforms installed)
{ "name": "Debug Program", "request": "launch", "type": "code-d", "program": "${command:dubTarget}", "cwd": "${workspaceFolder}", "dubBuild": true // optional, automatic builds }
code-d has these debug configurations bundled since version 0.23.0 and automatically detects the recommended settings for the current platform with the installed debug extensions.
Enable pretty printers and source the gdb_dlang.py script.
MI Commands (for use with extensions):
-enable-pretty-printing -interpreter-exec console "source /path/to/gdb_dlang.py"
VSCode Debug Extension Configurations:
C/C++ (ms-vscode.cpptools)
{ "name": "Debug Program", "request": "launch", "type": "cppdbg", "program": "${workspaceFolder}/programname", "cwd": "${workspaceFolder}", "setupCommands": [ { "description": "Enable python pretty printing", "ignoreFailures": false, "text": "-enable-pretty-printing" }, { "description": "Load D GDB type extensions", "ignoreFailures": false, "text": "-interpreter-exec console \"source /path/to/gdb_dlang.py\"" } ] }
NativeDebug (webfreak.code-debug)
{ "name": "Debug Program", "request": "launch", "type": "gdb", "target": "./programname", "cwd": "${workspaceFolder}", "autorun": [ "source /path/to/gdb_dlang.py" ], "valuesFormatting": "prettyPrinters" }
Import the lldb script:
command script import "/path/to/lldb_dlang.py"
VSCode Debug Extension Configurations:
CodeLLDB (vadimcn.vscode-lldb)
{ "name": "Debug Program", "request": "launch", "type": "lldb", "program": "${workspaceFolder}/programname", "cwd": "${workspaceFolder}", "initCommands": ["command script import \"/path/to/lldb_dlang.py\""] }
Visual Studio:
Put the natvis file in your workspace, it will be loaded automatically and just work.
VSCode Debug Extension Configurations:
C/C++ (ms-vscode.cpptools)
{ "name": "Debug Program", "request": "launch", "type": "cppvsdbg", "program": "${workspaceFolder}/programname.exe", "cwd": "${workspaceFolder}", "visualizerFile": "C:\\Path\\To\\dlang.natvis" }