public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
To: u-boot@lists.denx.de
Subject: [U-Boot] [GIT PULL] MIPS updates
Date: Thu, 04 Sep 2008 02:06:36 +0900	[thread overview]
Message-ID: <48BEC41C.9000301@ruby.dti.ne.jp> (raw)

Hi Wolfgang,

please pull MIPS repository to pick up the following change:

---

The following changes since commit 628ffd73bcff0c9f3bc5a8eeb2c7455fe9d28a51:
  Jean-Christophe PLAGNIOL-VILLARD (1):
        device: make device_register() clone the device

are available in the git repository at:

  git://git.denx.de/u-boot-mips.git master

Jean-Christophe PLAGNIOL-VILLARD (1):
      doc/qemu_mips: add doc howto debug u-boot with gdb

 doc/README.qemu_mips |   64 +++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 63 insertions(+), 1 deletions(-)

diff --git a/doc/README.qemu_mips b/doc/README.qemu_mips
index c9ac3f3..472469f 100644
--- a/doc/README.qemu_mips
+++ b/doc/README.qemu_mips
@@ -1,7 +1,7 @@
 
 Notes for the Qemu MIPS port
 
-Example usage:
+I) Example usage:
 
 # ln -s u-boot.bin mips_bios.bin
 start it:
@@ -16,3 +16,65 @@ create image:
 # dd of=flash bs=1k conv=notrunc if=u-boot.bin
 start it:
 # qemu-system-mips -M mips -pflash flash -monitor null -nographic
+
+II) How to debug U-Boot
+
+In order to debug U-Boot you need to start qemu with gdb server support (-s)
+and waiting the connection to start the CPU (-S)
+
+# qemu-system-mips -S -s -M mips -pflash flash -monitor null -nographic
+
+in an other console you start gdb
+
+1) Debugging of U-Boot Before Relocation
+
+Before relocation, the addresses in the ELF file can be used without any problems
+buy connecting to the gdb server localhost:1234
+
+# mipsel-unknown-linux-gnu-gdb u-boot
+GNU gdb 6.6
+Copyright (C) 2006 Free Software Foundation, Inc.
+GDB is free software, covered by the GNU General Public License, and you are
+welcome to change it and/or distribute copies of it under certain conditions.
+Type "show copying" to see the conditions.
+There is absolutely no warranty for GDB.  Type "show warranty" for details.
+This GDB was configured as "--host=i486-linux-gnu --target=mipsel-unknown-linux-gnu"...
+(gdb)  target remote localhost:1234
+Remote debugging using localhost:1234
+_start () at start.S:64
+64              RVECENT(reset,0)        /* U-boot entry point */
+Current language:  auto; currently asm
+(gdb)  b board.c:289
+Breakpoint 1 at 0xbfc00cc8: file board.c, line 289.
+(gdb) c
+Continuing.
+
+Breakpoint 1, board_init_f (bootflag=<value optimized out>) at board.c:290
+290             relocate_code (addr_sp, id, addr);
+Current language:  auto; currently c
+(gdb) p/x addr
+$1 = 0x87fa0000
+
+2) Debugging of U-Boot After Relocation
+
+For debugging U-Boot after relocation we need to know the address to which
+U-Boot relocates itself to 0x87fa0000 by default.
+And replace the symbol table to this offset.
+
+(gdb) symbol-file
+Discard symbol table from `/private/u-boot-arm/u-boot'? (y or n) y
+Error in re-setting breakpoint 1:
+No symbol table is loaded.  Use the "file" command.
+No symbol file now.
+(gdb) add-symbol-file u-boot 0x87fa0000
+add symbol table from file "u-boot" at
+        .text_addr = 0x87fa0000
+(y or n) y
+Reading symbols from /private/u-boot-arm/u-boot...done.
+Breakpoint 1 at 0x87fa0cc8: file board.c, line 289.
+(gdb) c
+Continuing.
+
+Program received signal SIGINT, Interrupt.
+0xffffffff87fa0de4 in udelay (usec=<value optimized out>) at time.c:78
+78              while ((tmo - read_c0_count()) < 0x7fffffff)

             reply	other threads:[~2008-09-03 17:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-03 17:06 Shinya Kuribayashi [this message]
2008-09-03 21:00 ` [U-Boot] [GIT PULL] MIPS updates Wolfgang Denk
  -- strict thread matches above, loose matches on Subject: below --
2008-12-10 15:04 Shinya Kuribayashi
2008-12-12 23:36 ` Wolfgang Denk
2008-12-17 13:43 Shinya Kuribayashi
2008-12-30 22:29 ` Wolfgang Denk
2009-01-27 14:16 Shinya Kuribayashi
2009-01-27 19:57 ` Wolfgang Denk
2009-05-16  0:29 Shinya Kuribayashi
2009-05-16  0:43 ` Shinya Kuribayashi
2009-05-16  7:36   ` Wolfgang Denk
2009-05-16  7:36 ` Wolfgang Denk
2010-01-20 12:23 Shinya Kuribayashi
2010-01-21 21:03 ` Wolfgang Denk

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=48BEC41C.9000301@ruby.dti.ne.jp \
    --to=skuribay@ruby.dti.ne.jp \
    --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