Fog Creek Software
Discussion Board




Skip dispatcher function single-stepping?

We have a long message dispatcher routine in our project and everytime I am debugging the message handling code I have to single-step through the message dispatcher routine to end up at the message handler function I am really interested in. There are many many handlers so I can't possibly set breakpoints in all of them instead. Does anyone know of a way in the VS.NET debugger to step directly into the message handler? Am I making sense? For example, I am at the following line in the debugger.

    Dispatch(hMsg);

In order to figure out what handler is handling "hMsg" I have to step through the code inside Dispatch() to step into the handler. Any way to get around that? I tried to compile the Dispatcher routine without debugging symbols but a single step at the same point would just skip even the message handler function call all together. Any other ideas?? Any way I can play with #line to get around this?

pl
Friday, December 13, 2002

Yeah, I like to avoid stepping in things too :)

At this site:
http://www.highprogrammer.com/alan/windev/visualstudio.html

is this tip: See if that's what you need. (I've never tried it. Just read it today).

Avoiding Stepping Into Things

It's often useful to avoid stepping into some common code like constructors or overloaded operators. autoexp.dat provides this capability. Add a section called "[ExecutionControl]". Add keys where the key is the function name and the value is "NoStepInto". You can specify an asterisk (*) as a wildcard as the first set of colons for a namespace or class.

autoexp.dat is only read on Visual Studio's start up.

To ignore the function myfunctionname, and all calls to the class CFoo:

[ExecutionControl] myfunctionname=NoStepInto CFoo::*=NoStepInto

To ignore construction and assignment of MFC CStrings: (Notice the extra = in CString::operator=.)

[ExecutionControl] CString::CString=NoStepInto CString::operator==NoStepInto

To ignore all ATL calls:

[ExecutionControl] ATL::*=NoStepInto

sgf
Friday, December 13, 2002

With managed code there is the [DebuggerStepThrough] attribute...

Duncan Smart
Monday, December 16, 2002

Thanks, but the "NoStepInto" option just skip whole function all together (like F10) and wouldn't stop in the message handler invoked by my dispatcher function.

Any other ideas? Is there another similar option like "NoStepInto" but would skip only the function specified but not the callee of that function?

pl
Monday, December 16, 2002

*  Recent Topics

*  Fog Creek Home