[RFA] Assuming malloc exists in callfwmall.exp

Stan Shebs shebs@apple.com
Wed Feb 14 13:37:00 GMT 2001


Fernando Nasser wrote:
> 
> But how is it possible that GDB needs malloc() when the target does not have it?

(gdb) p strlen("foobar")

The string itself needs to be in the target's memory, so you can give
the function a pointer to it.  malloc() is a convenient default way
to acquire the space, then GDB copies in the string's contents.

Stan



More information about the Gdb-patches mailing list