views:

1560

answers:

2

What is your favorite technique for launching a windbg user-mode remote debugging session? Why is do you prefer this technique over other techniques? (pros/cons)

There are at least four different ways to do user-mode remote debug using windbg, as documented in the "Remote Debugging" section of the debugging tools for windows help file.

  1. run app on target then attach to it from the host windbg
  2. have the host windbg use remote.exe to launch the app on the target
  3. have the "smart client" host windbg launch the app on the target via a process server that is running on the target
  4. run a windbg instance on the target machine using the option "-server" to automatically start a server, then connect to the server from a 2nd machine.
+1  A: 

Option 1 is my favourite because it is the simplest. I get to launch the app in the normal way without worry about getting WinDbg to set the right working directory, pass any command line arguments, etc.

Fortunately I've not run into any cases where this hasn't worked!

Rob Walker
Option 1 is my least favorite because it's difficult to automate with a script. All of the other options are (equally) easy and efficient with the help of a simple script.
JeffJ
A: 

I tend to use option 4 (-server) because it is the only one that doesn't "pop" when you break into the kernel debugger long enough for the TCP connection to timeout. But this is more complex and not fully satisfying. So I'm looking for "best practices".

JeffJ
I also use option 4. We have our test machines start a windbg server automatically when they log on.
LanceSc