
Dear Wolfgang Wegner,
In message 20100302160513.GF23389@leila.ping.de you wrote:
While trying to debug this I am running into a somewhat strange problem with the symbol table relocation for debugging. I added a printf to board_init_r like this: printf("gd->reloc_off: 0x%08x\n", gd->reloc_off); giving me: gd->reloc_off: 0x07d84000 my TEXT_BASE is 0x40020000, so I set this in my .gdbinit: define ram symbol-file add-symbol-file u-boot 0x47da4000 end
Now in the debugger I do: (gdb) ram add symbol table from file "u-boot" at .text_addr = 0x47da4000 (gdb) b board_init_r Breakpoint 1 at 0x47da4672: file board.c, line 422.
but the breakpoint is never reached. I tried printing the function pointer from the code: printf("%s@%p\n", __FUNCTION__, &board_init_r); resulting in: board_init_r@47da466e The disassembly shows: 4002066e <board_init_r>: 4002066e: 4e56 ffc0 linkw %fp,#-64 40020672: 202d 0014 movel %a5@(20),%d0 40020676: 48d7 3c3c moveml %d2-%d5/%a2-%a5,%sp@
I see no problem here. The 0x47da4672 you got above is obviously the (correct) address for the "movel %a5@(20),%d0" instruction. Assuming you can set breakpoints at all the code should stop there.
and in the debugger I can see: (gdb) print /x *0x47da466e $1 = 0x4e56ffc0
Looks sane to me, too.
Which sort of debugger are you using?
Best regards,
Wolfgang Denk