From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fernando Nasser To: Michael Snyder Cc: Keith Seitz , gdb-patches@sources.redhat.com Subject: Re: [RFA] Assuming malloc exists in callfwmall.exp Date: Wed, 14 Feb 2001 13:20:00 -0000 Message-id: <3A8AF68A.9B2CF558@cygnus.com> References: <3A8ABA01.C25B0FD2@cygnus.com> <3A8AEFEA.A2E2A61E@cygnus.com> X-SW-Source: 2001-02/msg00222.html 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