Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@ges.redhat.com>
To: Joel Brobecker <brobecker@gnat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFC/RFA] new gdbarch method: NAME_OF_MALLOC
Date: Thu, 12 Sep 2002 13:44:00 -0000	[thread overview]
Message-ID: <3D80FCBE.1020706@ges.redhat.com> (raw)
In-Reply-To: <20020912200909.GN932@gnat.com>

> 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  <brobecker@gnat.com>
> 
>         * 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



  reply	other threads:[~2002-09-12 20:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-12 13:09 Joel Brobecker
2002-09-12 13:44 ` Andrew Cagney [this message]
2002-09-12 17:02   ` Joel Brobecker
2002-09-12 17:15     ` Andrew Cagney
2002-09-12 17:39       ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3D80FCBE.1020706@ges.redhat.com \
    --to=ac131313@ges.redhat.com \
    --cc=brobecker@gnat.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox