From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23396 invoked by alias); 7 Feb 2003 22:35:58 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 23389 invoked from network); 7 Feb 2003 22:35:57 -0000 Received: from unknown (HELO gatekeeper.tait.co.nz) (202.37.96.11) by 172.16.49.205 with SMTP; 7 Feb 2003 22:35:57 -0000 Received: from gatekeeper.tait.co.nz (localhost.localdomain [127.0.0.1]) by gatekeeper.tait.co.nz (8.11.2/8.9.3) with ESMTP id h17MZtP23715 for ; Sat, 8 Feb 2003 11:35:55 +1300 Received: from sunstorm.tait.co.nz (sunstorm.tait.co.nz [172.25.40.9]) by gatekeeper.tait.co.nz (8.11.2/8.9.3) with ESMTP id h17MZtN23706; Sat, 8 Feb 2003 11:35:55 +1300 Received: from tait.co.nz (sardine.tait.co.nz [172.25.140.19]) by sunstorm.tait.co.nz (iPlanet Messaging Server 5.1 (built May 7 2001)) with ESMTP id <0H9Y00F2OMRUL0@sunstorm.tait.co.nz>; Sat, 08 Feb 2003 11:35:55 +1300 (NZDT) Date: Fri, 07 Feb 2003 22:35:00 -0000 From: Dmytro Bablinyuk Subject: Re: How to configure gdb on arm-linux (for CDB89712) To: Daniel Jacobowitz Cc: gdb@sources.redhat.com Message-id: <3E4434CA.5070001@tait.co.nz> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii; format=flowed Content-transfer-encoding: 7BIT X-Accept-Language: en-us, en User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020830 X-SW-Source: 2003-02/txt/msg00158.txt.bz2 >> On host: >> >> This GDB was configured as "--host=i686-pc-linux-gnu >> --target=arm-linux"... >> (gdb) target remote 172.25.193.23:1023 >> Remote debugging using 172.25.193.23:1023 >> 0x00008110 in _start () >> (gdb) b main >> Breakpoint 1 at 0x8158: file hello.c, line 4. >> (gdb) c >> Continuing. >> >> Program received signal SIGILL, Illegal instruction. >> 0x00008114 in _start () >> (gdb) >> >> >> On target(CDB89712) >> >> # gdbserver 172.25.140.19:1023 /armdevelop/hello >> Process /armdevelop/hello created; pid = 196 >> Remote debugging from host 172.25.140.19 >> 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 ?? (). On host: [root@sardine gdbserver]# arm-gdb -nw /home/Dmytro/Dev/armlinux/ramdisk/target/armdevelop/hello GNU gdb 2003-02-07-cvs Copyright 2003 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=armv4l-unknown-linux"... (gdb) set debug remote 1 (gdb) set debug target 1 (gdb) target remote marin:1023 Remote debugging using marin:1023 Sending packet: $Hc-1#09...Ack Packet received: OK Sending packet: $qC#b4...Ack Packet received: Sending packet: $qOffsets#4b...Ack Packet received: Sending packet: $?#3f...Ack Packet received: T050b:00000000;0d:e0feffbf;0f:200d0040; target_wait (-1, status) = 42000, status->kind = stopped, signal = SIGTRAP Sending packet: $m40000d20,4#87...Ack Packet received: 0d70a0e1 target_xfer_memory (0x40000d20, xxx, 4, read, xxx) = 4, bytes = 0d 70 a0 e1 Sending packet: $Hg0#df...Ack Packet received: OK Sending packet: $g#67...Ack Packet received: 0000000085ffffbf0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e0feffbf00000000200d00400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000 target_fetch_registers (cpsr) = 10000000 0x10 16 target_terminal_ours () 0x40000d20 in ?? () Sending packet: $qSymbol::#5b...Ack Packet received: OK Packet qSymbol (symbol-lookup) is supported (gdb) b main Breakpoint 1 at 0x8158: file hello.c, line 4. (gdb) c Continuing. 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 Packet received: OK target_xfer_memory (0x8110, xxx, 4, write, xxx) = 4, bytes = fe de ff e7 target_insert_breakpoint (0x8110, xxx) = 0 Sending packet: $m8158,4#a3...Ack Packet received: 12000000 target_xfer_memory (0x8158, xxx, 4, read, xxx) = 4, bytes = 12 00 00 00 Sending packet: $M8158,4:fedeffe7#b9...Ack Packet received: OK target_xfer_memory (0x8158, xxx, 4, write, xxx) = 4, bytes = fe de ff e7 target_insert_breakpoint (0x8158, xxx) = 0 target_terminal_inferior () Sending packet: $Hc0#db...Ack Packet received: OK Sending packet: $c#63...Ack target_resume (-1, continue, 0) Packet received: T0b0b:e8f8ffbf;0d:90f8ffbf;0f:58310040; target_wait (-1, status) = 42000, status->kind = stopped, signal = SIGSEGV target_terminal_ours_for_output () Program received signal SIGSEGV, Segmentation fault. Sending packet: $m40003158,4#62...Ack Packet received: 0120dce4 target_xfer_memory (0x40003158, xxx, 4, read, xxx) = 4, bytes = 01 20 dc e4 Sending packet: $g#67...Ack Packet received: 745100401040014028820000fedeffe7acf8ffbfacf8ffbf388100000000000000000000000000001ccd0040e8f8ffbf266100e890f8ffbf02000000583100400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000020 target_fetch_registers (cpsr) = 10000020 0x20000010 536870928 Sending packet: $m40003158,4#62...Ack Packet received: 0120dce4 target_xfer_memory (0x40003158, xxx, 4, read, xxx) = 4, bytes = 01 20 dc e4 Sending packet: $mbffff8e8,4#9c...Ack Packet received: fc2f0040 target_xfer_memory (0xbffff8e8, xxx, 4, read, xxx) = 4, bytes = fc 2f 00 40 Sending packet: $m40002ff4,4#c3...Ack Packet received: 04b04ce2 target_xfer_memory (0x40002ff4, xxx, 4, read, xxx) = 4, bytes = 04 b0 4c e2 Sending packet: $m40002ff8,4#c7...Ack Packet received: 30d04de2 target_xfer_memory (0x40002ff8, xxx, 4, read, xxx) = 4, bytes = 30 d0 4d e2 Sending packet: $m40002ffc,4#f2...Ack Packet received: 40000be5 target_xfer_memory (0x40002ffc, xxx, 4, read, xxx) = 4, bytes = 40 00 0b e5 Sending packet: $m40003000,4#54...Ack Packet received: 44300be5 target_xfer_memory (0x40003000, xxx, 4, read, xxx) = 4, bytes = 44 30 0b e5 Sending packet: $m40003004,4#58...Ack Packet received: 0140a0e1 target_xfer_memory (0x40003004, xxx, 4, read, xxx) = 4, bytes = 01 40 a0 e1 Sending packet: $m40003008,4#5c...Ack Packet received: cca29fe5 target_xfer_memory (0x40003008, xxx, 4, read, xxx) = 4, bytes = cc a2 9f e5 Sending packet: $m4000300c,4#87...Ack Packet received: 0280a0e1 target_xfer_memory (0x4000300c, xxx, 4, read, xxx) = 4, bytes = 02 80 a0 e1 Sending packet: $m40003010,4#55...Ack Packet received: 0aa08fe0 target_xfer_memory (0x40003010, xxx, 4, read, xxx) = 4, bytes = 0a a0 8f e0 Sending packet: $m40003014,4#59...Ack Packet received: 05f7ffeb target_xfer_memory (0x40003014, xxx, 4, read, xxx) = 4, bytes = 05 f7 ff eb Sending packet: $m40003018,4#5d...Ack Packet received: 0030a0e3 target_xfer_memory (0x40003018, xxx, 4, read, xxx) = 4, bytes = 00 30 a0 e3 Sending packet: $m4000301c,4#88...Ack Packet received: 54300be5 target_xfer_memory (0x4000301c, xxx, 4, read, xxx) = 4, bytes = 54 30 0b e5 Sending packet: $m40003020,4#56...Ack Packet received: b8229fe5 target_xfer_memory (0x40003020, xxx, 4, read, xxx) = 4, bytes = b8 22 9f e5 Sending packet: $m40003024,4#5a...Ack Packet received: 58200be5 target_xfer_memory (0x40003024, xxx, 4, read, xxx) = 4, bytes = 58 20 0b e5 Sending packet: $m40003028,4#5e...Ack Packet received: 54901be5 target_xfer_memory (0x40003028, xxx, 4, read, xxx) = 4, bytes = 54 90 1b e5 Sending packet: $m4000302c,4#89...Ack Packet received: 02309ae7 target_xfer_memory (0x4000302c, xxx, 4, read, xxx) = 4, bytes = 02 30 9a e7 Sending packet: $m40003030,4#57...Ack Packet received: 44201be5 target_xfer_memory (0x40003030, xxx, 4, read, xxx) = 4, bytes = 44 20 1b e5 target_terminal_ours () frame.c:1439: internal-error: deprecated_update_frame_pc_hack: Assertion `frame->next != NULL' failed. A problem internal to GDB has been detected. Further debugging may prove unreliable. Quit this debugging session? (y or n) n Create a core file of GDB? (y or n) y Sending packet: $M8110,4:03000000#34...Ack Packet received: OK target_xfer_memory (0x8110, xxx, 4, write, xxx) = 4, bytes = 03 00 00 00 target_remove_breakpoint (0x8110, xxx) = 0 Sending packet: $M8158,4:12000000#40...Ack Packet received: OK target_xfer_memory (0x8158, xxx, 4, write, xxx) = 4, bytes = 12 00 00 00 target_remove_breakpoint (0x8158, xxx) = 0 target_terminal_ours () 0x40003158 in ?? () (gdb) n target_terminal_ours () Cannot find bounds of current function (gdb) quit The program is running. Exit anyway? (y or n) y Sending packet: $k#6b...Ack target_mourn_inferior () target_kill () [root@sardine gdbserver]# On target: # gdbserver 172.25.140.19:1023 /armdevelop/hello Process /armdevelop/hello created; pid = 43 Remote debugging from host 172.25.140.19 Killing inferior # tail /var/log/messages Jan 1 00:00:33 name user.info klogd: eth0: using half-duplex 10Base-T (RJ-45) Jan 1 00:20:33 name syslog.info -- MARK -- Jan 1 00:32:35 name user.debug klogd: hello: unhandled page fault at pc=0x40003158, lr=0x00000002 (bad address=0xe8006126, code 0) Jan 1 00:33:51 name user.debug klogd: hello: unhandled page fault at pc=0x40003158, lr=0x00000002 (bad address=0xe8006126, code 0) Jan 1 00:40:33 name syslog.info -- MARK -- Jan 1 00:40:36 name user.debug klogd: hello: unhandled page fault at pc=0x40003158, lr=0x00000002 (bad address=0xe8006126, code 0) Jan 1 00:48:54 name user.debug klogd: hello: unhandled page fault at pc=0x40003148, lr=0xe7ffdefe (bad address=0x7ffe7118, code 0) Jan 1 00:59:59 name user.debug klogd: hello: unhandled page fault at pc=0x40003158, lr=0x00000002 (bad address=0xe8006126, code 0) Jan 1 01:00:33 name syslog.info -- MARK -- Jan 1 01:08:55 name user.debug klogd: hello: unhandled page fault at pc=0x40003158, lr=0x00000002 (bad address=0xe8006126, code 0) # -- Dmytro Bablinyuk Design Engineer Phone: (64)(3) 358 0307 Tait Electronics Fax : (64)(3) 359 4632 PO Box 1645 Christchurch New Zealand