Copy fake malloc function for string operation in gdbscript