From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27139 invoked by alias); 24 Mar 2004 13:10:48 -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 27130 invoked from network); 24 Mar 2004 13:10:46 -0000 Received: from unknown (HELO fela.ch) (62.167.9.67) by sources.redhat.com with SMTP; 24 Mar 2004 13:10:46 -0000 Received: from 192.168.139.154 (DHCP154 [192.168.139.154]) by fela.ch (8.9.3/8.9.3) with ESMTP id OAA04071; Wed, 24 Mar 2004 14:10:37 +0100 From: Lukas Heiniger Organization: Fela Management AG To: Daniel Jacobowitz Subject: Re: SIGTRAP or SIG32 when remote debugging threads Date: Wed, 24 Mar 2004 14:44:00 -0000 User-Agent: KMail/1.5.4 Cc: gdb@sources.redhat.com References: <200403191107.34202.lukas.heiniger@fela.ch> <200403231755.46001.lukas.heiniger@fela.ch> <20040323191337.GA28050@nevyn.them.org> In-Reply-To: <20040323191337.GA28050@nevyn.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200403241411.16660.lukas.heiniger@fela.ch> X-SW-Source: 2004-03/txt/msg00229.txt.bz2 On Tuesday 23 March 2004 20:13, Daniel Jacobowitz wrote: > On Tue, Mar 23, 2004 at 05:55:45PM +0100, Lukas Heiniger wrote: > > (gdb) set solib-absolute-prefix /home/hynix/arm/arm-linux > > (gdb) set solib-absolute-prefix /home/hynix/arm/arm-linux > > (gdb) c > > Continuing. > > > > Program received signal SIG32, Real-time event 32. > > 0x40088534 in ?? () > > > > (gdb) set solib-absolute-prefix /home/hynix/arm/arm-linux > > Reading symbols from /home/hynix/arm/arm-linux/lib/libm.so.6...done. > > Loaded symbols for /home/hynix/arm/arm-linux/lib/libm.so.6 > > This suggests that the dynamic linker breakpoint wasn't hit. You may > want to use 'set debug remote 1' and 'set debug target 1' to try to > figure out where the breakpoint was set, and why it wasn't hit. > > > 2 Thread 2049 0x400fa7b8 in tcsetattr (fd=1, optional_actions=1, > > termios_p=0x0) at ../sysdeps/unix/sysv/linux/tcsetattr.c:92 > > 1 Thread 1024 0x40088534 in __sigsuspend (set=0xbffffc6c) at > > ../sysdeps/ unix/sysv/linux/sigsuspend.c:54 > > These are taken from the debug information; they're relative to the > objdir when your target glibc was built. They don't necessarily refer > to on-disk files. Thanks again for your quick answer. It looks like setting and hitting the shlib event breakpoint works. As much as I understand, the problem is that in the first target_xfer_memory (see below) the pointer to the dynamic section is 0 (in the line that begins with 15 00 ...). elf_locate_base therefore returns 0 for the debug_base and the list of currently loaded shared objects is not built. After the program has been continued, the second target_xfer_memory (invoked upon specifiying solib-absoulute-prefix again) returns a valid pointer to the dynamic section and the libs are loaded. Is this normal behaviour or is there anything I can do about it? Lukas Heiniger ... (gdb) set solib-absolute-prefix /home/hynix/target_fs (gdb) target remote /dev/ttyS0 Remote debugging using /dev/ttyS0 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:50feffbf;0f:70250040; target_wait (-1, status) = 42000, status->kind = stopped, signal = SIGTRAP target_terminal_ours () Sending packet: $m40002570,4#5f...Ack Packet received: 0d00a0e1 target_xfer_memory (0x40002570, xxx, 4, read, xxx) = 4, bytes = 0d 00 a0 e1 0x40002570 in ?? () Sending packet: $m20328e4,b0#c3...Ack Packet received: ... target_xfer_memory (0x20328e4, xxx, 176, read, xxx) = 176, bytes = 01 00 00 00 01 00 00 00 01 00 00 00 57 00 00 00 01 00 00 00 19 01 00 00 0c 00 00 00 84 12 00 02 0d 00 00 00 74 14 02 02 04 00 00 00 30 01 00 02 05 00 00 00 a0 0a 00 02 06 00 00 00 50 04 00 02 0a 00 00 00 83 03 00 00 0b 00 00 00 10 00 00 00 15 00 00 00 00 00 00 00 03 00 00 00 5c 27 03 02 02 00 00 00 f0 02 00 00 14 00 00 00 11 00 00 00 17 00 00 00 94 0f 00 02 11 00 00 00 84 0f 00 02 12 00 00 00 10 00 00 00 13 00 00 00 08 00 00 00 fe ff ff 6f 04 0f 00 02 ff ff ff 6f 03 00 00 00 f0 ff ff 6f 38 0e 00 02 00 00 00 00 00 00 00 00 Sending packet: $qSymbol::#5b...Ack Packet received: qSymbol:5f5f707468726561645f746872656164735f6576656e7473 Packet qSymbol (symbol-lookup) is supported Sending packet: $qSymbol::5f5f707468726561645f746872656164735f6576656e7473#47...Ack Packet received: OK (gdb) maint info breakpoints Num Type Disp Enb Address What -1 longjmp resume keep n 0x00000000 -2 shlib events keep y 0x4000c3fc (gdb) c Continuing. Sending packet: $Z0,4000c3fc,4#39...Ack Packet received: Packet Z0 (software-breakpoint) is NOT supported Sending packet: $m4000c3fc,4#f0...Ack Packet received: 002094e5 target_xfer_memory (0x4000c3fc, xxx, 4, read, xxx) = 4, bytes = 00 20 94 e5 Sending packet: $X4000c3fc,0:#11...Ack Packet received: binary downloading NOT suppported by target Sending packet: $M4000c3fc,4:01009fef#35...Ack Packet received: OK target_xfer_memory (0x4000c3fc, xxx, 4, write, xxx) = 4, bytes = 01 00 9f ef target_insert_breakpoint (0x4000c3fc, xxx) = 0 target_terminal_inferior () Sending packet: $vCont?#49...Ack Packet received: vCont;c;C;s;S Packet vCont (verbose-resume) is supported Sending packet: $vCont;c#a8...Ack target_resume (-1, continue, 0) Packet received: T4d0b:68fcffbf;0d:4cfcffbf;0f:34850840; target_wait (-1, status) = 42000, status->kind = stopped, signal = SIG32 target_terminal_ours_for_output () Program received signal SIG32, Real-time event 32. Sending packet: $M4000c3fc,4:002094e5#d3...Ack Packet received: OK target_xfer_memory (0x4000c3fc, xxx, 4, write, xxx) = 4, bytes = 00 20 94 e5 target_remove_breakpoint (0x4000c3fc, xxx) = 0 target_terminal_ours () Sending packet: $m40088534,4#6d...Ack Packet received: 0040a0e1 target_xfer_memory (0x40088534, xxx, 4, read, xxx) = 4, bytes = 00 40 a0 e1 0x40088534 in ?? () (gdb) set solib-absolute-prefix /home/hynix/target_fs Sending packet: $m20328e4,b0#c3...Ack Packet received: ... target_xfer_memory (0x20328e4, xxx, 176, read, xxx) = 176, bytes = 01 00 00 00 01 00 00 00 01 00 00 00 57 00 00 00 01 00 00 00 19 01 00 00 0c 00 00 00 84 12 00 02 0d 00 00 00 74 14 02 02 04 00 00 00 30 01 00 02 05 00 00 00 a0 0a 00 02 06 00 00 00 50 04 00 02 0a 00 00 00 83 03 00 00 0b 00 00 00 10 00 00 00 15 00 00 00 50 d2 01 40 03 00 00 00 5c 27 03 02 02 00 00 00 f0 02 00 00 14 00 00 00 11 00 00 00 17 00 00 00 94 0f 00 02 11 00 00 00 84 0f 00 02 12 00 00 00 10 00 00 00 13 00 00 00 08 00 00 00 fe ff ff 6f 04 0f 00 02 ff ff ff 6f 03 00 00 00 f0 ff ff 6f 38 0e 00 02 00 00 00 00 00 00 00 00 Sending packet: $m4001d254,4#91...Ack Packet received: 70d20140 target_xfer_memory (0x4001d254, xxx, 4, read, xxx) = 4, bytes = 70 d2 01 40 Sending packet: $m4001d270,14#c0...Ack ... now loading shared libs ...