From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5150 invoked by alias); 13 Oct 2010 13:06:45 -0000 Received: (qmail 5141 invoked by uid 22791); 13 Oct 2010 13:06:45 -0000 X-SWARE-Spam-Status: No, hits=-5.7 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; Wed, 13 Oct 2010 13:06:40 +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.13.8/8.13.8) with ESMTP id o9DD6WoE017063 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 13 Oct 2010 09:06:32 -0400 Received: from localhost.localdomain.redhat.com (ovpn-113-107.phx2.redhat.com [10.3.113.107]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o9DD6Sqq022461; Wed, 13 Oct 2010 09:06:30 -0400 From: Phil Muldoon To: Tom Tromey 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> Reply-to: pmuldoon@redhat.com X-URL: http://www.redhat.com Date: Wed, 13 Oct 2010 13:06:00 -0000 In-Reply-To: (Phil Muldoon's message of "Wed, 13 Oct 2010 13:45:00 +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 X-IsSubscribed: yes 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/msg00215.txt.bz2 Phil Muldoon writes: > Tom Tromey writes: > >>>>>>> "Phil" == Phil Muldoon writes: >> >> Phil> In this patch iteration I removed any form of storage/tracking of >> Phil> breakpoints. Instead, as above, I placed a reference in the breakpoint >> Phil> struct. >> >> I like this better. >> >> Phil> + if (internal && PyObject_IsTrue (internal)) >> Phil> + internal_bp = 1; >> >> PyObject_IsTrue can return -1 on failure, so this code must account for >> that. > > Oops done. Thanks. > >> Phil> + int i = 0; >> Phil> + ALL_BREAKPOINTS (b) >> >> This instance of ALL_BREAKPOINTS should probably be replaced with some >> kind of callback API, like the other iterate_over_* functions in gdb. > > I wrote an iterate function for this, much like the inferior iterator. > I noticed in py-inferior.c we do not account for an error when adding to a > list. (I'm pretty sure I wrote that too :( I'll fix this later. > >> Phil> + { >> Phil> + /* Not all breakpoints will have a companion Python object. >> Phil> + Only breakpoints that were created via bppy_new, or >> Phil> + breakpoints that were created externally and are tracked by >> Phil> + the Python Scripting API. */ >> Phil> + if (b->py_bp_object) >> Phil> + { >> Phil> + if (PyTuple_SetItem (result, i, (PyObject *) b->py_bp_object) != 0) >> >> I think that cast to PyObject is unnecessary. > > As we use an iterator, we now set a list then convert it to an iterator > later. ^^^^^^^^ I mean tuple here. Sorry for the confusion! Cheers, Phil