Debugging in VC++

For developers writing C++, Fortran, Java, code who have questions or comments to make.

Moderators: silvia, selimgunay, Moderators

Post Reply
seocy
Posts: 39
Joined: Wed Feb 22, 2006 6:26 pm
Location: Lehigh

Debugging in VC++

Post by seocy »

Dear

I add a new material into OS and compiled it using VC++.
In order to debug the code that I created, I placed a cursor to the new code and tried to debug it using Ctrl+ F10 key. Somehow, the program just ran without stopping in the line where I placed a cursor :( . Does anybody know how to debug the code? Thanks in advance....
gqw
Posts: 5
Joined: Mon Jul 18, 2005 7:31 am
Location: hunan university

Post by gqw »

you should choose "Debug" option to build you code
seocy
Posts: 39
Joined: Wed Feb 22, 2006 6:26 pm
Location: Lehigh

Post by seocy »

Hi gpw

Thanks for your comment though, I don't understand your comment correctly. What I did to debug my code, I placed a cursor to the new line of the code and chosed "start Debug" from the pull-down menu "build" in VC++ and then chosed "run to cursor" subsequently. This is the only way that I know to debug it in VC++. Somehow, when i tried, the program just ran to the end without stopping at the line where I want to start debugging it. If you are telling me other way to debug, would you be kind enough to say more in detail. Thanks alot anyway.
gqw
Posts: 5
Joined: Mon Jul 18, 2005 7:31 am
Location: hunan university

Post by gqw »

first select the Debug setting ,using "Solution Configuration" from the "Standard" toolbar" ,then rebuild .

you can add break point
1.Put your cursor on line that you want to stop
2.right-click ,chosed insert breakpoint,
3.To debug, press F5 (or "Debug -> Start")
To step through the code, press F10 (or "Debug -> Step Over")
To resume, press F5, or to cancel debugging, press Shift+F5 (or "Debug -> Stop Debugging")
To clear a breakpoint, click on it (the big red dot)
seocy
Posts: 39
Joined: Wed Feb 22, 2006 6:26 pm
Location: Lehigh

Post by seocy »

Thanks gqw!!!
Post Reply