From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stan Shebs To: Fernando Nasser Cc: Michael Snyder , Keith Seitz , gdb-patches@sources.redhat.com Subject: Re: [RFA] Assuming malloc exists in callfwmall.exp Date: Wed, 14 Feb 2001 13:37:00 -0000 Message-id: <3A8AFA2B.605F177D@apple.com> References: <3A8ABA01.C25B0FD2@cygnus.com> <3A8AEFEA.A2E2A61E@cygnus.com> <3A8AF68A.9B2CF558@cygnus.com> X-SW-Source: 2001-02/msg00224.html 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