This is the mail archive of the gdb@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]

[Fwd: How is gdb/testsuite/gdb.base/callfwmall.exp supposed to work?]


Given the recent discussion, the attatched is very relevant.
	Andrew


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?








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?





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