From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20140 invoked by alias); 30 Jun 2007 11:57:09 -0000 Received: (qmail 20132 invoked by uid 22791); 30 Jun 2007 11:57:09 -0000 X-Spam-Check-By: sourceware.org Received: from romy.inter.net.il (HELO romy.inter.net.il) (213.8.233.24) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 30 Jun 2007 11:57:07 +0000 Received: from HOME-C4E4A596F7 (IGLD-80-230-73-173.inter.net.il [80.230.73.173]) by romy.inter.net.il (MOS 3.7.3-GA) with ESMTP id IFE63703 (AUTH halo1); Sat, 30 Jun 2007 14:56:56 +0300 (IDT) Date: Sat, 30 Jun 2007 14:17:00 -0000 Message-Id: From: Eli Zaretskii To: "Michael Snyder" CC: drow@false.org, Michael.Snyder@access-company.com, gdb-patches@sourceware.org In-reply-to: <003201c7ba8c$d6e0e840$677ba8c0@sonic.net> (msnyder@sonic.net) Subject: Re: [OB] Add cleanup, source.c Reply-to: Eli Zaretskii References: <9270.12.7.175.2.1183069663.squirrel@webmail.sonic.net> <20070628224815.GC12578@caradoc.them.org> <655C3D4066B7954481633935A40BB36F041427@ussunex02.svl.access-company.com> <20070628231153.GA14231@caradoc.them.org> <11470.12.7.175.2.1183080998.squirrel@webmail.sonic.net> <20070629113407.GA13561@caradoc.them.org> <003201c7ba8c$d6e0e840$677ba8c0@sonic.net> 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: 2007-06/txt/msg00537.txt.bz2 > From: "Michael Snyder" > Cc: "Michael Snyder" , > Date: Fri, 29 Jun 2007 13:34:05 -0700 > > > We're both right. Cleanups do get discarded, and cleanups that aren't > > discarded are called at the top level. Every cleanup I've written > > since I started working on GDB at 2001 has been freed locally rather > > than at the top level, though. I think it's very confusing if the > > cleanups are not locally paired. > > > > From gdbint.texinfo: > > > > Your function should explicitly do or discard the cleanups it > > creates. Failing to do this leads to non-deterministic behavior since > > the caller will arbitrarily do or discard your functions cleanups. > > This need leads to two common cleanup styles. > > Yeah, that text was written by Andrew in 2003. Before that we > had some text written by Eli in about 2001, also saying that you > should call do_cleanups. > > > Don't mean to be a curmudgeon, but I go back way before that. ;-) > > Here's how version 1.1 of the document read: Sorry, I'm confused: where exactly is the current gdbint.texinfo text wrong? Are you saying that the non-deterministic behavior mentioned in the manual is a red herring? But the explanation it provides (the fact that some other function further on could discard_cleanups) seems to provide valid basis for that, doesn't it?