From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18201 invoked by alias); 6 Sep 2002 18:04:45 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 18194 invoked from network); 6 Sep 2002 18:04:44 -0000 Received: from unknown (HELO cygnus.com) (205.180.83.203) by sources.redhat.com with SMTP; 6 Sep 2002 18:04:44 -0000 Received: from redhat.com (reddwarf.sfbay.redhat.com [172.16.24.50]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id KAA15222; Fri, 6 Sep 2002 10:55:09 -0700 (PDT) Message-ID: <3D78EE3B.18907230@redhat.com> Date: Fri, 06 Sep 2002 11:04:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. X-Accept-Language: en MIME-Version: 1.0 To: Joel Brobecker CC: gdb-patches@sources.redhat.com Subject: Re: New target method returning the name of the malloc function? References: <20020906002319.GW1169@gnat.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-09/txt/msg00091.txt.bz2 Joel Brobecker wrote: > > Hello, > > The name of the function used to allocate some memory in the inferior is > currently hard-coded to "malloc" in valops.c: > > struct value * > value_allocate_space_in_inferior (int len) > { > struct value *blocklen; > struct value *val = find_function_in_inferior ("malloc"); > ^^^^^^ > > Unfortunately, on interix, the malloc function is not always there. > Quoting Donn Terry: > << > malloc() won't necessarily be present; the way our namespace pollution > prevention stuff works, if the user application doesn't call an entry > point at all, it just won't be there. However, _malloc is always > present (at least in any real program) because it's called from within > the library. > >> > > May I suggest a new architecture method called for instance > NAME_OF_MALLOC or MALLOC_FUNCTION_NAME? The default would be to return > "malloc", but we could then change it to "_malloc" for the interix > target. Joel, This is a known limitation. Certain things in GDB simply will not work if the target program doesn't contain malloc. It's been like that for 10 years.