Have you ever wanted to know when a method is being called – so you think, not problem I will just put a break point there and bob’s your uncle there you go. Then one day you want to do the same with one of the windows dll API’s eg CreateThread.
So what to do ? There does not appear to be any cunning way to do this with Visual Studio ( I am keen to hear if you know me to be wrong! ), but you can do it with the power that is WinDbg which you can get as part of the Debugging Tools for Windows.
Now this is not as easy tool to just pick up and use ( at least not well ) but it is nice and simple in that you don’t have to do too much config to get it going.. it just works! Hey I got it up an running – how hard can it be !
So what do you do if just want to simply break point the CreateThread :
1) Launch WinDbg
2) Ctrl+E : Point it to your exe
3) Ctrl+S : Point to your symbols
4) Ctrl+P : Point to your source
Right now you have all the information you could want ( probably more ).. now lets add that illusive break point using the edit box at the bottom ( basically a command line )
5)
Ahh don’t you love it when it is simple :-)
6) F5 : Then let it run
Then it will run and break, and wait for you
7) k : and view the call stack ( or kP if you want extra param info in your call stack )
No comments:
Post a Comment