From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cagney To: Michael Elizabeth Chastain Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] Assuming malloc exists in callfwmall.exp Date: Wed, 14 Feb 2001 18:17:00 -0000 Message-id: <3A8B3AFD.2D8C5A27@cygnus.com> References: <200102150029.QAA30159@bosch.cygnus.com> X-SW-Source: 2001-02/msg00237.html Michael Elizabeth Chastain wrote: > > Another hour, another change of mind. > > The point of callfwmall.exp is to show that gdb can call functions in > the inferior even if the inferior does not have "malloc". callfuncs.exp > will never be able to do that. > > So I think the right thing to do in callfwmall.exp is: > > (1) Test for the presence of malloc the way Keith Seitz is doing > (but put the test after runto_main). > > (2) If malloc is present, disable the test script. > > (3) If malloc is absent, go ahead and run the whole test script. I don't think this logic is right. Consider: This GDB was configured as "i386-unknown-netbsdelf1.5.1."... (gdb) p malloc No symbol "malloc" in current context. (gdb) p main $1 = {int ()} 0x8048954
(gdb) b main Breakpoint 1 at 0x8048959: file /home/scratch/GDB/src/gdb/testsuite/gdb.base/callfwmall.c, line 177. (gdb) run Starting program: /home/scratch/GDB/native/gdb/testsuite/gdb.base/callfwmall Breakpoint 1, main () at /home/scratch/GDB/src/gdb/testsuite/gdb.base/callfwmall.c:177 177 t_structs_c(struct_val1); (gdb) p malloc $2 = {} 0x4804d020 (gdb) it is testing exactly what it should be testing but the above would disable malloc for this target. Andrew