Debugging GCC with JTAGICE mkII F11 problem

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is an observed debugging problem under Win2000 Pro SP4 in AVRStudio 4.15 build 623 using WinAVR (GCC) 20090313 using JTAGICE mkII with an AT90CAN128 on a STK500/501.

The JTAGICE mkII reports:
Hardware Revision 0x00
Firmware Revision 052C 052C

When F11 debug stepping the first line of code in each C function (except for main) is never stepped into and using run to cursor on the first line gives the error "Please place the cursor on a valid source line". Switching to dissembler view shows the first line of code in each function is missing (at least all the ones I checked), yet the .lss file does have the complete correct code.

Has anyone else seen this?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I can only guess that your .lss file is from a previous build. Linkers in general do not normally remove referenced code.

On the other hand avr-gcc tools have so many options, you may have chosen a "linker optimising" flag.

Can you reproduce this behaviour in a simple program?
Is the "missing" instruction(s) redundant?

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I misspoke. I turns out the source code line is missing from the dissembler view and run to cursor doesn't work on this missing source code line. I looked closer and the actual assembly code is present without the source code line.

The build is current and the complete source is in the .lss file. The missing source instruction is a write to an AVR special function register and is not redundant.

I removed allot of comments from the source and now debug run to cursor just skips past the still missing dissembler view line without any error. This is instructional example code that runs around 216.7 k with full comments and only 42.7 k with most comments removed. Still the .lss source is correct in all cases.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Mike,

Does it do this even if built -O0 ?

By the way I've recently spotted Studio doing something that I was never aware of it doing previously (perhaps it did and I never noticed?). When you start the simulator in the project directory it creates a file called sourceLineMap.txt which appears to be a record of how it parsed the .ELF file as it loaded it.

Cliff

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Cliff,

This behavior was in -Os. The -Os missing dissembler view source code line is present in the -O0 dissembler view.

If you like I can e-mail you the program code (its currently about 217.9 kb source - mostly comments) for the AT90CAN128. The error is seen very early in the CAN initialization code so preserving the rest of the source code is only to avoid changing the compiling environment (you do not have to wade through it all). Please PM an e-mail address if you want a copy.