From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26847 invoked by alias); 12 Sep 2002 20:44:50 -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 26838 invoked from network); 12 Sep 2002 20:44:49 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 12 Sep 2002 20:44:49 -0000 Received: from ges.redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 334BA3C44; Thu, 12 Sep 2002 16:44:47 -0400 (EDT) Message-ID: <3D80FCBE.1020706@ges.redhat.com> Date: Thu, 12 Sep 2002 13:44:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020824 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Joel Brobecker Cc: gdb-patches@sources.redhat.com Subject: Re: [RFC/RFA] new gdbarch method: NAME_OF_MALLOC References: <20020912200909.GN932@gnat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-09/txt/msg00215.txt.bz2 > Following the disussion around the fact that the name of the function > used to allocate some memory in the inferior is hard-coded to "malloc" > (http://sources.redhat.com/ml/gdb-patches/2002-09/msg00079.html), > here is a proposed addition to the architecture vector. > > Is it the right thing to do to handle the interix case where the > malloc function should be "_malloc"? Is "NAME_OF_MALLOC" ok, or would > we prefer a different name? [No one appears to have come up with a better name :-)] > Also, I did not find much documentation on each field for the line I > added in gdbarch.sh. So I kind of reversed engineered it by reading > the script code. So if you find anything I missed, this might explain > it... > > 2002-09-12 Joel Brobecker > > * gdbarch.sh (NAME_OF_MALLOC): New variable in the architecture > vector. Will be useful for Interix. > * gdbarch.h, gdbarch.c: Regenerate. > > * valops.c (value_allocate_space_in_inferior): Replace hard-coded > name of the malloc function by NAME_OF_MALLOC. > > Ok to apply? > Index: gdbarch.sh > =================================================================== > RCS file: /cvs/src/src/gdb/gdbarch.sh,v > retrieving revision 1.159 > diff -c -3 -p -r1.159 gdbarch.sh > *** gdbarch.sh 6 Sep 2002 20:17:40 -0000 1.159 > --- gdbarch.sh 12 Sep 2002 19:57:06 -0000 > *************** m::CONSTRUCT_INFERIOR_ARGUMENTS:char *:c > *** 660,665 **** > --- 660,666 ---- > F:2:DWARF2_BUILD_FRAME_INFO:void:dwarf2_build_frame_info:struct objfile *objfile:objfile:::0 > f:2:ELF_MAKE_MSYMBOL_SPECIAL:void:elf_make_msymbol_special:asymbol *sym, struct minimal_symbol *msym:sym, msym:::default_elf_make_msymbol_special::0 > f:2:COFF_MAKE_MSYMBOL_SPECIAL:void:coff_make_msymbol_special:int val, struct minimal_symbol *msym:val, msym:::default_coff_make_msymbol_special::0 > + v::NAME_OF_MALLOC:char *:name_of_malloc::::"malloc":"malloc"::0 Can ``const char *'' be used? I think you'll just need to tweak the function signature for find_function_in_inferior(). If you need to tweak more, yell! :-) doc/gdbint.texinfo will need a separate patch. Andrew