From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3413 invoked by alias); 25 Oct 2008 15:54:50 -0000 Received: (qmail 3405 invoked by uid 22791); 25 Oct 2008 15:54:49 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 25 Oct 2008 15:54:02 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 662C62A9674; Sat, 25 Oct 2008 11:54:00 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id XeEobQkJWxe4; Sat, 25 Oct 2008 11:54:00 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 1B28A2A964C; Sat, 25 Oct 2008 11:54:00 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 30D2CE7ACD; Sat, 25 Oct 2008 08:53:58 -0700 (PDT) Date: Sat, 25 Oct 2008 15:54:00 -0000 From: Joel Brobecker To: Pedro Alves Cc: Daniel Jacobowitz , gdb-patches@sourceware.org Subject: Re: A couple of uses of xmalloc and xfree in a couple of .y files Message-ID: <20081025155358.GG29998@adacore.com> References: <200810242358.11089.pedro@codesourcery.com> <20081025001350.GC29998@adacore.com> <20081025015805.GA1484@caradoc.them.org> <200810250336.30073.pedro@codesourcery.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200810250336.30073.pedro@codesourcery.com> User-Agent: Mutt/1.4.2.2i 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-10/txt/msg00639.txt.bz2 > 2008-10-25 Pedro Alves > > * Makefile.in (.y.c, .l.c): sed free to xfree. I think it would be useful. The nice thing about using xmalloc/xfree etc is that it could be turned into a poor man's memory tracking device. I worked on a double-deallocation problem on Windows once, and all the tools I tried out there simply were not able to handle the size of my project. With xfree/xmalloc etc, I could augment their implementation to log every memory allocation/deallocation from GDB. It won't be perfect, but it might help narrow down where to look. -- Joel