qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Debugging low level ARM with GDB
@ 2006-03-23 16:10 Dirk Behme
  2006-03-23 16:26 ` Paul Brook
  2006-03-23 19:44 ` Daniel Jacobowitz
  0 siblings, 2 replies; 11+ messages in thread
From: Dirk Behme @ 2006-03-23 16:10 UTC (permalink / raw)
  To: qemu-devel

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

^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: [Qemu-devel] Debugging low level ARM with GDB
@ 2006-03-24 10:35 Schwarz, Konrad
  2006-03-24 16:32 ` Paul Brook
  0 siblings, 1 reply; 11+ messages in thread
From: Schwarz, Konrad @ 2006-03-24 10:35 UTC (permalink / raw)
  To: qemu-devel


[-- Attachment #1.1: Type: text/plain, Size: 930 bytes --]

Hi,
 
One of the changes I would like to contribute (assuming my company gives
the ok) is a somewhat improved reader for ELF executables, and returns
the entry point.  Although somewhat useless for the bootstrap program
(which must start at the processor's reset address), this is useful to
emulate the actions of a ELF loader, such as included in a boot loader.
However, the current design of QEMU hardcodes the image reading strategy
within the "machine" abstraction (a "machine" is what a "board-support
package" typically targets), so if you would like to use this different
loader in a given machine, you will have to modify the "machine"
implementation.
 
The release process could take up to three weeks, but you might wish to
wait that long.
 
The serial port abstraction, and in particular their base addresses,
also materialize in the "machine" implementation.
 
Regards,
 
Konrad Schwarz
 
 
 

[-- Attachment #1.2: Type: text/html, Size: 2204 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Konrad Schwarz.vcf --]
[-- Type: text/x-vcard; name="Konrad Schwarz.vcf", Size: 650 bytes --]

BEGIN:VCARD
VERSION:2.1
N:Schwarz;Konrad
FN:Konrad Schwarz
ORG:Siemens AG;CT SE 2
TITLE:Principal Engineer
TEL;WORK;VOICE:+49 (89) 636-53579
TEL;WORK;FAX:+49 (89) 636-45450
ADR;WORK;ENCODING=QUOTED-PRINTABLE:;53 518;Siemens AG=0D=0ACT SE 2;M=FCnchen;;81730;Germany
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:53 518=0D=0ASiemens AG=0D=0ACT SE 2=0D=0AM=FCnchen 81730=0D=0AGermany
ADR;POSTAL;ENCODING=QUOTED-PRINTABLE:;;Siemens AG=0D=0ACT SE 2;M=FCnchen;;81730;Germany
LABEL;POSTAL;ENCODING=QUOTED-PRINTABLE:Siemens AG=0D=0ACT SE 2=0D=0AM=FCnchen 81730=0D=0AGermany
EMAIL;PREF;INTERNET:konrad.schwarz@siemens.com
REV:20060130T101011Z
END:VCARD

^ permalink raw reply	[flat|nested] 11+ messages in thread
* [Qemu-devel] Debugging low level ARM with GDB
@ 2006-03-23  9:25 Dirk Behme
  0 siblings, 0 replies; 11+ messages in thread
From: Dirk Behme @ 2006-03-23  9:25 UTC (permalink / raw)
  To: qemu-devel

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 want 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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2006-03-27 19:48 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-23 16:10 [Qemu-devel] Debugging low level ARM with GDB Dirk Behme
2006-03-23 16:26 ` Paul Brook
2006-03-24 15:46   ` Dirk Behme
2006-03-24 16:28     ` Paul Brook
2006-03-24 16:51       ` Dirk Behme
2006-03-24 17:09         ` Paul Brook
2006-03-27 19:48     ` andrzej zaborowski
2006-03-23 19:44 ` Daniel Jacobowitz
  -- strict thread matches above, loose matches on Subject: below --
2006-03-24 10:35 Schwarz, Konrad
2006-03-24 16:32 ` Paul Brook
2006-03-23  9:25 Dirk Behme

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).