- To: Jim Blandy <jimb at cygnus dot com>
- Subject: Re: How is gdb/testsuite/gdb.base/callfwmall.exp supposed to work?
- From: Jimmy Guo <guo at cup dot hp dot com>
- Date: Tue, 25 Apr 2000 11:31:27 -0700 (PDT)
- Cc: gdb at sourceware dot cygnus dot com
Here is the test creation comment from an HP engineer back in 3/97:
This is essentially a carbon-copy of the callfuncs test, except
that the inferior being tested doesn't call malloc. (On HPUX, at
least, gdb calls malloc in the inferior's space before evaluating
inferior functions that take pointers. The path that gdb follows
to setup the malloc call varies depending upon whether the inferior
itself calls malloc. It seems there's a bug currently in HPUX,
both for 10.20 and 10.30, in that the very first such malloc call
fails. Needs investigating.)
I will let someone at HP WDB team who is more familiar with this topic
jump in and share thoughts ...
- Jimmy Guo, guo@cup.hp.com
>The stated point of callfwmall.exp is to try debugging programs which
>don't explicitly use `malloc'. However, some of the tests have GDB
>evaluate expressions containing string literals; GDB implements string
>literals by calling malloc to reserve some space in the inferior, and
>then copying the literal text into that space.
>
>It seems to me that those tests can only pass if malloc has somehow
>been linked into the inferior, but I don't see any reason to assume
>this must necessarily happen, since callfwmall.c makes no explicit
>calls to malloc, or indeed to any library routines whatsoever.
>
>So aren't these tests fundamentally misconceived? Why are they
>supposed to work? How have people dealt with them in the past?
- To: gdb at sourceware dot cygnus dot com
- Subject: How is gdb/testsuite/gdb.base/callfwmall.exp supposed to work?
- From: Jim Blandy <jimb at cygnus dot com>
- Date: Mon, 24 Apr 2000 12:42:28 -0500 (EST)
The stated point of callfwmall.exp is to try debugging programs which
don't explicitly use `malloc'. However, some of the tests have GDB
evaluate expressions containing string literals; GDB implements string
literals by calling malloc to reserve some space in the inferior, and
then copying the literal text into that space.
It seems to me that those tests can only pass if malloc has somehow
been linked into the inferior, but I don't see any reason to assume
this must necessarily happen, since callfwmall.c makes no explicit
calls to malloc, or indeed to any library routines whatsoever.
So aren't these tests fundamentally misconceived? Why are they
supposed to work? How have people dealt with them in the past?