From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19552 invoked by alias); 18 Nov 2011 19:31:49 -0000 Received: (qmail 19542 invoked by uid 22791); 18 Nov 2011 19:31:48 -0000 X-SWARE-Spam-Status: No, hits=-7.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 18 Nov 2011 19:31:13 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pAIJVA8s013751 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 18 Nov 2011 14:31:10 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id pAIJV9t1020253; Fri, 18 Nov 2011 14:31:10 -0500 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id pAIJV8HY013169; Fri, 18 Nov 2011 14:31:08 -0500 From: Tom Tromey To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [RFC] canonical linespec and multiple breakpoints ... References: <20110505162855.GA2546@adacore.com> <201108021633.04777.pedro@codesourcery.com> <201108021900.13298.pedro@codesourcery.com> Date: Fri, 18 Nov 2011 19:31:00 -0000 In-Reply-To: <201108021900.13298.pedro@codesourcery.com> (Pedro Alves's message of "Tue, 2 Aug 2011 19:00:13 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-11/txt/msg00508.txt.bz2 >>>>> "Pedro" == Pedro Alves writes: Finally replying to this old note. The context for this note is this patch, which has not been checked in: http://sourceware.org/ml/gdb-patches/2011-03/msg00606.html Pedro> I never replied to your patch, but my reaction was that it is Pedro> probably breaking breakpoints in the new inferiors today, even Pedro> without any linespec/multi breakpoints work. Tom> Is there a way to set a breakpoint in a new inferior without first Tom> loading the debuginfo by hand? It has been a while since I was looking Tom> at this, but I don't remember finding a way. Tom> If there is one, though, I can easily test this. Pedro> If you set a breakpoint before the fork, the Pedro> breakpoint will end up with locations in the new inferior Pedro> after the fork. Same if e.g., you set a breakpoint before Pedro> a fork/exec, and post-exec image happens to have Pedro> been compiled from the same code (file:lineno) as the Pedro> original breakpoint's location was resolved to. I was Pedro> under the impression your patch would make it so Pedro> the new inferior would no longer stop for these breakpoints. I finally tried this today by making a simple program that forks, applying the patch to git master, enabling multi-inferior, and debugging. It works fine: (gdb) c Continuing. hi bob from 16888 [New process 16889] Breakpoint 2, doit () at ft.c:6 6 printf ("hi bob from %d\n", (int) getpid()); I think this is what I would expect, anyway. The patch in question changes gdb to lazily read debuginfo for inferiors that arise from forks. But, in this scenario, breakpoint re-setting causes gdb to need the debuginfo, so it is read at that point -- on demand. I plan to check in this patch after 7.4 branches. Tom