def _drive(self):
        """This function sets up the caputured gdb instance"""
        assert os.path.isfile(self._file_name)
        cmd = [self._gdb_binary, '--interpreter', 'mi']
        if self._init_cmds is not None:
            cmd += list(self._init_cmds)
        cmd += ['--args', self._python, self._file_name]
        self._captured = pexpect.spawn(' '.join(cmd))
        if self._debug:
            self._captured.logfile = sys.stdout.buffer
This function sets up the caputured gdb instance
numba/tests/gdb_support.py