Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
step 1) Start new win32 console application;
step 2) Write code like that:
C++
CClass* c1 = new CClass();

step 3) Place breakpoint on line written in step 2;
step 4) Start debug;
step 5) Press F11 ("step in").
Now we can see that we jumped in "new.cpp". Can I customize the debugger so that it does not "step in" into system files like "new.cpp"?

p.s. sorry for my english...
Posted
Comments
Richard MacCutchan 8-Jan-12 12:53pm    
Press F10 : step over.
Albert Holguin 8-Jan-12 15:10pm    
That should step into the constructor already, never seen that jump into "new.cpp". Maybe there's a setting somewhere but in using a lot of different versions of studio, I can't remember that happening... Then again, it may be one of those things you just sort of learn to not pay attention to.
YuriMaks 9-Jan-12 3:34am    
It seems that you are lucky. My debugger behaves differently. Fortunately Paul Watt method works.
Albert Holguin 9-Jan-12 13:21pm    
Could be I've learned to overlook that... it's possible...
Stefan_Lang 9-Jan-12 4:23am    
Great question. It bugs me everytime it happens, but somehow I never thought to ask.

Good to know there's a way around it, too!

You can define these keys in the registry and take advantage of this "officially unsupported feature" in Visual Studio.

The link depends on what version of Visual Studio you are running and if you are using a 32-bit or 64-bit OS.

For Visual Studio 2008 on a 32-bit system:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\NativeDE\StepOver

For Visual Studio 2008 on a 64-bit system:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0\NativeDE\StepOver

You should see a few entries already populated at that location.

Add the following string entry, and you will skip over the calls to new:

Key: Skip Operator New
Type: REG_SZ
Value: operator new


This feature supports regular expressions to skip over MFC CString calls, stl, boost etc.

If you have a different version of visual studio, you generally just need to adjust the version number, except for VS2003 and VS6, they have entirely different keys. But the feature is there as well.

Regard
 
Share this answer
 
Comments
YuriMaks 9-Jan-12 3:34am    
Thank you! It works!
YuriMaks 9-Jan-12 3:54am    
P.S. The best I found for StepOver:
Use "std\:\:.*=NoStepInto" to skip whole std library
I believe there is an option for that but I forgot what exactly it was. On the other hand, why not put your breakpoint in the constructor method of your CClass? That is where you want to have a look right?

Good luck!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900