From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12415 invoked by alias); 16 Oct 2010 18:42:53 -0000 Received: (qmail 12406 invoked by uid 22791); 16 Oct 2010 18:42:52 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 16 Oct 2010 18:42:46 +0000 Received: (qmail 17379 invoked from network); 16 Oct 2010 18:42:43 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 16 Oct 2010 18:42:43 -0000 From: Pedro Alves To: pmuldoon@redhat.com Subject: Re: [patch] Add visible flag to breakpoints. Date: Sat, 16 Oct 2010 18:42:00 -0000 User-Agent: KMail/1.13.2 (Linux/2.6.33-29-realtime; KDE/4.4.2; x86_64; ; ) Cc: Tom Tromey , gdb-patches@sourceware.org, dan@codesourcery.com References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201010161942.41171.pedro@codesourcery.com> 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/msg00263.txt.bz2 The non-python bits are fine, pending a couple of small issues I neglected mentioning before. Sorry about that. > + > +/* Set a breakpoint. This function is shared between CLI and MI > + functions for setting a breakpoint. It wraps create_new_breakpoint > + and never asks for an internal breakpoint number to be allocated > + against the breakpoint. Returns true if any breakpoint was > + created; false otherwise. */ > + > +int > +create_breakpoint (struct gdbarch *gdbarch, > + char *arg, char *cond_string, int thread, > + int parse_condition_and_thread, > + int tempflag, enum bptype type_wanted, > + int ignore_count, > + enum auto_boolean pending_break_support, > + struct breakpoint_ops *ops, > + int from_tty, > + int enabled) > +{ > + return create_new_breakpoint (gdbarch, arg, cond_string, thread, > + parse_condition_and_thread, tempflag, > + type_wanted, ignore_count, > + pending_break_support, > + ops, from_tty, enabled, 0); > +} Having both create_breakpoint and create_new_breakpoint exported in breakpoint.h is quite reduntant API-wise, and by just looking at the .h even confusing, given that "_new_" does not describe anything that create_breakpoint does not do as well (create_breakpoint creates a breakpoint, so of course it also creates a _new_ breakpoint!). Please just add the new flag to create_breakpoint, and do the trivial update to all its callers. There are only 3 outside breakpoint.c, I think. > - set_breakpoint_count (breakpoint_count + 1); > - b->number = breakpoint_count; > + if (internal) > + b->number = internal_breakpoint_number--; > + else > + { > + set_breakpoint_count (breakpoint_count + 1); > + b->number = breakpoint_count; > + } It would be nice if this pattern that now appears several times in breakpoint.c would be abstrated out into a small helper function. -- Pedro Alves