This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to configure gdb on arm-linux (for CDB89712)

On host:

This GDB was configured as "--host=i686-pc-linux-gnu
(gdb) target remote
Remote debugging using
0x00008110 in _start ()
(gdb) b main
Breakpoint 1 at 0x8158: file hello.c, line 4.
(gdb) c

Program received signal SIGILL, Illegal instruction.
0x00008114 in _start ()

On target(CDB89712)

# gdbserver /armdevelop/hello
Process /armdevelop/hello created; pid = 196
Remote debugging from host
hello(135): undefined instruction: pc=00008114
Code: e91ba800 e3a0b000 (e7ffdefe) e1a0100d e0812100
Killing inferior

This is a known problem between GDB 5.3 and uclibc: uclibc doesn't
leave the identifying marks that GDB uses to figure out that something
is a "Linux" binary rather than a "generic ELF" binary.  Try a CVS
snapshot of GDB and I bet it'll work.

Thank you Daniel,

I got a CVS snapshot and I have a little different result now.
I tried to compile it the same way (arm-linux) and using armv4l-unknown-linux option but in both cases result was the same "Segmentation fault"
Below I attached a debug output from gdb and gdbserver.
May be I am doing something plainly wrong?
Another interesting detail I noticed - in previous version I had 0x00008110 in _start () in this version 0x40000d20 in ?? ().

I have discovered that if you try to continue wihout breakpoint it sends a messages:

(gdb) c
Sending packet: $Z0,8110,4#e0...Ack
Packet received:
Packet Z0 (software-breakpoint) is NOT supported
Sending packet: $m8110,4#97...Ack Packet received: 03000000
target_xfer_memory (0x8110, xxx, 4, read, xxx) = 4, bytes = 03 00 00 00
Sending packet: $X8110,0:#b8...Ack Packet received:
binary downloading NOT suppported by target
Sending packet: $M8110,4:fedeffe7#ad...Ack << write mem at 0x8110, 4 bytes, fedeffe7 - this fails on target!!
Packet received: OK
target_xfer_memory (0x8110, xxx, 4, write, xxx) = 4, bytes =
fe de ff e7
target_insert_breakpoint (0x8110, xxx) = 0

On target this looks like:

Jan 1 00:45:29 name user.debug klogd: hello: unhandled page fault at pc=0x40003148, lr=0xe7ffdefe (bad address=0x7ffe7118, code 0)

According to

$M8110,4:fedeffe7 - "That's not an arm-linux breakpoint, it's an ARM breakpoint. That's why it isn't working."

I tried to play with set architecture and set osabi but without any luck.

Daniel, you were in that discussion ( - is there any other ways to tell GDB to recognise uClibc binaries?

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]