Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* New target method returning the name of the malloc function?
@ 2002-09-05 17:23 Joel Brobecker
  2002-09-06  0:22 ` Pierre Muller
  2002-09-06 11:04 ` Michael Snyder
  0 siblings, 2 replies; 9+ messages in thread
From: Joel Brobecker @ 2002-09-05 17:23 UTC (permalink / raw)
  To: gdb-patches

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2002-09-10  4:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-05 17:23 New target method returning the name of the malloc function? Joel Brobecker
2002-09-06  0:22 ` Pierre Muller
2002-09-06  6:03   ` Daniel Jacobowitz
2002-09-06  9:14   ` Kevin Buettner
2002-09-09  9:48     ` Joel Brobecker
2002-09-09 13:10     ` Andrew Cagney
2002-09-09 15:44       ` muller
2002-09-09 21:06         ` Andrew Cagney
2002-09-06 11:04 ` Michael Snyder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox