Block Step Into Debugging for a function

R

rawCoder

Hi,

Is it possible to block the debugger to Step Into a function ( in VS 2005 or
VS2003 ) - Even If I press F11 (the Step Into Key)?

////////////////////////////////////////////////////////////////////////////
//////////////////
Example (plz read comment )

void Main()
{
Foo1(); // Pressing F11 should not take the control into the
definition of Foo2
Foo2(); // Debugger should work normally on this
}

// Control should not come here when Stepped Into this function
void Foo1()
{
}

// Debugger should work normally on this
void Foo2()
{
}
////////////////////////////////////////////////////////////////////////////
//////////////////

Its like hiding a particular function from the debugger - in above example
Foo2.

Practical Implementation Need will be the .Instance method of a singleton
class - which no one wants to look at while debugging.

Am I asking for too much :)

Thank You,
rawCoder
 
S

Simon Dahlbacka

See System.Diagnostics.DebuggerHiddenAttribute and/or
System.Diagnostics.DebuggerStepThroughAttribute
 
R

rawCoder

Simon ,

That Works Great,



For those of you who want to know the difference between the two.

System.Diagnostics.DebuggerStepThroughAttribute (Breakpoints are allowed in
the method)

System.Diagnostics.DebuggerHiddenAttribute (Breakpoints are not allowed in
the method)


Thanx.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top