def METHOD_NAME(self) -> None:
    """
    Stop GDB.
    This writes session logs to make post-mortem debugging.
    """
    if not self.alive:
        return
    self.alive = False
    # No matter what, write the session logs to make post-mortem debugging
    # possible.
    with open(self.log_file, "w") as f:
        f.write(self.proc.get_session_logs())