support BUILD_DOCUMATION option and refactor gdbcontroller