Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Debug breakpoints in VC++ .net 2003

Status
Not open for further replies.

paul51

Programmer
May 19, 2000
38
US
Hello,

I am writing a VC++ .net app, and I am having a problem with the breakpoints that I am inserting for debugging.

I can insert a breakpoint and enter the code in debug mode, but the code breaks approximately 5 line before the breakpoint occurs. I have used .net for a few years and have never seen this happen, but I cannot get around it.

It is making the debugging of my program almost impossible, as this happens for ALL of my breakpoints.

Does anyone know what could be causing this?

Thanks,
Paul
 
1) Your code is out of sync with your object files. Come out of visual studio, delete all generated files (.obj, .lib, .dll, .exe, .ncb, .ilk, .pdb).

Check using task manager that there are no devenv.exe's running. They could be holding on to old objs and will stop you deleting them or rebuilding anything.

Start VS again, rebuild and everything should be OK.

2) If it still isn't OK, you have a CR, CRLF, LF problem. Somewhere, one of the lines hasn't been terminated properly. Start up word. In VS, Ctrl-A to select all the code. Ctrl-X to cut the code. Ctrl V in Word. Ctrl-A in Word, Ctrl-X and Ctrl-V in VS. This will correct all the line terminators. Rebuild and your breakpoints will be OK.

Good Luck.
 
Thank you for your help.

Your 2nd suggestion fixed my problem.

Thanks,
Paul
 
If you use VS2005, it will tell you that you have inconsistent line terminators and offer to fix it for you.

I have seen this sort of problem when merging in PVCS. You do the diff, then cut out of the diff and paste in VS. This causes no end of problems on line terminators.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top