Added gdb support to run script, use -g option to run in gdb.