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

Andrew Cagney
2001-02-14T20:13:00Z

Kevin Buettner wrote:

> There are a number of platforms which pass these tests, but only
> because malloc() is sneaks in because it's required by the dynamic
> linker. If HPUX passes for a similar reason, this is cheating. OTOH,
> if the HPUX port uses some other mechanism entirely, it might be a
> good idea for us to adapt this mechanism so that other targets can
> use it too.

I'd describe it as bending the truth rather than cheating.

To the best of my knolwedge, the objective of the test is to ensure that
GDB can still handle code like:

print strlen ("foo")

when the target doesn't link in malloc(). Well, to be more precice, the
target doesn't explicitly link in malloc(). GDB is forced to grub around
in shared library information (or, gasp, the target rom) to obtain a
malloc() function.

As far as I can tell, the proposed change defeats this test. Yes, there
are targets that really don't have malloc() and on those targets the
test should probably xfailed. However, on any target with a shared
library() I think it should be allowed to run.

How many targets currently fail the test?

Andrew