[avr-gcc-list] Debugging mixed C/Assembly project in AVRStudio 4.12
From:
Matt Fornero
Subject:
[avr-gcc-list] Debugging mixed C/Assembly project in AVRStudio 4.12
Date:
Wed, 22 Feb 2006 13:43:39 -0500
Hi all.
I'm running into problems attempting to debug a mixed C/assembly project using AVR Studio 4.12
Specifically, I cannot find a way to debug (step through) both my C and assembly files. I've read over the message "converting gas-generated
stabs debugging symbols to Atmel", and the followup "recipe" for debugging assembler source files, but neither seem to quite work.
Using the "recipe" (assemble/compile all files with -gstabs, insert .stabs and .func directives into the assembly source, and then convert the .elf file to a avr-extended .cof file), I am
able to step through both the C source and assembly source, but the entry points to the function do not correctly line up.
That is, if I attempt to step into:
10: -> foo(bar); 11: while(1);
AVRStudio will not actually step into the function until line 11. And when it does, it will be on the second assembly instrunction in the function, rather than the first:
foo: 15: LDI r18, 0 ; Setup loop counter to 0
16: -> MOVW r30, r24 ; copy base address of src to r30
My assembly file is as follows:
; function: sort16bit ; prototype: void sort16bit (unsigned int * arry, ; int length)
; sorts array "src" of size "length" in ascending ; order /* * extern void sort16bit (unsigned int *, int); */
sort16bit: LDI r18, 0 ; Setup loop counter to 0 MOVW r30, r24 ; copy base address of src to r30 LSL r22 ; multiply low word of length by 2
.... ret .endfunc
My C file is: #define LENGTH 10 extern void sort16bit(unsigned int *, int);