Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Re: [RFA]: Fix gdb.base/callfwmall.exp for platforms without malloc
@ 2001-05-22  9:16 Michael Elizabeth Chastain
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Elizabeth Chastain @ 2001-05-22  9:16 UTC (permalink / raw)
  To: jimb, Stephane.Carrez; +Cc: gdb-patches, keiths, msnyder

As other people have pointed out, gdb needs a way to allocate memory in
the inferior.  The chosen way is: call "malloc".

If the inferior program truly has no function named "malloc",
then gdb will produce this error:

  evaluation of this expression requires the program to have a function "malloc"

If the inferior program has a function named "malloc", then gdb will
call it.  Sometimes this is non-trivial.  In particular, on hppa*-*-hpux*
targets, the inferior program uses a pair of function stubs for each
call to a shared library function.  These stubs do some bookkeeping
for the address space change from the program text to the shared library
text.

Ordinarily the inferior program sets up these stubs and gdb piggybacks on
that work.  But if a function is available in a shared library, but the
inferior does not call it, then gdb has to do additional work to find the
right place to call.  There are actually different code paths for "call an
inferior function which the inferior itself calls" and "call an inferior
function which the inferior itself does not call".  This is a feature,
and it needs testing.

Also, callfwmall.exp has 11 FAILs on native Red Hat Linux 6.2:

  FAIL: gdb.base/callfwmall.exp: p t_float_values(3.14159,-2.3765)
  FAIL: gdb.base/callfwmall.exp: p t_float_values(float_val1,float_val2)
  FAIL: gdb.base/callfwmall.exp: p t_float_values(3.14159,float_val2)
  FAIL: gdb.base/callfwmall.exp: p t_float_values(float_val1,-2.3765)
  FAIL: gdb.base/callfwmall.exp: p t_float_values2(3.14159,float_val2)
  FAIL: gdb.base/callfwmall.exp: p t_double_values(45.654,-67.66)
  FAIL: gdb.base/callfwmall.exp: p t_double_values(double_val1,double_val2)
  FAIL: gdb.base/callfwmall.exp: p t_double_values(45.654,double_val2)
  FAIL: gdb.base/callfwmall.exp: p t_double_values(double_val1,-67.66)
  FAIL: gdb.base/callfwmall.exp: call inferior func with struct - returns float
  FAIL: gdb.base/callfwmall.exp: call inferior func with struct - returns double

The same tests in callfuncs.exp PASS.

Michael


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2001-06-06  9:07 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <3B07B042.6BAD93A0@worldnet.fr>
2001-05-21 10:43 ` [RFA]: Fix gdb.base/callfwmall.exp for platforms without malloc Michael Snyder
2001-05-21 10:56   ` Keith Seitz
2001-05-21 11:10     ` Michael Snyder
2001-05-21 14:20       ` Stephane Carrez
2001-05-21 14:58         ` Michael Snyder
2001-05-21 22:45         ` Jim Blandy
2001-06-06  9:07         ` Andrew Cagney
2001-05-22  9:16 Michael Elizabeth Chastain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox