From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6239 invoked by alias); 30 Sep 2010 16:20:23 -0000 Received: (qmail 6163 invoked by uid 22791); 30 Sep 2010 16:20:19 -0000 X-SWARE-Spam-Status: No, hits=-5.6 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; Thu, 30 Sep 2010 16:20:12 +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 o8UGIItw029907 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 30 Sep 2010 12:18:18 -0400 Received: from localhost.localdomain.redhat.com (ovpn-113-74.phx2.redhat.com [10.3.113.74]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o8UGIFSv023574; Thu, 30 Sep 2010 12:18:17 -0400 From: Phil Muldoon To: gdb-patches@sourceware.org Cc: dan@codesourcery.com Subject: Re: [patch] Add visible flag to breakpoints. References: <20100930144132.GA15652@caradoc.them.org> Reply-to: pmuldoon@redhat.com X-URL: http://www.redhat.com Date: Thu, 30 Sep 2010 17:51:00 -0000 In-Reply-To: <20100930144132.GA15652@caradoc.them.org> (Daniel Jacobowitz's message of "Thu, 30 Sep 2010 10:41:37 -0400") 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-09/txt/msg00514.txt.bz2 Daniel Jacobowitz writes: > On Thu, Sep 30, 2010 at 03:02:14PM +0100, Phil Muldoon wrote: >> This is part of a larger effort to improve the Python breakpoint support >> within GDB. One of the use-cases we have in Python is for a command to >> set (maybe a large) number of breakpoints to catch predefined >> behavior. However we do not want this to impact the usability or >> readability of the existing 'info breakpoints' output. This patch fixes >> that by allowing breakpoints to become invisible to the user. > > How does this interact with GDB-internal breakpoints (those with > negative numbers)? If you didn't need to switch visibility at > runtime, you could just create these as internal. The original patch I wrote did use negative numbers for bp_breakpoint type (in fact that patch is a commit in the archer branch: archer-pmuldoon-python-breakpoints). But normal bp_breakpoints with a negative number are still displayed with 'info breakpoints'. Currently the visibility of breakpoints is not decided on their number but their type. breakpoint_1 tests for these in user_settable_breakpoint. All I did in that aspect was to add an additional check for breakpoint_visible. I decided that if displaying the breakpoint was just an arbitrary check that I would introduce a visible flag and avoid all the re-plumbing of numbers/negative numbers in create_breakpoint. The plumbing would have been necessary because ... I also did look at create_internal_breakpoint, but those work on a single address. We would either have the user translate the breakpoint to an address with calls to decode_line or do it ourselves. I felt that a flag would be better here than to duplicate this effort. Also there are several cases/detections in generic bp_breakpoints that might be useful for users of Python breakpoints. And finally to substantially change the breakpoint mechanics underneath the call for a Python breakpoint purely because one was created visible and the other not seemed counter-intuitive. Cheers Phil