[U-Boot-Users] Debugging U-boot after relocation
vag at paulidav.org
Fri Feb 7 02:01:43 CET 2003
Wolfgang Denk wrote:
> Did you use "symbol-file" without argument to delete the old,
> flash-based symbol table first? Otherwise GDB may get confused
> because there are two sym,bol tables loaded which contain the same
> symbols at different addresses.
Actually, the empty "file" command that I used is supposed to
have the same effect. Anyway, I tried your suggestion, and
problems are still there.
A good example might be:
No symbol file now.
(gdb) add-symbol-file u-boot 0x7fd0000
add symbol table from file "u-boot" at
.text_addr = 0x7fd0000
(y or n) y
Reading symbols from u-boot...done.
(gdb) break start.S:1338
Breakpoint 1 at 0xfffc2600: file /home/vgurevic/vag/u-boot-0.2.0/cpu/ppc4xx/start.S, line 1338.
(gdb) list 1338
1333 add r0,r0,r11
1334 stw r10,0(r3)
1335 stw r0,0(r4)
1336 bdnz 3b
1340 * Now clear BSS segment
1342 lwz r3,GOT(.bss)
(gdb) p &clear_bss
$1 = (<text variable, no debug info> *) 0x7fd2600 <clear_bss>
As you can see, gdb relocated the address for the
symbol in .text session (clear_bss), but failed to
relocate addresses associated with line numbers.
This completely screwes up ddd and Emacs gdb interfaces,
since they (often) don't know which line to show. This
also screwes up next, step and "execute-till-here"
(implemented via tbreak at a line number).
Can it be a gdb "feature" or there is a way to tell it about
Could you tell me in more details how do you debug U-boot then?
More information about the U-Boot