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

Stan Shebs
2001-02-14T13:37:00Z

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