dupx is a shell script to redirect an existing process STDOUT or STDIN to a file. Unfortunately, I was getting this error after invoking dupx -o /tmp/some.log PID:
/tmp/gdbcmd.F8Qf:5: Error in sourced command file:
Unable to call function "dup2" at 0x7fff96e233b8: no return type information available.
To call this function anyway, you can cast the return type explicitly (e.g. 'print (float) fabs (3.0)')
Success
I found a handy Gist that did mostly what dupx does, toyed with it in GDB, and then modified the original dupx script to add (int) type casting in the open, dup, dup2, close, and write calls.