public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Vladimir Gurevich <vag@paulidav.org>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Debugging U-boot after relocation
Date: Thu, 06 Feb 2003 17:01:43 -0800	[thread overview]
Message-ID: <3E430577.2070707@paulidav.org> (raw)
In-Reply-To: <20030206071042.40185C608E@atlas.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 = (<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
line numbers? 

Could you tell me in more details how do you debug U-boot then?

Thanks,
Vladimir

      reply	other threads:[~2003-02-07  1:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-06  1:16 [U-Boot-Users] Debugging U-boot after relocation Vladimir Gurevich
2003-02-06  7:10 ` Wolfgang Denk
2003-02-07  1:01   ` Vladimir Gurevich [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3E430577.2070707@paulidav.org \
    --to=vag@paulidav.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox