From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28941 invoked by alias); 1 Aug 2008 13:59:46 -0000 Received: (qmail 28932 invoked by uid 22791); 1 Aug 2008 13:59:45 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 01 Aug 2008 13:59:23 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id A19DE98397; Fri, 1 Aug 2008 13:59:21 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 4D54798243; Fri, 1 Aug 2008 13:59:21 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1KOvA8-0004dD-HB; Fri, 01 Aug 2008 09:59:20 -0400 Date: Fri, 01 Aug 2008 13:59:00 -0000 From: Daniel Jacobowitz To: Eli Zaretskii Cc: gdb@sourceware.org Subject: Re: GDB to C++ issue: deletion Message-ID: <20080801135920.GA17022@caradoc.them.org> Mail-Followup-To: Eli Zaretskii , gdb@sourceware.org References: <200807312204.m6VM4JQM007611@tully.CS.Berkeley.EDU> <200808011054.24219.apoenitz@trolltech.com> <20080801125124.GA13594@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2008-05-11) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-08/txt/msg00008.txt.bz2 On Fri, Aug 01, 2008 at 04:34:33PM +0300, Eli Zaretskii wrote: > > Date: Fri, 1 Aug 2008 08:51:24 -0400 > > From: Daniel Jacobowitz > > Cc: gdb-patches@sourceware.org > > > > For what it's worth, that's not my experience at all. Contributors > > have a lot of trouble with the GDB code. One of the biggest problems > > is cleanups > > What are the problems with cleanups? Do you mean the code that uses > them or their implementation? I mean the code that uses them; people working in other areas of GDB rarely have to worry about their implementation. Some areas I've seen problems with: It's not clear locally (i.e. looking at any bit of code that uses cleanups) when or how the cleanups are executed. They're usually triggered by an exception from some called function, and the code that invokes the cleanups is far away. In C, people do not expect exceptions and so they're confused by the introduction of exception handling. Similarly, it's rarely clear when a cleanup is necessary and when it isn't. We don't have any strong conventions on what functions can throw. So I often have to explain to people how to write cleanups and why they need to. Sometimes we run cleanups and sometimes we discard them. This is confusing. It's not something that would be necessarily affected by a change in language but use of an OO language might make it easier to represent. I believe discard_cleanups is usually used to implement move semantics - a change in ownership from local to global without copying. -- Daniel Jacobowitz CodeSourcery