From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21025 invoked by alias); 3 May 2011 09:31:07 -0000 Received: (qmail 21016 invoked by uid 22791); 3 May 2011 09:31:06 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-vw0-f41.google.com (HELO mail-vw0-f41.google.com) (209.85.212.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 03 May 2011 09:30:48 +0000 Received: by vws4 with SMTP id 4so6254193vws.0 for ; Tue, 03 May 2011 02:30:48 -0700 (PDT) Received: by 10.220.187.4 with SMTP id cu4mr2658345vcb.58.1304415048118; Tue, 03 May 2011 02:30:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.61.6 with HTTP; Tue, 3 May 2011 02:30:28 -0700 (PDT) From: Kevin Pouget Date: Tue, 03 May 2011 09:31:00 -0000 Message-ID: Subject: Breakpoint duplication over new inferiors To: gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-05/txt/msg00014.txt.bz2 Hello, I'd like to understand how breakpoints are supposed to be duplicated when a new inferior is started/attached (in my cases)/forked. Namely, with a code like: > > 1=A0=A0=A0 int main() { > 2=A0=A0=A0 =A0=A0=A0 if (fork()) { > 3=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 send (0,0,0); > 4=A0=A0=A0 =A0=A0=A0 } else { > 5=A0=A0=A0 =A0=A0=A0 =A0=A0=A0 recv(0,0,0) ; > 6=A0=A0=A0 =A0=A0=A0 } > 7=A0=A0=A0 } and > > (gdb) b main > Breakpoint 1 at 0x400558: file fork.c, line 2. > (gdb) b send > Breakpoint 2 at 0x400448 > (gdb) set detach-on-fork off > (gdb) run > ... > (gdb) info breakpoint > Num=A0=A0=A0=A0 Type=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Disp Enb Address=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0 What > 1=A0=A0=A0=A0=A0=A0 breakpoint=A0=A0=A0=A0 keep y=A0=A0 > =A0=A0=A0 breakpoint already hit 1 time > 1.1=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0 y=A0=A0=A0=A0 0x0000000000400558 in main at fork.c:2 inf 2 > 1.2=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0 y=A0=A0=A0=A0 0x0000000000400558 in main at fork.c:2 inf 1 > 2=A0=A0=A0=A0=A0=A0 breakpoint=A0=A0=A0=A0 keep y=A0=A0 0x0000003cbd0e1a6= 0 inf 1 it seems that `libc' breakpoints are not correctly duplicated. According to my investigation, the difference occurs in > breakpoint.c:addr_string_to_sals -- sals =3D decode_line_1 (&s, 1, (struc= t symtab *) NULL, 0, NULL); which doesn't return two locations, but only one ... is it a bug? any idea what to do to solve it? cordially, Kevin