From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17453 invoked by alias); 25 Mar 2008 02:14:11 -0000 Received: (qmail 17441 invoked by uid 22791); 25 Mar 2008 02:14:11 -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; Tue, 25 Mar 2008 02:13:51 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 1B57B983C8; Tue, 25 Mar 2008 02:13:50 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id D782C9810C; Tue, 25 Mar 2008 02:13:49 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1Jdyfc-0008FQ-Vn; Mon, 24 Mar 2008 22:13:48 -0400 Date: Tue, 25 Mar 2008 11:34:00 -0000 From: Daniel Jacobowitz To: Nick Roberts Cc: Vladimir Prus , gdb@sources.redhat.com Subject: Re: Thread bound variable objects Message-ID: <20080325021348.GA31688@caradoc.them.org> Mail-Followup-To: Nick Roberts , Vladimir Prus , gdb@sources.redhat.com References: <200803190016.02072.vladimir@codesourcery.com> <200803231225.31593.vladimir@codesourcery.com> <18407.10216.545852.450467@kahikatea.snap.net.nz> <200803240843.54604.vladimir@codesourcery.com> <18408.20077.725694.159007@kahikatea.snap.net.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <18408.20077.725694.159007@kahikatea.snap.net.nz> User-Agent: Mutt/1.5.17 (2007-12-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-03/txt/msg00214.txt.bz2 On Tue, Mar 25, 2008 at 12:59:25PM +1200, Nick Roberts wrote: > OK, I hadn't realised that. I was looking at other files, e.g., dwarf2read.c > which uses this technique. That appears to just be with xfree so maybe only > results in a memory leak. > > I guess > > struct cleanups *old_cleanups = 0x1; > ... > if (old_cleanups != 0x1) > do_cleanups (old_cleanups); > > would work but, as you say, it's probably best to use null_cleanup. Right, that's what it's for. There are a lot of places in GDB that use the NULL check, but they're bugs waiting to happen. -- Daniel Jacobowitz CodeSourcery