From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13459 invoked by alias); 10 Oct 2011 20:04:10 -0000 Received: (qmail 13450 invoked by uid 22791); 10 Oct 2011 20:04:08 -0000 X-SWARE-Spam-Status: No, hits=-7.2 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; Mon, 10 Oct 2011 20:03:49 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9AK3nER029851 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 10 Oct 2011 16:03:49 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p9AK3mcL024204; Mon, 10 Oct 2011 16:03:48 -0400 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 p9AK3lXR012019; Mon, 10 Oct 2011 16:03:47 -0400 From: Tom Tromey To: GDB Development Subject: some questions about ranged breakpoints Date: Mon, 10 Oct 2011 20:04:00 -0000 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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-10/txt/msg00050.txt.bz2 While implementing the ambiguous linespec proposal, I've tripped across an oddity involving ranged breakpoints. I don't think I have access to a machine that implements these, so I thought I'd ask here. update_breakpoint_locations has: /* Ranged breakpoints have only one start location and one end location. */ gdb_assert (sals_end.nelts == 0 || (sals.nelts == 1 && sals_end.nelts == 1)); But breakpoint_re_set_default has: expanded_end = expand_line_sal_maybe (sals_end.sals[0]); expand_line_sal_maybe can return a symtabs_and_lines that has multiple results. This will crash gdb. I think you could construct a case using a function which is inlined. Then set a breakpoint like "break-range foo.h:7, +5". If breakpoint re-setting discovers multiple locations for the function (e.g., the inferior loads a .so that has inlined it), then it should crash. What should actually happen here? I think the simplest approach would be to make such breakpoints not be resettable. Failing that I suppose they could deactivate if resetting introduces ambiguity. Any other ideas? Any preferences? Also if someone has a use-case for ranged breakpoints I would like to know what it is. I couldn't think of a situation where I'd use them. Tom