From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9147 invoked by alias); 8 Oct 2010 18:44:40 -0000 Received: (qmail 9137 invoked by uid 22791); 8 Oct 2010 18:44:39 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD 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, 08 Oct 2010 18:44:35 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o98IiReU023118 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 8 Oct 2010 14:44:27 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id o98IiQpM010029; Fri, 8 Oct 2010 14:44:26 -0400 Received: from opsy.redhat.com (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 o98IiP0J025569; Fri, 8 Oct 2010 14:44:25 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id C598D3797CC; Fri, 8 Oct 2010 12:44:24 -0600 (MDT) From: Tom Tromey To: pmuldoon@redhat.com Cc: Pedro Alves , gdb-patches@sourceware.org, dan@codesourcery.com Subject: Re: [patch] Add visible flag to breakpoints. References: <201009301741.32379.pedro@codesourcery.com> <201010081435.15174.pedro@codesourcery.com> Date: Fri, 08 Oct 2010 18:44:00 -0000 In-Reply-To: (Phil Muldoon's message of "Fri, 08 Oct 2010 15:04:37 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.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: 2010-10/txt/msg00149.txt.bz2 >>>>> "Phil" == Phil Muldoon writes: Pedro> I would also suggest using a VEC for the breakpoints instead Pedro> of a linked list. Pedro> (Also, the old code appeared to have been designed for O(1) access to Pedro> the python breakpoint objects given a breakpoing number: I have no Pedro> clue it if that matters but you could preserve that easily with two Pedro> VECs or bppy_breakpoints arrays.) Phil> Yeah the old code used vectors, and I converted it to a linked list to Phil> cope with negative breakpoint numbers. I did consider keeping two Phil> vectors. But I wasn't sure if the 0(1) design choice was conscious for Phil> performance or whether it was just done that way. It was, but I am not sure that it matters. Phil> FWIW we only track Phil> user watchpoints and breakpoints (and now the special breakpoint we have Phil> introduced). Even in a potentially heavy situation I would expect the Phil> number of user breakpoints to be < 1000? Is it really necessary? It's a Phil> trade-off of for keeping two reallocated vectors over the lifetime to Phil> maintaining a linked list. I'm ambivalent to how we decide to do it. I Phil> just wanted to explain my rationale. Why don't we just put a reference to the PyObject into struct breakpoint? This solves the problem completely, or at least pushes it up to whatever algorithms are used in breakpoint.c. This can easily be done in a way that does not break the Python-less case (see varobj.c for an example). Tom