From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32143 invoked by alias); 24 Apr 2009 01:01:05 -0000 Received: (qmail 31974 invoked by uid 22791); 24 Apr 2009 01:01:02 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 24 Apr 2009 01:00:55 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n3O10rAY007489 for ; Thu, 23 Apr 2009 21:00:53 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n3O10q9W031787; Thu, 23 Apr 2009 21:00:53 -0400 Received: from opsy.redhat.com (vpn-14-41.rdu.redhat.com [10.11.14.41]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n3O10qOc009872; Thu, 23 Apr 2009 21:00:52 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id A043EC881B1; Thu, 23 Apr 2009 19:00:51 -0600 (MDT) To: Jan Kratochvil Cc: gdb-patches@sourceware.org Subject: Re: [patch] Fix internal error on breaking at a multi-locations caller References: <20090309220736.GA27259@host0.dyn.jankratochvil.net> From: Tom Tromey Reply-To: tromey@redhat.com Date: Fri, 24 Apr 2009 01:01:00 -0000 In-Reply-To: <20090309220736.GA27259@host0.dyn.jankratochvil.net> (Jan Kratochvil's message of "Mon\, 9 Mar 2009 23\:07\:36 +0100") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2009-04/txt/msg00682.txt.bz2 >>>>> "Jan" == Jan Kratochvil writes: Jan> patch deals with break after `up' into the caller where the caller line has Jan> multiple locations (instances). Discussion is contained in the code. Jan> Original bugreport at: https://bugzilla.redhat.com/show_bug.cgi?id=488572 Thanks. Jan> + /* Find all the other PCs for a line of code with multiple instances Jan> + (locations). If the instruction is in the middle of an instruction Jan> + block for source line GDB cannot safely find the same instruction in Jan> + the other compiled instances of the same source line because the other Jan> + instances may have been compiled completely differently. [...] Jan> + The current implementation will place the breakpoint at the expected Jan> + returning address of the current instance of the caller. But the Jan> + other instances will get the breakpoint at the first instruction of Jan> + the source line - therefore before the call would be made. Another Jan> + possibility would be to place the breakpoint in the other instances at Jan> + the start of the next source line. Based on the documentation of `break', and also my mental model of debugging with gdb, I think that the best behavior here would be to simply set a single breakpoint here -- the one corresponding to the instance that is currently being executed. Then we don't have to worry about the other instances, and we won't set odd breakpoints elsewhere. What do you (or anybody) think of that? Tom