================
@@ -0,0 +1,529 @@
+# FIXME: remove when LLDB_MINIMUM_PYTHON_VERSION > 3.8
+from __future__ import annotations
+
+import contextlib
+import dataclasses
+import functools
+import io
+import itertools
+import json
+import logging
+import os
+import subprocess
+import threading
+from concurrent import futures
+from concurrent.futures import Future
+from dataclasses import fields
+from pathlib import Path
+from typing import Any, Callable, Generic, Optional, Type, TypeVar
+
+from .dap_types import (
+    AnyResponse,
+    ArgsProtocol,
+    Capabilities,
+    CapabilitiesEvent,
+    ContinueArgs,
+    DAPError,
+    DisconnectArgs,
+    ErrorResponse,
+    Event,
+    ExitedEvent,
+    GotoArgs,
+    InitializeArgs,
+    InitializedEvent,
+    Message,
+    MessageType,
+    NextArgs,
+    OutputCategory,
+    OutputEvent,
+    RawMessage,
+    Request,
+    Response,
+    RestartArgs,
+    ReverseResponse,
+    RunInTerminalRequest,
+    RunInTerminalResponse,
+    StepInArgs,
+    StepOutArgs,
+    StoppedEvent,
+    TerminateArgs,
+    dict_to_message,
+)
+from .utils import (
+    DebugAdapter,
+    EventHistory,
+    MessageHandler,
+    SubProcessSpawner,
+    redirect_stream,
+)
+
+R = TypeVar("R")
+
+# Any Request that resumes execution (or terminates the session),
+# invalidates any frameId or variablesReference captured during the current 
stop.
+# Sending one of these Requests advances the session's stop_generation.
+# To prevent using a frameId or variablesReference that is no longer valid once
+# the session continues.
+_RESUMING_COMMANDS = (
----------------
da-viper wrote:

I only update the generation only for requests to catch obvious stale variable 
bugs when writing tests. Events may come at any time and the variable may still 
be valid after receiving some events, because we increased the generation 
twice. once for the (step) request and one for the (continued) event.

https://github.com/llvm/llvm-project/pull/203978
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to