qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Debugging low level ARM with GDB


From: Dirk Behme
Subject: [Qemu-devel] Debugging low level ARM with GDB
Date: Thu, 23 Mar 2006 17:10:07 +0100
User-agent: Mozilla Thunderbird 1.0.7 (X11/20050923)

Hello,

I'd like to debug low level ARM bootloader U-Boot using ARM
port of QEMU.

I use qemu-0.8.0-i386.tar.gz for this and start QEMU with

qemu-system-arm -S -s -m 64 -net none -nographic -kernel
u-boot.bin -monitor null -parallel null -serial null
Waiting gdb connection on port 1234

(Note: u-boot.bin is the binary one, u-boot used below is
the ELF version)

In another window I start ARM gdb, but seems that I'm not
able to step, disassemble etc:

uboot/u-boot-1.1.4> arm-linux-gdb
GNU gdb 6.4
Copyright 2005 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=i686-pc-linux-gnu
--target=arm-linux".
(gdb) file u-boot
Reading symbols from uboot/u-boot-1.1.4/u-boot...done.
(gdb) target remote localhost:1234
Remote debugging using localhost:1234
0x00000000 in ?? ()
(gdb) info r
r0             0x0      0
r1             0x0      0
...
r12            0x0      0
sp             0x0      0
lr             0x0      0
pc             0x0      0
fps            0x0      0
cpsr           0x400001d3       1073742291
(gdb) disassemble
No function contains program counter for selected frame.
(gdb) s
Cannot find bounds of current function
(gdb) n
Cannot find bounds of current function
(gdb) c
Continuing.

[pressing ctrl-c] Program received signal 0, Signal 0.
0x00018468 in ?? ()
(gdb) s
Cannot find bounds of current function
(gdb) n
Cannot find bounds of current function
(gdb) info r
r0             0xfffecf00       -78080
r1             0x0      0
r2             0x100    256
r3             0x0      0
...
r6             0x0      0
r7             0x400    1024
r8             0x0      0
...
r11            0x0      0
r12            0x18064  98404
sp             0x0      0
lr             0x180f4  98548
pc             0x18468  99432
fps            0x0      0
cpsr           0x600001d3       1610613203
(gdb)

What do I miss here? Seems that program did something, but
I'm not able to debug it.

Two additional questions:

If I load the binary version of image u-boot.bin into QEMU,
how does QEMU know to which start address the image was
linked to? Or do I have to load the ELF file?

If my program wants to access the serial ports, how do I have
to configure the serial driver in my program to access these
ports? E.g. which base address do I have to use in the
serial driver? In real HW they differ from chip to chip.

Many thanks and best regards,

Dirk






reply via email to

[Prev in Thread] Current Thread [Next in Thread]