Embedded Linux >> ARM based binary with GDB

by pete444 » Wed, 07 Jul 2004 20:20:49 GMT

Jambo,
Im trying to run an ARM based binary under the gdb (in x86 based CPU)
but without any success.

With GDB I use the following compile options:
./configure --host=i686-pc-linux-gnu --target=aem-little-elf

and the binary is compiled with arm-linux-gcc (a toolchain that I
found from web).

The GDB gives me an outpout:
(gdb) target sim
Connected to the simulator.
(gdb) load
...
(gdb) run
Starting program: test
ARMulator can't allocate VM page: Cannot allocate memory


It seems that the brk() starts to loop and finally crashes. Is there
some memory configuration that I have to change? Is it even possible
to run an ARM based binary this way?

Any help is highly appreciated
Pee


Embedded Linux >> ARM based binary with GDB

by bluekarthik » Fri, 16 Jul 2004 20:42:02 GMT


Hi Pee,
I am also in the same arm-linux-gdb Boat.
But, i did it somewhat differently.
I am trying to debug a Arm Cross Compiled Program(using arm-linux-gcc)
using GDB.
normal GDB does not support debugging cross compiled programs.
So, I configured it with the target as arm-linux-gnu.
like :-->
./configure --target=arm-linux --build=i686-pc-linux-gnu --prefix=/usr

But, i was not able to get the arm-linux-gdb binary or the simulator.
how to get my armulator Up in My I386 Box ?

kindly give me some ideas in this regard,
thanx,
karthik bala guru






Similar Threads

1. Getting the KVM running on ARM Linux on an ARM processor based device - Java

2. gdb on arm-linux which actually groks pthreads?

Greetings:

Until recently I had not needed to debug code using
pthreads on arm-linux; now I discover that gdb
5.3 and gdb 6.5 both built with thread support
and built against our glibc2.2.2 (sorry, can't
upgrade) produce no output for threads-related
commands.  gdbserver 5.3 lists only 'thread 1'
regardless of the number of created threads.
I can't build gdbserver 6.5 against our glibc.

Our kernel is 2.4.27 (sorry, can't upgrade).

Has anyone made gdb work for threads in this
environment?

Regards,

Michael

3. gdb for arm

4. arm linux with gdb

5. gdb 6.3 build problem on arm/xscale - Embedded Linux

6. GDB problem on ARM

Hi,

I cross-compiled gbd 6.3 for arm-linux, and I can't make it working.
Here is the problem : whatsoever the program I try to debug, I get the
same error :

# gdb /bin/ls
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
[...]
This GDB was configured as "arm-linux-uclibc"...(no debugging symbols
found)

(gdb) r
Starting program: /bin/ls

Program received signal SIGILL, Illegal instruction.
0x400035e4 in ?? ()
(gdb) bt
#0  0x400035e4 in ?? ()

# cat /proc/795/maps (795 is of course the pid of /bin/ls running in
gdb)
[...]
40000000-40005000 r-xp 00000000 00:0b 9032003
/lib/ld-uClibc-0.9.28.so
[...]


I tried the same thing with a statically linked program :

# file /tmp/a.out
/tmp/a.out: ELF 32-bit LSB executable, ARM, version 1 (ARM), statically
linked, not stripped

# gdb a.out
[...]
This GDB was configured as "arm-linux-uclibc"...
(gdb) r
Starting program: /var/tmp/a.out

Program received signal SIGILL, Illegal instruction.
0x00008090 in _start ()
(gdb) bt
#0  0x00008090 in _start ()
Cannot access memory at address 0x0
(gdb) p/x *(unsigned long *)0x00008090
$1 = 0xe3a0e000

 cat /proc/824/maps
00008000-0004a000 r-xp 00000000 00:0b 8998147    /tmp/a.out
00052000-00053000 rw-p 00042000 00:0b 8998147   /tmp/a.out
00053000-00054000 rwxp 00053000 00:00 0          [heap]
becb1000-becc6000 rwxp becb1000 00:00 0          [stack]


I tried putting breakpoints on main, _init and __uclibc_start_main (for
the dynamically linked binaries) and it's always the same error.

I looked on the net for this problem, and all I found was a 2002 patch
on crt0.S (which can't be applied :)) and some advices on --build and
--host options to pass to the configure of gdb ; but they seems to be
correct.

If anyone have an idea or advice, it would be great :)

(and if there is a better group in Usenet for this kind of problem,
please tell me)

7. gdbserver /gdb use on ARM/XScale help - Embedded Linux

8. Problem connecting to remote arm using gdb...

I have successfully compiled gdb for arm target running on 686, and
cross-compiled gdbserver for arm.  However, I get the following error
when trying to connect over TCP:

gdb> target remote 192.168.25.49:10003
Error while running hook_stop:
Invalid type combination in ordering comparison.
0x40001470 in ?? ()

Anyone have an idea about what the problem is and how to fix it?