DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Because the DevOps movement has redefined engineering responsibilities, SREs now have to become stewards of observability strategy.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Related

  • Creating Application using Spring Roo and Deploying on Google App Engine
  • Build a DIY AI Model Hosting Platform With vLLM
  • Integrating Redis With Message Brokers
  • Terraform State File: Key Challenges and Solutions

Trending

  • How to Use AWS Aurora Database for a Retail Point of Sale (POS) Transaction System
  • Apache Spark 4.0: Transforming Big Data Analytics to the Next Level
  • How to Merge HTML Documents in Java
  • How GitHub Copilot Helps You Write More Secure Code

Use the WinDbg Engine in Visual Studio User-Mode Debugging

By 
Sasha Goldshtein user avatar
Sasha Goldshtein
·
Nov. 15, 11 · News
Likes (0)
Comment
Save
Tweet
Share
11.5K Views

Join the DZone community and get the full member experience.

Join For Free

in our c++ debugging course , there are several scenarios which require windbg and cannot be completed in visual studio. they all rely on advanced extension commands available in windbg. some examples:

  • tracing opened and closed handles with the !htrace command
  • viewing native heap information with the !heap command
  • loading and executing code in the debuggee process with the sdbgext extension commands !loaddll , !remotecall
  • inspecting handles to synchronization objects with the !handle command

the sheer power of windbg built-in commands and extensions makes it a viable replacement to visual studio when doing hard-core debugging. however, the user interface – the tool windows, the source editor, setting up breakpoints, stepping through source, inspecting variables – are no match to the rich visual studio environment.

the good news is that as of visual studio 11, we’ll be able to use the windbg debugging engine (“windows debugger”) inside visual studio, combining the powerful commands with the convenient interface. just use the “windows user mode debugger” transport in the tools | attach to process dialog. this also applies to dumps – you can open dumps with the visual studio “minidump summary” dialog, or you can use the file | open crash dump menu item, the same way as for kernel dumps.

image
(click the screenshot to enlarge)

that’s really all there’s to it – after attaching, you have the windbg shell inside visual studio, in the debugger immediate window which we’ve already seen. the call stack, threads, locals debugger windows are fully functional, and you can combine visual analysis of the source code with running advanced extension commands in the shell.

for example, here’s a thread that is waiting for a mutex:

image
(click the screenshot to enlarge)

which thread owns this mutex? the !handle command comes in handy:

image
(click the screenshot to enlarge)

…and we’ve got the owner information.

visual studio 11 is going to change the way we’re doing crash analysis and live debugging of advanced scenarios. i bet plenty of my past and future students are going to be very happy about being able to use visual studio instead of learning the ropes of another tool, which has quite the reputation for being user-unfriendly :-)

if you’re doing any .net debugging, you’re probably wondering if this means better integration for sos in visual studio. unfortunately, right now the answer is no. with some effort – going through the visual studio tools | attach to process dialog – you can attach the windbg engine to a .net process. however, the engine does not recognize .net any better than standalone windbg, so you don’t have managed call stacks, local variables, and source code support within the ide. but if all you wanted is to run a couple of sos commands without leaving vs, you certainly can.

another caveat is that currently you need to install the wdk on top of visual studio 11 to get the debugger integration. i’m guessing – or rather, hoping – that in the release version it will suffice to install debugging tools for windows.

i have been recently posting short updates and links on twitter as well as on this blog. you can follow me: @goldshtn

Engine Command (computing)

Published at DZone with permission of Sasha Goldshtein, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Creating Application using Spring Roo and Deploying on Google App Engine
  • Build a DIY AI Model Hosting Platform With vLLM
  • Integrating Redis With Message Brokers
  • Terraform State File: Key Challenges and Solutions

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!