This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] Assuming malloc exists in callfwmall.exp
- To: Michael Elizabeth Chastain <chastain at cygnus dot com>
- Subject: Re: [RFA] Assuming malloc exists in callfwmall.exp
- From: Fernando Nasser <fnasser at cygnus dot com>
- Date: Thu, 15 Feb 2001 14:53:12 -0500
- CC: fnasser at redhat dot com, ac131313 at cygnus dot com, gdb-patches at sources dot redhat dot com, keiths at cygnus dot com
- Organization: Red Hat , Inc. - Toronto
- References: <200102151700.JAA26371@bosch.cygnus.com>
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