[uClibc]Gdb with uClibc
David Meggy
dmeggy at techsol.ca
Wed Feb 5 19:21:57 UTC 2003
I still seem to have problems. Gdbserver on the arm reports an
undefined instruction: pc=00008088.
Looking at arm-linux-objdump -D | less I see
00008084 <_start>:
8084: e3a0b000 mov fp, #0 ; 0x0
8088: e49d0004 ldr r0, [sp], #4
808c: e1a0100d mov r1, sp
8090: e0812100 add r2, r1, r0, lsl #2
and 00008088 looks like a valid instruction to me.
This is the view on the PC
(gdb) target extended-remote 192.168.0.109:1500
A program is being debugged already. Kill it? (y or n) y
Remote debugging using 192.168.0.109:1500
0x00008084 in _start ()
(gdb) b main
Breakpoint 1 at 0x819c: file HelloWorld.c, line 4.
(gdb) cont
Continuing.
Program received signal SIGILL, Illegal instruction.
0x00008088 in _start ()
(gdb) quit
The program is running. Exit anyway? (y or n) y
What am I missing?
david
On Wed, 2003-02-05 at 11:07, Paul Mundt wrote:
> David,
>
> This just looks like a simple usage issue. By your example below, the
> minute you set the remote target, the inferior is already running on the
> gdbserver side. When you type 'run', gdb is attempting to run the
> application itself, thus dropping the existing target setting (and
> running ARM binaries on an i386 tends to yield the don't know how to run
> error .. and for good reason). The killing inferior message comes from
> the fact that you've connected to gdbserver and then dropped the
> connection by way of 'run'.
>
> Instead of 'run', simply do a 'continue', to continue execution on the
> gdbserver side, and that should get you a bit further.
>
> On Wed, 2003-02-05 at 12:47, David Meggy wrote:
> > ~/tmp$ arm-linux-gdb HelloWorld
> > GNU gdb 5.3
> > Copyright 2002 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=i386-linux --target=arm-linux"...
> > (gdb) target remote 192.168.0.109:1500
> > Remote debugging using 192.168.0.109:1500
> > 0x00008084 in _start ()
> > (gdb) list
> > 1 #include <stdio.h>
> > 2
> > 3 int main() {
> > 4 printf("Hello World\n");
> > 5 return 0;
> > 6 }
> > (gdb) run
> > The program being debugged has been started already.
> > Start it from the beginning? (y or n) y
> > Starting program: /home/david/tmp/HelloWorld
> > Don't know how to run. Try "help target".
> > (gdb)
> >
> > and at this point the arm board process quits with the message "Killing
> > inferior"
> >
>
> Regards,
>
> --
> Paul Mundt <paul.mundt at timesys.com>
> TimeSys Corporation
--
~~~~~~~~~~~~~~~~~~~~~~~~
David Meggy
Engineering
Technical Solutions Inc.
Unit #1 7157 Honeyman St
Delta BC Canada, V4G 1E2
www.techsol.ca
eMail: dmeggy at techsol.ca
Tel: 604 946 TECH (8324)
Fax: 604 946 6445
~~~~~~~~~~~~~~~~~~~~~~~~
More information about the uClibc
mailing list