Re: [RFA] Assuming malloc exists in callfwmall.exp

Fernando Nasser
2001-02-14T13:20:00Z

Michael Snyder wrote:
>
> Fernando Nasser wrote:
> >
> > Sounds reasonable. Check it in (assuming you have already added yourself to the write after approval list).
>
> Hold on -- aren't you defeating the purpose of this test?
> The test was added by HP precisely because these calls
> fail when malloc isn't included in the target program.
> The test is a duplicate of callfuncs.exp, except that it
> doesn't link malloc.
>

This is true.

# SAME tests as in callfuncs.exp but here the inferior program does not
# call malloc.

But the idea was:

/* Support program for testing gdb's ability to call functions
in an inferior which doesn't itself call malloc, pass appropriate
arguments to those functions, and get the returned result. */

It is the ability of GDB calling a function that does not itself call malloc() that is being tested. Why this is important? I don't know.

Keith detected that GDB needs malloc() itself to call functions in the inferior. This may not be true for all targets I guess.

But how is it possible that GDB needs malloc() when the target does not have it?

Something is really fishy here.

--
Fernando Nasser
Red Hat - Toronto E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9