Skip to content

Latest commit

 

History

History
187 lines (131 loc) · 4.68 KB

File metadata and controls

187 lines (131 loc) · 4.68 KB

VibeDbg DX Command Guide

This guide explains how to use the dx command with VibeDbg for rich visualization of debugger object model expressions.

Overview

The dx command displays C++ expressions using the NatVis extension model, providing rich visualization of objects, data structures, and debugger objects. VibeDbg includes enhanced support for this command through both direct execution and a specialized MCP tool.

Basic Usage

Direct Command Execution

You can use the dx command directly through the execute_command tool:

Execute the dx command to show debugger settings

This will execute: dx Debugger.Settings

Specialized DX Tool

For more complex scenarios, use the dedicated dx_visualization tool:

Use the dx visualization tool to display the current process environment with 3 levels of recursion

Command Options

The dx command supports various options that can be specified through the MCP tool:

Grid View (-g)

Display data in tabular format with sorting capabilities:

Show debugger sessions in grid view

Recursion Level (-r#)

Specify how many levels deep to display nested objects:

Display process environment with 2 levels of recursion

Verbose Mode (-v)

Include methods and additional object information:

Show debugger sessions in verbose mode

Native Only (-n)

Use native C/C++ structures only, bypassing NatVis:

Display idle process using native structures only

Format Specifiers

Customize output format:

  • x - Hexadecimal
  • d - Decimal
  • o - Octal
  • b - Binary
  • en - Enum names only
  • s - ASCII strings
  • su - Unicode strings
Display debugger sessions in hexadecimal format

Common Examples

Debugger Objects

dx Debugger.Settings

Shows debugger configuration and settings.

dx Debugger.Sessions

Lists all debugging sessions.

dx Debugger.State

Shows current debugger state.

Process Information

dx @$curprocess

Shows information about the current process.

dx @$curprocess.Environment

Shows the current process environment block.

dx @$curthread

Shows information about the current thread.

Kernel Objects (Kernel Mode)

dx nt!PsIdleProcess

Shows the idle process object (kernel mode only).

dx nt!PsInitialSystemProcess

Shows the initial system process (kernel mode only).

Advanced Visualizations

dx -g -r3 Debugger.Sessions

Shows debugger sessions in grid view with 3 levels of recursion.

dx -v @$curprocess.Io.Handles

Shows process handles with verbose information.

dx -n nt!PsIdleProcess

Shows idle process using native structures only.

Error Handling

The dx command may fail in certain scenarios:

  1. Invalid Expression: The expression doesn't exist or can't be evaluated
  2. Memory Access: The target memory can't be accessed
  3. Symbol Issues: Required symbols are not loaded
  4. Mode Restrictions: Some objects are only available in specific debugging modes

VibeDbg provides detailed error messages and suggestions for resolving these issues.

Best Practices

  1. Start Simple: Begin with basic expressions before adding complex options
  2. Use Recursion Carefully: High recursion levels can produce large outputs
  3. Combine with Other Commands: Use dx with other debugging commands for comprehensive analysis
  4. Check Mode: Ensure you're in the correct debugging mode (user/kernel) for the objects you want to examine

Integration with Other Tools

The dx command works seamlessly with other VibeDbg tools:

Set a breakpoint at main, continue execution, then use dx to show the current process environment

This demonstrates how dx can be combined with breakpoint management and execution control for comprehensive debugging workflows.

Troubleshooting

Common Issues

  1. "No type information": Load symbols for the target module
  2. "Unable to read memory": Check if the target process is accessible
  3. "Expression not found": Verify the expression syntax and availability

Recovery Actions

  • Use lm to check loaded modules
  • Use x to search for symbols
  • Use !process to verify process information
  • Try with -n flag for native structure display

References