From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14154 invoked by alias); 1 Feb 2008 06:54:21 -0000 Received: (qmail 14144 invoked by uid 22791); 1 Feb 2008 06:54:21 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 01 Feb 2008 06:53:58 +0000 Received: (qmail 18349 invoked from network); 1 Feb 2008 06:53:56 -0000 Received: from unknown (HELO localhost) (vladimir@127.0.0.2) by mail.codesourcery.com with ESMTPA; 1 Feb 2008 06:53:56 -0000 From: Vladimir Prus To: gdb-patches@sources.redhat.com Subject: Re: [RFA] Make mi_cmd_break_insert exception-safe. Date: Fri, 01 Feb 2008 06:54:00 -0000 User-Agent: KMail/1.9.6 (enterprise 0.20070907.709405) References: <200801271715.08542.vladimir@codesourcery.com> <20080131221653.GB6715@caradoc.them.org> In-Reply-To: <20080131221653.GB6715@caradoc.them.org> Cc: Daniel Jacobowitz MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200802010953.47178.vladimir@codesourcery.com> 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: 2008-02/txt/msg00003.txt.bz2 On Friday 01 February 2008 01:16:53 Daniel Jacobowitz wrote: > On Sun, Jan 27, 2008 at 05:15:07PM +0300, Vladimir Prus wrote: > > The gdb_breakpoint function, as I understand it, was supposed to be part of > > libgdb interface, defined in gdb.h header. However, libgdb is not even close to > > being usable, and when I've asked about using gdb as a library some time ago, the > > response was that it's too hard to do, and it's no longer a goal. Therefore, > > I think it makes no sense to keep gdb_breakpoint non-throwing. > > There is a convention that the gdb_* functions don't throw, though. > It's very confusing what does and does not throw in GDB. Before this > patch, did gdb_breakpoint actually throw? If so, would fixing it > by using try/catch inside gdb_breakpoint fix this bug too? Putting try/catch inside gdb_breakpoint can possibly fix this bug. However, right now gdb_breakpoint is used in a single place -- in mi_cmd_break_insert. If gdb_breakpoint throws, mi_cmd_break_insert is capable of reporting this error property -- because top-level MI code will handle the exception already. So, why bother trying to make gdb_breakpoint non-throwing? I believe any such change will be at least as complex as making mi_cmd_break_insert exception-safe? If your concern is about gdb_ prefix, how about renaming gdb_exception into 'set_breakpoint'? - Volodya