From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vladimir Gurevich Date: Thu, 06 Feb 2003 17:01:43 -0800 Subject: [U-Boot-Users] Debugging U-boot after relocation In-Reply-To: <20030206071042.40185C608E@atlas.denx.de> References: <20030206071042.40185C608E@atlas.denx.de> Message-ID: <3E430577.2070707@paulidav.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Wolfgang, 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: (gdb) symbol-file 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 1337 4: 1338 clear_bss: 1339 /* 1340 * Now clear BSS segment 1341 */ 1342 lwz r3,GOT(.bss) (gdb) p &clear_bss $1 = ( *) 0x7fd2600 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 line numbers? Could you tell me in more details how do you debug U-boot then? Thanks, Vladimir