Saturday, July 4, 2009

How to attach to an already running debugger target using cdb.

For the last year when I wanted to attach to a process using cdb, I'd attach by PID. This meant i'd need to the following dance:

    C:\Program Files\Debugging Tools for Windows (x64)>tlist |findstr firefox
9128 cmd.exe findstr firefox
276 firefox.exe Restore Session - Vimperator

C:\Program Files\Debugging Tools for Windows (x64)>cdb -p 276
It turns out you can just do:

C:\Program Files\Debugging Tools for Windows (x64)>cdb -pn firefox.exe

Microsoft (R) Windows Debugger Version 6.11.0001.404 AMD64
Copyright (c) Microsoft Corporation. All rights reserved.


If there are multiple instances of your process, you'll still need to use tlist
to find the PID you're interested in.

0 comments:

Post a Comment