Edit

Share via


WinDbg: Data Model menu

This article describes how to work with the Data Model menu in WinDbg.

New model query

Use the Specify Model Query dialog to create a new model query. You can put anything here that you put into a normal dx command.

For example, specify Debugger.Sessions to examine the debugger sessions objects.

Screenshot of the Specify Model Query dialog in WinDbg.

For general information about the debugger objects, refer to dx (Display debugger object model expression).

Use LINQ queries to dig deeper into the session. This query shows the top five processes that run the most threads.

Debugger.Sessions.First().Processes.Select(p => new { Name = p.Name, ThreadCount = p.Threads.Count() }).OrderByDescending(p => p.ThreadCount),5

Screenshot of the Data Model window displaying processes and threads in WinDbg.

Data Model explorer

Use the Data Model explorer to quickly browse every data model object in the Debugger namespace.

Screenshot of the Data Model window with debug object sessions in WinDbg.

Display mode

Use display mode to toggle between grid, hierarchy, and graph display modes. You can right-click column headers to hide or show more columns.

Grid mode is useful when you want to dig down in the objects. For example, here's the previous top threads query in grid view.

Screenshot of the Data Model window displaying top threads in grid view in WinDbg.

Selecting any underlined item opens a new tab and runs a query to display that information.

This query shows the devices in the plug-and-play device tree grouped by the name of the physical device object's driver for a kernel session.

Debugger.Sessions.First().Devices.DeviceTree.Flatten(n => n.Children).GroupBy(n => n.PhysicalDeviceObject->Driver->DriverName.ToDisplayString()) 

Screenshot of the Data Model window presenting a plug-and-play device tree in the grid view in WinDbg.

Change query

Edit the query text box to change the query that's used in the active Data Model window.

Change window or tab title

New generic data model windows are given the Data Model title. You can customize titles by invoking the Change Title context menu item from either the tab or window title pane.

Screenshot of the Data Model window presenting two tabs with custom titles in WinDbg.

Note

The title can't be empty or contain semicolons.