support debugfile switch and global script config

support debugfile switch and global script config