This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


Michael Elizabeth Chastain wrote:
> 
> So, suppose that next month someone changes call_function_by_hand so
> that it always calls value_allocate_space_in_inferior.  callfuncs.exp
> will not complain at all, but callfwmall.exp will raise a bunch of
> FAILs.
> 

Only if GDB does not find a malloc() in there.  

If malloc() is available, it doesn't matter if if was linked in because
of the program or not.  In any case, callfuncs.exp already test that
case.

The other case to be tested is when there isn't a malloc() available at
all (that is why the test Keith and you proposed is so nice).  But the
FAILs are wrong.  Not having malloc() available is not GDB's fault and
it may be just a limitation of the target environment.

In this second case what we have to test (only when malloc is not
available) is the GDB's reaction to this situation, i.e., the issue of
an appropriate error message.  It should not crash, silently return
without telling the user, etc.

> That's what the test is for.  It tests that gdb can do "call foo(10)"
> in a program that does not use malloc.  callfuncs.exp cannot test that.
> 

If someone has changed it to use malloc() as you said, it should fail. 
Again, we are looking for an error message here.

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]