From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21191 invoked by alias); 29 May 2003 16:42:04 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 21181 invoked from network); 29 May 2003 16:42:03 -0000 Received: from unknown (HELO localhost.redhat.com) (207.219.125.131) by sources.redhat.com with SMTP; 29 May 2003 16:42:03 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id BF3702B2F; Thu, 29 May 2003 12:41:57 -0400 (EDT) Message-ID: <3ED63855.1080706@redhat.com> Date: Thu, 29 May 2003 16:42:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030223 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Jacobowitz Cc: "John S. Yates, Jr." , gdb Subject: Re: malloc in inferior References: <0eb201c325e9$5fb63450$1400a8c0@astral> <20030529152702.GA10363@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-05/txt/msg00393.txt.bz2 > For some stubs these would be useful; for the stubs I deal with, which > sit in user space on normal OS's, rather less so. The stub would end > up calling malloc anyway. > > Personally, I'm of the opinion that we should solve this problem by > changing the definitions: mark strings as ephemeral and let the user > call malloc or strdup directly if they want something to last. That wouldn't work. A user needs to be able to cut/paste arbitrary C source code into the GDB console and have it just work. Given that most users don't even realize that the malloc is being called, I think it is working well. > Or make > it a set option. I'm not sure how popular that idea would be; anyone > else have a comment? A set option, or (discussed previously) allocated lazy fashion. Andrew