Problem Assining Values to Arrays in GDB 4.17

Michael Snyder msnyder@specifix.com
Thu Apr 3 21:48:00 GMT 2008


On Thu, 2008-04-03 at 07:32 +0200, JBWeeN wrote:
> It does not work, If a use a system call gdb says that command is undefined.
> I get the following error:
>     (gdb) memcpy(myArray, {1.2, 2.0, 5.7}, 3*sizeof(double))
>        Undefined command: "memcpy".  Try "help".


Ah, well, you see, gdb does not know "memcpy" as a 
command, but it understands it as part of an expression.

    (gdb) print memcpy (myArray, whatever, 3*sizeof(double))

For this special case of calling a function when you
do not really care to see the return value printed, 
there is the command "call".  Just substitute "call"
for "print" above.





More information about the Gdb mailing list