I'm using the sdk-example "sprite" in samples/gu folder:
http://c.pastebin.com/f1227a361
I modified the Makefiles.sample to build debuginformation inside:
CFLAGS = -Wall -O2 -g
But when i use "psp-objdump -D -l sprite.elf>output.txt" it seems to have wrong line numbers inside the output.txt.
Here is a little example:
Code: Select all
/cygdrive/e/Programme/psptoolchain/build/pspsdk/src/samples/gu/sprite/sprite.c:75
     41c:	8fa30054 	lw	v1,84(sp)
     420:	0460010d 	bltz	v1,858 <main+0x4ac>
     424:	8fa20054 	lw	v0,84(sp)
     428:	44830000 	mtc1	v1,$f0
     42c:	00000000 	nop
     430:	46800520 	cvt.s.w	$f20,$f0
     434:	461aa500 	add.s	$f20,$f20,$f26
/cygdrive/e/Programme/psptoolchain/build/pspsdk/src/samples/gu/sprite/sprite.c:68
     438:	afa00050 	sw	zero,80(sp)
/cygdrive/e/Programme/psptoolchain/build/pspsdk/src/samples/gu/sprite/sprite.c:75
     43c:	4618a502 	mul.s	$f20,$f20,$f24
/cygdrive/e/Programme/psptoolchain/build/pspsdk/src/samples/gu/sprite/sprite.c:68
     440:	0c000a5f 	jal	297c <cosf>
     444:	4600a306 	mov.s	$f12,$f20
     448:	4600a306 	mov.s	$f12,$f20
     44c:	0c000aa1 	jal	2a84 <sinf>
     450:	46190580 	add.s	$f22,$f0,$f25 
The cosinus(cosf) function is on line 82, but it shows line 68, wich confuses me a bit.
I just write this, because i want to create a program that fetches the line numbers and offsets, so that you can set breakpoints inside a c-source-file and debug it with that.
But with this wrong line information my debugger just jumps to wrong lines.
Note:
This bug also seems to happen for psp-addr2line:
Code: Select all
sh-3.2$ psp-addr2line.exe -e  sprite.elf 440
/cygdrive/e/Programme/psptoolchain/build/pspsdk/src/samples/gu/sprite/sprite.c:68
Code: Select all
sh-3.2$ psp-gcc.exe -v
Using built-in specs.
Target: psp
Configured with: ../configure --prefix=/usr/local/pspdev --target=psp --enable-l
anguages=c,c++ --with-newlib --with-gmp --with-mpfr --enable-cxx-flags=-G0
Thread model: single
gcc version 4.3.2 (GCC)
sh-3.2$ psp-objdump.exe -v
GNU objdump 2.16.1 (PSPDEV 20060116)
Copyright 2005 Free Software Foundation, Inc.