From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fernando Nasser To: Michael Elizabeth Chastain Cc: fnasser@redhat.com, ac131313@cygnus.com, gdb-patches@sources.redhat.com, keiths@cygnus.com Subject: Re: [RFA] Assuming malloc exists in callfwmall.exp Date: Thu, 15 Feb 2001 11:53:00 -0000 Message-id: <3A8C33A8.73C8964B@cygnus.com> References: <200102151700.JAA26371@bosch.cygnus.com> X-SW-Source: 2001-02/msg00260.html Michael Elizabeth Chastain wrote: > > > I don't get it. malloc is not used at all when the argument is not a > > string. So, what malloc() being available or not has to do with this > > situation? > > The point is that use case #3 should keep working, even if > someone changes gdb. > Aren't we trying to be a little bit too pro-active here? We are missing tests for things that are already in the code. Adding tests for things that may or may not be in the code is somewhat new. > Suppose I check in a patch tomorrow to allocate the call dummy in malloc'd > memory instead of the target's stack. > Then the good maintainer in charge of that code will suggest that you should also submit a test case for that. And if he/she is a really good maintainer he/she will reject your patch as it would be adding a restriction to inferior function calls that we do not currently have. In any case, having *one* useless test is still better than a test file full of them. If you are willing to get it in the shape suggested by Kevin and I you can add the #3 if you want. But please add the following comment (or similar): # Gdb does not currently use malloc() for inferior calls with integer arguments # If it ever does, it will be tested in here. Just to check if we are in the same page: there would be 3 tests in there: .You test for malloc presence .A test with the string argument .The integer argument one The last two, as you suggested, pass on both error message and success call. -- Fernando Nasser Red Hat - Toronto E-Mail: fnasser@redhat.com 2323 Yonge Street, Suite #300 Toronto, Ontario M4P 2C9