Fixed flash script to automatically spawn appropriate gdb session