View previous topic :: View next topic |
Author |
Message |
jjm1964
Joined: 10 Mar 2005 Posts: 6
|
Erratic Debugging |
Posted: Wed Apr 13, 2005 2:09 pm |
|
|
Hello,
I'm having a problem debugging - sometimes when I set breakpoints, I get an error saying the breakpoint is invalid when it is on a valid line. I know that you can't put a breakpoint on a conditional ( if ) or a loop condition (for, while, do, switch, etc.) - I'm putting it on an assignment, a return etc. Also, when I step through the code the stepping doesn't always look correct (i.e., steps onto a closing bracket, etc.) Is this a problem with MPLAP IDE or the CCS plugin?
Thanks |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Wed Apr 13, 2005 3:08 pm |
|
|
It sounds more like a problem with the debug info in the .coff file. The coff file format is a standard file format for debuggers used on many computer platforms. MPLAB had some problems fixed in recent versions, but I suspect there are situations where CCS is not very accurate in generating the debug info data as well.
Optmized code is always a problem to debuggers because how do you set a breakpoint on a source line when that source line was optimized away? Debugging your code with the optimization switched off will show to be much more accurate.
Do you have a small piece of example code where the debugger is stepping onto closing brackets? This is not correct and after analysing this we can post a bug report to CCS. |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
Source files must end with CR/LF linefeed |
Posted: Wed May 31, 2006 2:09 pm |
|
|
Using CCS v3.236 I was getting more and more problems of the debug output not being alligned with the assembly view in MPLAB. Getting very annoyed I finally decided to dig deep into this problem and by cutting away parts of my program I finally discovered the cause of my problems.
It turns out that the last line in each file must end with a Newline character (an empty line) !
The MPLAB editor will prevent this error by automatically adding a newline to your files in case you haven't provided one. I got these problems because I modified some files using another editor.
It seems like this bug has been solved in more recent versions. Testing with v3.241 gave correct results but v3.236 is the latest 'stable' release and I like to work with a version of which I know which bugs there are. |
|
|
|