views:

41

answers:

2

I just found out how to break into the SetTimer function inside a windows dll (user32.dll). link text

However i need to know what arguments its called with. I think that the arguments are pushed onto the data stack right before calling the function, but I have found no way to display a threads data stack in visual studio 2010.

+1  A: 

If you open up the call stack window (Debug -> Windows -> Call Stack) you should be able to double-click on the functions up the call stack, view the parameters, local variables and so on.

Dean Harding
This is only true for functions for which you have symbols. He's debugging SetTimer, which is a win32 function, so he only has public symbols. To get parameters, you must have full debug symbols.
jeffamaphone
You can find symbols here (I suppose): http://www.microsoft.com/whdc/DevTools/Debugging/symbolpkg.mspx
Moron
@jeffamaphone : If he only wants to see the parameters passed *into* `SetTimer`, then you can just look up the call stack to see what called `SetTimer`: assuming you have the source code/symbols for that (which I assume he does) then it should be no problem.
Dean Harding
Actually I think he's debugging random third party stuff.
jeffamaphone
I cant debug into whats calling SetTimer. I want to find out what timers a third party component registers in order to control it with manual WM_TIMER messages.
ronag
@user346804: Ah, fair enough. In that case, @jeffamaphone's answer is the one you're after :)
Dean Harding
+3  A: 

Open a Memory debug window, and load the address at ESP (which you can get from the Registers Window). ESP points to the top of the stack. If you scroll up the window a bit, you'll see what's been recently pushed onto the stack. Make sure you set the memory window to display one column of 4byte integers (unless you're a 64 bit app, then use 8bytes).

jeffamaphone