Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Further automation with WinDbg

I'm testing an application running on IIS using AppVerifier/WinDbg/cdb. Basically the schema is as follows: when IIS starts cdb attaches to the process and creates a named-pipe, then I use WinDbg to connect to the pipe. Then I run thousands of test cases against the application and wait until AppVerifier throws something.

Problems/Questions:

  1. For the duration (around 10 hours) of the test, IIS is restarted around thousand times, every time it's restarted WinDbg is shut down and I've to manually re-start the WinDbg. Is there a way to say WinDbg NOT to shut down when the pipe is closed, but retry to connect it?
  2. I've to continuously sit on front of WinDbg and wait for AppVerifier to throw something? Is there a way to say to WinDbg to beep or show a popup when it's stopped by exception?

Thanks.

like image 398
Azho KG Avatar asked Oct 11 '22 07:10

Azho KG


1 Answers

You can use the sxe command (or other sx* commands) to have WinDbg run a command when an exception is hit. For a trivial example, this prints "Hello, world: " when a module is loaded:

sxe -c ".printf \"Hello, world: \"" ld

You might think to combine this with the .beep command, but this results in a syntax error. I think that might be related to the note in the .beep help that says "This command cannot be used in script files." However, you should be able to use .shell to do something useful.

I haven't tried it, but perhaps it is possible to hack around your reconnection problem using the sx* commands to trap the "process exit" event. Or maybe you could have the cdb instance that is started with IIS notify you when an exception occurs, so that you can then connect to it using WinDbg?

like image 121
bk1e Avatar answered Oct 14 '22 10:10

bk1e