Skip to content

Conversation

ashgti
Copy link
Contributor

@ashgti ashgti commented Jul 9, 2025

Originally commited in 362b9d7 and then reverted in cb63b75.

This re-lands a subset of the changes to dap_server.py/DebugCommunication and addresses the python3.10 compatibility issue.

This includes less type annotations since those were the reason for the failures on that specific version of python.

I've done additional testing on python3.8, python3.10 and python3.13 to further validate these changes.

@ashgti ashgti requested a review from JDevlieghere as a code owner July 9, 2025 17:34
@llvmbot llvmbot added the lldb label Jul 9, 2025
@ashgti ashgti requested review from JDevlieghere, da-viper and eronnen and removed request for JDevlieghere July 9, 2025 17:35
@llvmbot
Copy link
Member

llvmbot commented Jul 9, 2025

@llvm/pr-subscribers-lldb

Author: John Harrison (ashgti)

Changes

Originally commited in 362b9d7 and then reverted in cb63b75.

This re-lands a subset of the changes to dap_server.py/DebugCommunication and addresses the python3.10 compatibility issue.

This includes less type annotations since those were the reason for the failures on that specific version of python.

I've done additional testing on python3.8, python3.10 and python3.13 to further validate these changes.


Patch is 63.10 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/147787.diff

9 Files Affected:

  • (modified) lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py (+404-285)
  • (modified) lldb/packages/Python/lldbsuite/test/tools/lldb-dap/lldbdap_testcase.py (+47-35)
  • (modified) lldb/test/API/tools/lldb-dap/attach/TestDAP_attach.py (+4-4)
  • (modified) lldb/test/API/tools/lldb-dap/cancel/TestDAP_cancel.py (+8-13)
  • (modified) lldb/test/API/tools/lldb-dap/commands/TestDAP_commands.py (+6-9)
  • (modified) lldb/test/API/tools/lldb-dap/console/TestDAP_console.py (+3-9)
  • (modified) lldb/test/API/tools/lldb-dap/launch/TestDAP_launch.py (+8-17)
  • (modified) lldb/test/API/tools/lldb-dap/module/TestDAP_module.py (+2-4)
  • (modified) lldb/test/API/tools/lldb-dap/output/TestDAP_output.py (+3-3)
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
index d227a66a703c1..1677839df54c5 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py
@@ -12,15 +12,56 @@
 import sys
 import threading
 import time
-from typing import Any, Optional, Union, BinaryIO, TextIO
+from typing import (
+    Any,
+    Optional,
+    Dict,
+    cast,
+    List,
+    Callable,
+    IO,
+    Union,
+    BinaryIO,
+    TextIO,
+    TypedDict,
+    Literal,
+)
 
 ## DAP type references
-Event = dict[str, Any]
-Request = dict[str, Any]
-Response = dict[str, Any]
+
+
+class Event(TypedDict):
+    type: Literal["event"]
+    seq: int
+    event: str
+    body: Any
+
+
+class Request(TypedDict, total=False):
+    type: Literal["request"]
+    seq: int
+    command: str
+    arguments: Any
+
+
+class Response(TypedDict):
+    type: Literal["response"]
+    seq: int
+    request_seq: int
+    success: bool
+    command: str
+    message: Optional[str]
+    body: Any
+
+
 ProtocolMessage = Union[Event, Request, Response]
 
 
+class Breakpoint(TypedDict, total=False):
+    id: int
+    verified: bool
+
+
 def dump_memory(base_addr, data, num_per_line, outfile):
     data_len = len(data)
     hex_string = binascii.hexlify(data)
@@ -58,7 +99,9 @@ def dump_memory(base_addr, data, num_per_line, outfile):
         outfile.write("\n")
 
 
-def read_packet(f, verbose=False, trace_file=None):
+def read_packet(
+    f: IO[bytes], trace_file: Optional[IO[str]] = None
+) -> Optional[ProtocolMessage]:
     """Decode a JSON packet that starts with the content length and is
     followed by the JSON bytes from a file 'f'. Returns None on EOF.
     """
@@ -70,19 +113,13 @@ def read_packet(f, verbose=False, trace_file=None):
     prefix = "Content-Length: "
     if line.startswith(prefix):
         # Decode length of JSON bytes
-        if verbose:
-            print('content: "%s"' % (line))
         length = int(line[len(prefix) :])
-        if verbose:
-            print('length: "%u"' % (length))
         # Skip empty line
-        line = f.readline()
-        if verbose:
-            print('empty: "%s"' % (line))
+        separator = f.readline().decode()
+        if separator != "":
+            Exception("malformed DAP content header, unexpected line: " + separator)
         # Read JSON bytes
-        json_str = f.read(length)
-        if verbose:
-            print('json: "%s"' % (json_str))
+        json_str = f.read(length).decode()
         if trace_file:
             trace_file.write("from adapter:\n%s\n" % (json_str))
         # Decode the JSON bytes into a python dictionary
@@ -95,7 +132,7 @@ def packet_type_is(packet, packet_type):
     return "type" in packet and packet["type"] == packet_type
 
 
-def dump_dap_log(log_file):
+def dump_dap_log(log_file: Optional[str]) -> None:
     print("========= DEBUG ADAPTER PROTOCOL LOGS =========", file=sys.stderr)
     if log_file is None:
         print("no log file available", file=sys.stderr)
@@ -152,25 +189,41 @@ def __init__(
         self.log_file = log_file
         self.send = send
         self.recv = recv
-        self.recv_packets: list[Optional[ProtocolMessage]] = []
-        self.recv_condition = threading.Condition()
-        self.recv_thread = threading.Thread(target=self._read_packet_thread)
-        self.process_event_body = None
-        self.exit_status: Optional[int] = None
-        self.capabilities: dict[str, Any] = {}
-        self.progress_events: list[Event] = []
-        self.reverse_requests = []
-        self.sequence = 1
-        self.threads = None
-        self.thread_stop_reasons = {}
-        self.recv_thread.start()
-        self.output_condition = threading.Condition()
-        self.output: dict[str, list[str]] = {}
-        self.configuration_done_sent = False
-        self.initialized = False
-        self.frame_scopes = {}
+
+        # Packets that have been received and processed but have not yet been
+        # requested by a test case.
+        self._pending_packets: List[Optional[ProtocolMessage]] = []
+        # Received packets that have not yet been processed.
+        self._recv_packets: List[Optional[ProtocolMessage]] = []
+        # Used as a mutex for _recv_packets and for notify when _recv_packets
+        # changes.
+        self._recv_condition = threading.Condition()
+        self._recv_thread = threading.Thread(target=self._read_packet_thread)
+
+        # session state
         self.init_commands = init_commands
-        self.resolved_breakpoints = {}
+        self.exit_status: Optional[int] = None
+        self.capabilities: Optional[Dict] = None
+        self.initialized: bool = False
+        self.configuration_done_sent: bool = False
+        self.process_event_body: Optional[Dict] = None
+        self.terminated: bool = False
+        self.events: List[Event] = []
+        self.progress_events: List[Event] = []
+        self.reverse_requests: List[Request] = []
+        self.module_events: List[Dict] = []
+        self.sequence: int = 1
+        self.output: Dict[str, str] = {}
+
+        # debuggee state
+        self.threads: Optional[dict] = None
+        self.thread_stop_reasons: Dict[str, Any] = {}
+        self.frame_scopes: Dict[str, Any] = {}
+        # keyed by breakpoint id
+        self.resolved_breakpoints: Dict[str, bool] = {}
+
+        # trigger enqueue thread
+        self._recv_thread.start()
 
     @classmethod
     def encode_content(cls, s: str) -> bytes:
@@ -188,267 +241,326 @@ def validate_response(cls, command, response):
             )
 
     def _read_packet_thread(self):
-        done = False
         try:
-            while not done:
+            while True:
                 packet = read_packet(self.recv, trace_file=self.trace_file)
                 # `packet` will be `None` on EOF. We want to pass it down to
                 # handle_recv_packet anyway so the main thread can handle unexpected
                 # termination of lldb-dap and stop waiting for new packets.
-                done = not self._handle_recv_packet(packet)
+                if not self._handle_recv_packet(packet):
+                    break
         finally:
             dump_dap_log(self.log_file)
 
-    def get_modules(self, startModule: int = 0, moduleCount: int = 0):
-        module_list = self.request_modules(startModule, moduleCount)["body"]["modules"]
+    def get_modules(
+        self, start_module: Optional[int] = None, module_count: Optional[int] = None
+    ) -> Dict:
+        resp = self.request_modules(start_module, module_count)
+        if not resp["success"]:
+            raise ValueError(f"request_modules failed: {resp!r}")
         modules = {}
+        module_list = resp["body"]["modules"]
         for module in module_list:
             modules[module["name"]] = module
         return modules
 
-    def get_output(self, category, timeout=0.0, clear=True):
-        self.output_condition.acquire()
-        output = None
+    def get_output(self, category: str, clear=True) -> str:
+        output = ""
         if category in self.output:
-            output = self.output[category]
+            output = self.output.get(category, "")
             if clear:
                 del self.output[category]
-        elif timeout != 0.0:
-            self.output_condition.wait(timeout)
-            if category in self.output:
-                output = self.output[category]
-                if clear:
-                    del self.output[category]
-        self.output_condition.release()
         return output
 
-    def collect_output(self, category, timeout_secs, pattern, clear=True):
-        end_time = time.time() + timeout_secs
-        collected_output = ""
-        while end_time > time.time():
-            output = self.get_output(category, timeout=0.25, clear=clear)
-            if output:
-                collected_output += output
-                if pattern is not None and pattern in output:
-                    break
-        return collected_output if collected_output else None
+    def collect_output(
+        self,
+        category: str,
+        timeout: float,
+        pattern: Optional[str] = None,
+        clear=True,
+    ) -> str:
+        """Collect output from 'output' events.
+        Args:
+            category: The category to collect.
+            timeout: The max duration for collecting output.
+            pattern:
+                Optional, if set, return once this pattern is detected in the
+                collected output.
+        Returns:
+            The collected output.
+        """
+        deadline = time.monotonic() + timeout
+        output = self.get_output(category, clear)
+        while deadline >= time.monotonic() and (
+            pattern is None or pattern not in output
+        ):
+            event = self.wait_for_event(["output"], timeout=deadline - time.monotonic())
+            if not event:  # Timeout or EOF
+                break
+            output += self.get_output(category, clear=clear)
+        return output
 
     def _enqueue_recv_packet(self, packet: Optional[ProtocolMessage]):
-        self.recv_condition.acquire()
-        self.recv_packets.append(packet)
-        self.recv_condition.notify()
-        self.recv_condition.release()
+        with self.recv_condition:
+            self.recv_packets.append(packet)
+            self.recv_condition.notify()
 
     def _handle_recv_packet(self, packet: Optional[ProtocolMessage]) -> bool:
-        """Called by the read thread that is waiting for all incoming packets
-        to store the incoming packet in "self.recv_packets" in a thread safe
-        way. This function will then signal the "self.recv_condition" to
-        indicate a new packet is available. Returns True if the caller
-        should keep calling this function for more packets.
+        """Handles an incoming packet.
+
+        Called by the read thread that is waiting for all incoming packets
+        to store the incoming packet in "self._recv_packets" in a thread safe
+        way. This function will then signal the "self._recv_condition" to
+        indicate a new packet is available.
+
+        Args:
+            packet: A new packet to store.
+
+        Returns:
+            True if the caller should keep calling this function for more
+            packets.
         """
-        # If EOF, notify the read thread by enqueuing a None.
-        if not packet:
-            self._enqueue_recv_packet(None)
-            return False
-
-        # Check the packet to see if is an event packet
-        keepGoing = True
-        packet_type = packet["type"]
-        if packet_type == "event":
-            event = packet["event"]
-            body = None
-            if "body" in packet:
-                body = packet["body"]
-            # Handle the event packet and cache information from these packets
-            # as they come in
-            if event == "output":
-                # Store any output we receive so clients can retrieve it later.
-                category = body["category"]
-                output = body["output"]
-                self.output_condition.acquire()
-                if category in self.output:
-                    self.output[category] += output
-                else:
-                    self.output[category] = output
-                self.output_condition.notify()
-                self.output_condition.release()
-                # no need to add 'output' event packets to our packets list
-                return keepGoing
-            elif event == "initialized":
-                self.initialized = True
-            elif event == "process":
-                # When a new process is attached or launched, remember the
-                # details that are available in the body of the event
-                self.process_event_body = body
-            elif event == "exited":
-                # Process exited, mark the status to indicate the process is not
-                # alive.
-                self.exit_status = body["exitCode"]
-            elif event == "continued":
-                # When the process continues, clear the known threads and
-                # thread_stop_reasons.
-                all_threads_continued = body.get("allThreadsContinued", True)
-                tid = body["threadId"]
-                if tid in self.thread_stop_reasons:
-                    del self.thread_stop_reasons[tid]
-                self._process_continued(all_threads_continued)
-            elif event == "stopped":
-                # Each thread that stops with a reason will send a
-                # 'stopped' event. We need to remember the thread stop
-                # reasons since the 'threads' command doesn't return
-                # that information.
-                self._process_stopped()
-                tid = body["threadId"]
-                self.thread_stop_reasons[tid] = body
-            elif event.startswith("progress"):
-                # Progress events come in as 'progressStart', 'progressUpdate',
-                # and 'progressEnd' events. Keep these around in case test
-                # cases want to verify them.
-                self.progress_events.append(packet)
-            elif event == "breakpoint":
-                # Breakpoint events are sent when a breakpoint is resolved
-                self._update_verified_breakpoints([body["breakpoint"]])
-            elif event == "capabilities":
-                # Update the capabilities with new ones from the event.
-                self.capabilities.update(body["capabilities"])
-
-        elif packet_type == "response":
-            if packet["command"] == "disconnect":
-                keepGoing = False
-        self._enqueue_recv_packet(packet)
-        return keepGoing
+        with self._recv_condition:
+            self._recv_packets.append(packet)
+            self._recv_condition.notify()
+            # packet is None on EOF
+            return packet is not None and not (
+                packet["type"] == "response" and packet["command"] == "disconnect"
+            )
+
+    def _recv_packet(
+        self,
+        *,
+        predicate: Optional[Callable[[ProtocolMessage], bool]] = None,
+        timeout: Optional[float] = None,
+    ) -> Optional[ProtocolMessage]:
+        """Processes received packets from the adapter.
+        Updates the DebugCommunication stateful properties based on the received
+        packets in the order they are received.
+        NOTE: The only time the session state properties should be updated is
+        during this call to ensure consistency during tests.
+        Args:
+            predicate:
+                Optional, if specified, returns the first packet that matches
+                the given predicate.
+            timeout:
+                Optional, if specified, processes packets until either the
+                timeout occurs or the predicate matches a packet, whichever
+                occurs first.
+        Returns:
+            The first matching packet for the given predicate, if specified,
+            otherwise None.
+        """
+        assert (
+            threading.current_thread != self._recv_thread
+        ), "Must not be called from the _recv_thread"
+
+        def process_until_match():
+            self._process_recv_packets()
+            for i, packet in enumerate(self._pending_packets):
+                if packet is None:
+                    # We need to return a truthy value to break out of the
+                    # wait_for, use `EOFError` as an indicator of EOF.
+                    return EOFError()
+                if predicate and predicate(packet):
+                    self._pending_packets.pop(i)
+                    return packet
+
+        with self._recv_condition:
+            packet = self._recv_condition.wait_for(process_until_match, timeout)
+            return None if isinstance(packet, EOFError) else packet
+
+    def _process_recv_packets(self) -> None:
+        """Process received packets, updating the session state."""
+        with self._recv_condition:
+            for packet in self._recv_packets:
+                # Handle events that may modify any stateful properties of
+                # the DAP session.
+                if packet and packet["type"] == "event":
+                    self._handle_event(packet)
+                elif packet and packet["type"] == "request":
+                    # Handle reverse requests and keep processing.
+                    self._handle_reverse_request(packet)
+                # Move the packet to the pending queue.
+                self._pending_packets.append(packet)
+            self._recv_packets.clear()
+
+    def _handle_event(self, packet: Event) -> None:
+        """Handle any events that modify debug session state we track."""
+        event = packet["event"]
+        body: Optional[Dict] = packet.get("body", None)
+
+        if event == "output" and body:
+            # Store any output we receive so clients can retrieve it later.
+            category = body["category"]
+            output = body["output"]
+            if category in self.output:
+                self.output[category] += output
+            else:
+                self.output[category] = output
+        elif event == "initialized":
+            self.initialized = True
+        elif event == "process":
+            # When a new process is attached or launched, remember the
+            # details that are available in the body of the event
+            self.process_event_body = body
+        elif event == "exited" and body:
+            # Process exited, mark the status to indicate the process is not
+            # alive.
+            self.exit_status = body["exitCode"]
+        elif event == "continued" and body:
+            # When the process continues, clear the known threads and
+            # thread_stop_reasons.
+            all_threads_continued = body.get("allThreadsContinued", True)
+            tid = body["threadId"]
+            if tid in self.thread_stop_reasons:
+                del self.thread_stop_reasons[tid]
+            self._process_continued(all_threads_continued)
+        elif event == "stopped" and body:
+            # Each thread that stops with a reason will send a
+            # 'stopped' event. We need to remember the thread stop
+            # reasons since the 'threads' command doesn't return
+            # that information.
+            self._process_stopped()
+            tid = body["threadId"]
+            self.thread_stop_reasons[tid] = body
+        elif event.startswith("progress"):
+            # Progress events come in as 'progressStart', 'progressUpdate',
+            # and 'progressEnd' events. Keep these around in case test
+            # cases want to verify them.
+            self.progress_events.append(packet)
+        elif event == "breakpoint" and body:
+            # Breakpoint events are sent when a breakpoint is resolved
+            self._update_verified_breakpoints([body["breakpoint"]])
+        elif event == "capabilities" and body:
+            if self.capabilities is None:
+                self.capabilities = {}
+            # Update the capabilities with new ones from the event.
+            self.capabilities.update(body["capabilities"])
+
+    def _handle_reverse_request(self, request: Request) -> None:
+        if request in self.reverse_requests:
+            return
+        self.reverse_requests.append(request)
+        arguments = request.get("arguments")
+        if request["command"] == "runInTerminal" and arguments is not None:
+            in_shell = arguments.get("argsCanBeInterpretedByShell", False)
+            proc = subprocess.Popen(
+                arguments["args"],
+                env=arguments.get("env", {}),
+                cwd=arguments.get("cwd", None),
+                stdin=subprocess.DEVNULL,
+                stdout=subprocess.DEVNULL,
+                stderr=subprocess.DEVNULL,
+                shell=in_shell,
+            )
+            body = {}
+            if in_shell:
+                body["shellProcessId"] = proc.pid
+            else:
+                body["processId"] = proc.pid
+            self.send_packet(
+                {
+                    "type": "response",
+      ...
[truncated]

@ashgti ashgti requested a review from walter-erquinigo July 9, 2025 17:35
ashgti added 2 commits August 19, 2025 09:48
Originally commited in 362b9d7 and then reverted in cb63b75.

This reland a subset of the changes to dap_server.py/DebugCommunication and addresses the python3.10 comptability issue.

This includes less type annotations since those were the reason for the failures on that specific version of python.

I've done additionall testing on python3.8, python3.10 and python3.13 to further validate these changes.
@ashgti ashgti force-pushed the lldb-dap-test-stability branch from fb53f17 to fba6a54 Compare August 20, 2025 17:14
@ashgti ashgti merged commit 13eca52 into llvm:main Aug 21, 2025
9 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Aug 21, 2025

LLVM Buildbot has detected a new failure on builder lldb-x86_64-debian running on lldb-x86_64-debian while building lldb at step 6 "test".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/162/builds/29461

Here is the relevant piece of the build log for the reference
Step 6 (test) failure: build (failure)
...
PASS: lldb-api :: functionalities/thread/create_after_attach/TestCreateAfterAttach.py (336 of 3150)
PASS: lldb-api :: functionalities/breakpoint/serialize/TestBreakpointSerialization.py (337 of 3150)
PASS: lldb-api :: tools/lldb-dap/stackTraceDisassemblyDisplay/TestDAP_stackTraceDisassemblyDisplay.py (338 of 3150)
PASS: lldb-api :: functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py (339 of 3150)
PASS: lldb-api :: functionalities/breakpoint/breakpoint_names/TestBreakpointNames.py (340 of 3150)
PASS: lldb-api :: types/TestRecursiveTypes.py (341 of 3150)
PASS: lldb-api :: functionalities/data-formatter/custom-printf-summary/TestCustomSummaryLLVMFormat.py (342 of 3150)
PASS: lldb-api :: functionalities/thread/state_after_expression/TestStateAfterExpression.py (343 of 3150)
PASS: lldb-api :: python_api/type/TestTypeList.py (344 of 3150)
UNRESOLVED: lldb-api :: tools/lldb-dap/moduleSymbols/TestDAP_moduleSymbols.py (345 of 3150)
******************** TEST 'lldb-api :: tools/lldb-dap/moduleSymbols/TestDAP_moduleSymbols.py' FAILED ********************
Script:
--
/usr/bin/python3 /home/worker/2.0.1/lldb-x86_64-debian/llvm-project/lldb/test/API/dotest.py -u CXXFLAGS -u CFLAGS --env LLVM_LIBS_DIR=/home/worker/2.0.1/lldb-x86_64-debian/build/./lib --env LLVM_INCLUDE_DIR=/home/worker/2.0.1/lldb-x86_64-debian/build/include --env LLVM_TOOLS_DIR=/home/worker/2.0.1/lldb-x86_64-debian/build/./bin --arch x86_64 --build-dir /home/worker/2.0.1/lldb-x86_64-debian/build/lldb-test-build.noindex --lldb-module-cache-dir /home/worker/2.0.1/lldb-x86_64-debian/build/lldb-test-build.noindex/module-cache-lldb/lldb-api --clang-module-cache-dir /home/worker/2.0.1/lldb-x86_64-debian/build/lldb-test-build.noindex/module-cache-clang/lldb-api --executable /home/worker/2.0.1/lldb-x86_64-debian/build/./bin/lldb --compiler /home/worker/2.0.1/lldb-x86_64-debian/build/./bin/clang --dsymutil /home/worker/2.0.1/lldb-x86_64-debian/build/./bin/dsymutil --make /usr/bin/gmake --llvm-tools-dir /home/worker/2.0.1/lldb-x86_64-debian/build/./bin --lldb-obj-root /home/worker/2.0.1/lldb-x86_64-debian/build/tools/lldb --lldb-libs-dir /home/worker/2.0.1/lldb-x86_64-debian/build/./lib --cmake-build-type Release -t /home/worker/2.0.1/lldb-x86_64-debian/llvm-project/lldb/test/API/tools/lldb-dap/moduleSymbols -p TestDAP_moduleSymbols.py
--
Exit Code: 1

Command Output (stdout):
--
lldb version 22.0.0git (https://github.com/llvm/llvm-project.git revision 13eca5248c7bf625af9c7af898d48e8c0a441496)
  clang revision 13eca5248c7bf625af9c7af898d48e8c0a441496
  llvm revision 13eca5248c7bf625af9c7af898d48e8c0a441496
Skipping the following test categories: ['libc++', 'msvcstl', 'dsym', 'gmodules', 'debugserver', 'objc']

--
Command Output (stderr):
--
Change dir to: /home/worker/2.0.1/lldb-x86_64-debian/llvm-project/lldb/test/API/tools/lldb-dap/moduleSymbols
runCmd: settings clear --all

output: 

runCmd: settings set symbols.enable-external-lookup false

output: 

runCmd: settings set target.inherit-tcc true

output: 

runCmd: settings set target.disable-aslr false

output: 

runCmd: settings set target.detach-on-error false

output: 

runCmd: settings set target.auto-apply-fixits false

@da-viper
Copy link
Contributor

AttributeError: 'DebugAdapterServer' object has no attribute 'send_recv'. Did you mean: '_send_recv'?

missed update location.

lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py line 1319

rastogishubham added a commit that referenced this pull request Aug 21, 2025
This reverts commit 13eca52.

This change broke greendragon lldb test:

lldb-api.tools/lldb-dap/moduleSymbols.TestDAP_moduleSymbols.py
@rastogishubham
Copy link
Contributor

rastogishubham commented Aug 21, 2025

It looks like this change broke greendragon https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/as-lldb-cmake/31784

FAIL: LLDB (/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/bin/clang-arm64) :: test_moduleSymbols (TestDAP_moduleSymbols.TestDAP_moduleSymbols)

It was reverted with 0f33b90

******************** TEST 'lldb-api :: tools/lldb-dap/moduleSymbols/TestDAP_moduleSymbols.py' FAILED ********************
17:29:48  Script:
17:29:48  --
17:29:48  /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/venv/bin/python3.9 /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/test/API/dotest.py -u CXXFLAGS -u CFLAGS --env LLVM_LIBS_DIR=/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/./lib --env LLVM_INCLUDE_DIR=/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/include --env LLVM_TOOLS_DIR=/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/./bin --libcxx-include-dir /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/include/c++/v1 --libcxx-library-dir /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/lib --arch arm64 --build-dir /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/lldb-test-build.noindex --lldb-module-cache-dir /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/lldb-test-build.noindex/module-cache-lldb/lldb-api --clang-module-cache-dir /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/lldb-test-build.noindex/module-cache-clang/lldb-api --executable /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/./bin/lldb --compiler /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/./bin/clang --dsymutil /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/./bin/dsymutil --make /usr/bin/make --llvm-tools-dir /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/./bin --lldb-obj-root /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/tools/lldb --lldb-libs-dir /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/./lib --cmake-build-type Release --build-dir /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/lldb-test-build.noindex -t --env TERM=vt100 /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/test/API/tools/lldb-dap/moduleSymbols -p TestDAP_moduleSymbols.py
17:29:48  --
17:29:48  Exit Code: 1
17:29:48  
17:29:48  Command Output (stdout):
17:29:48  --
17:29:48  lldb version 22.0.99git (https://github.com/llvm/llvm-project.git revision 0319a7970d71b0ceb3725baa18646e9a9d194e20)
17:29:48    clang revision 0319a7970d71b0ceb3725baa18646e9a9d194e20
17:29:48    llvm revision 0319a7970d71b0ceb3725baa18646e9a9d194e20
17:29:48  Skipping the following test categories: ['libstdcxx', 'msvcstl', 'dwo', 'llgs', 'fork']
17:29:48  
17:29:48  --
17:29:48  Command Output (stderr):
17:29:48  --
17:29:48  Change dir to: /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/test/API/tools/lldb-dap/moduleSymbols
17:29:48  runCmd: settings clear --all
17:29:48  
17:29:48  output: 
17:29:48  
17:29:48  runCmd: settings set symbols.enable-external-lookup false
17:29:48  
17:29:48  output: 
17:29:48  
17:29:48  runCmd: settings set target.inherit-tcc true
17:29:48  
17:29:48  output: 
17:29:48  
17:29:48  runCmd: settings set target.disable-aslr false
17:29:48  
17:29:48  output: 
17:29:48  
17:29:48  runCmd: settings set target.detach-on-error false
17:29:48  
17:29:48  output: 
17:29:48  
17:29:48  runCmd: settings set target.auto-apply-fixits false
17:29:48  
17:29:48  output: 
17:29:48  
17:29:48  runCmd: settings set plugin.process.gdb-remote.packet-timeout 60
17:29:48  
17:29:48  output: 
17:29:48  
17:29:48  runCmd: settings set symbols.clang-modules-cache-path "/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/lldb-test-build.noindex/module-cache-lldb/lldb-api"
17:29:48  
17:29:48  output: 
17:29:48  
17:29:48  runCmd: settings set use-color false
17:29:48  
17:29:48  output: 
17:29:48  
17:29:48  runCmd: settings set show-statusline false
17:29:48  
17:29:48  output: 
17:29:48  
17:29:48  /usr/bin/make VPATH=/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/test/API/tools/lldb-dap/moduleSymbols -C /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/lldb-test-build.noindex/tools/lldb-dap/moduleSymbols/TestDAP_moduleSymbols.test_moduleSymbols -I /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/test/API/tools/lldb-dap/moduleSymbols -I /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/make -f /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/test/API/tools/lldb-dap/moduleSymbols/Makefile all ARCH=arm64 CC=/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/bin/clang CC_TYPE=clang CXX=/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/bin/clang++ LLVM_AR=/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/./bin/llvm-ar AR=/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/./bin/llvm-ar OBJCOPY=/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/./bin/llvm-objcopy STRIP=/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip ARCHIVER=/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/./bin/llvm-ar DWP=/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/./bin/llvm-dwp AR=libtool DSYMUTIL=/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/./bin/dsymutil 'CODESIGN=codesign --entitlements /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/make/entitlements-macos.plist' CLANG_MODULE_CACHE_DIR=/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/lldb-test-build.noindex/module-cache-clang/lldb-api LIBCPP_INCLUDE_DIR=/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/include/c++/v1 LIBCPP_LIBRARY_DIR=/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/lib LLDB_OBJ_ROOT=/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/tools/lldb OS=Darwin HOST_OS=Darwin
17:29:48  
17:29:48  /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/bin/clang -g -O0 -isysroot "/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk" -arch arm64  -I/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/make/../../../../..//include -I/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/tools/lldb/include -I/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/test/API/tools/lldb-dap/moduleSymbols -I/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/make -include /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/make/test_common.h  -fno-limit-debug-info   -MT main.o -MD -MP -MF main.d -c -o main.o /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/test/API/tools/lldb-dap/moduleSymbols/main.c
17:29:48  /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/bin/clang  main.o -g -O0 -isysroot "/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk" -arch arm64  -I/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/make/../../../../..//include -I/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/tools/lldb/include -I/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/test/API/tools/lldb-dap/moduleSymbols -I/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/make -include /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/make/test_common.h  -fno-limit-debug-info     -L/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/lib -Wl,-rpath,/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/lib -lc++ --driver-mode=g++ -o "a.out"
17:29:48  ld: warning: ignoring duplicate libraries: '-lc++'
17:29:48  codesign --entitlements /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/make/entitlements-macos.plist -s - "a.out"
17:29:48  "/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/./bin/dsymutil"  -o "a.out.dSYM" "a.out"
17:29:48  
17:29:48  
17:29:48  Adding tearDown hook:         def cleanup():
17:29:48              if disconnectAutomatically:
17:29:48                  self.dap_server.request_disconnect(terminateDebuggee=True)
17:29:48              self.dap_server.terminate()
17:29:48  
17:29:48  
17:29:48  Executing tearDown hook:         def cleanup():
17:29:48              if disconnectAutomatically:
17:29:48                  self.dap_server.request_disconnect(terminateDebuggee=True)
17:29:48              self.dap_server.terminate()
17:29:48  
17:29:48  
17:29:48  ========= DEBUG ADAPTER PROTOCOL LOGS =========
17:29:48  1755797387.428704977 (stdio) --> {"command":"initialize","type":"request","arguments":{"adapterID":"lldb-native","clientID":"vscode","columnsStartAt1":true,"linesStartAt1":true,"locale":"en-us","pathFormat":"path","supportsRunInTerminalRequest":true,"supportsVariablePaging":true,"supportsVariableType":true,"supportsStartDebuggingRequest":true,"supportsProgressReporting":true,"$__lldb_sourceInitFile":false},"seq":1}
17:29:48  1755797387.428783894 (stdio) queued (command=initialize seq=1)
17:29:48  1755797387.430201054 (stdio) <-- {"body":{"$__lldb_version":"lldb version 22.0.99git (https://github.com/llvm/llvm-project.git revision 0319a7970d71b0ceb3725baa18646e9a9d194e20)\n  clang revision 0319a7970d71b0ceb3725baa18646e9a9d194e20\n  llvm revision 0319a7970d71b0ceb3725baa18646e9a9d194e20","completionTriggerCharacters":["."," ","\t"],"exceptionBreakpointFilters":[{"description":"C++ Catch","filter":"cpp_catch","label":"C++ Catch","supportsCondition":true},{"description":"C++ Throw","filter":"cpp_throw","label":"C++ Throw","supportsCondition":true},{"description":"Objective-C Catch","filter":"objc_catch","label":"Objective-C Catch","supportsCondition":true},{"description":"Objective-C Throw","filter":"objc_throw","label":"Objective-C Throw","supportsCondition":true}],"supportTerminateDebuggee":true,"supportsBreakpointLocationsRequest":true,"supportsCancelRequest":true,"supportsCompletionsRequest":true,"supportsConditionalBreakpoints":true,"supportsConfigurationDoneRequest":true,"supportsDataBreakpoints":true,"supportsDelayedStackTraceLoading":true,"supportsDisassembleRequest":true,"supportsEvaluateForHovers":true,"supportsExceptionFilterOptions":true,"supportsExceptionInfoRequest":true,"supportsFunctionBreakpoints":true,"supportsHitConditionalBreakpoints":true,"supportsInstructionBreakpoints":true,"supportsLogPoints":true,"supportsModuleSymbolsRequest":true,"supportsModulesRequest":true,"supportsReadMemoryRequest":true,"supportsSetVariable":true,"supportsSteppingGranularity":true,"supportsValueFormattingOptions":true,"supportsWriteMemoryRequest":true},"command":"initialize","request_seq":1,"seq":0,"success":true,"type":"response"}
17:29:48  1755797387.430392027 (stdio) --> {"command":"launch","type":"request","arguments":{"program":"/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/lldb-test-build.noindex/tools/lldb-dap/moduleSymbols/TestDAP_moduleSymbols.test_moduleSymbols/a.out","initCommands":["settings clear --all","settings set symbols.enable-external-lookup false","settings set target.inherit-tcc true","settings set target.disable-aslr false","settings set target.detach-on-error false","settings set target.auto-apply-fixits false","settings set plugin.process.gdb-remote.packet-timeout 60","settings set symbols.clang-modules-cache-path \"/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/lldb-test-build.noindex/module-cache-lldb/lldb-api\"","settings set use-color false","settings set show-statusline false"],"disableASLR":false,"enableAutoVariableSummaries":false,"enableSyntheticChildDebugging":false,"displayExtendedBacktrace":false},"seq":2}
17:29:48  1755797387.430418968 (stdio) queued (command=launch seq=2)
17:29:48  1755797387.430568933 (stdio) <-- {"body":{"category":"console","output":"Running initCommands:\n"},"event":"output","seq":0,"type":"event"}
17:29:48  1755797387.430583954 (stdio) <-- {"body":{"category":"console","output":"(lldb) settings clear --all\n"},"event":"output","seq":0,"type":"event"}
17:29:48  1755797387.430594921 (stdio) <-- {"body":{"category":"console","output":"(lldb) settings set symbols.enable-external-lookup false\n"},"event":"output","seq":0,"type":"event"}
17:29:48  1755797387.430604935 (stdio) <-- {"body":{"category":"console","output":"(lldb) settings set target.inherit-tcc true\n"},"event":"output","seq":0,"type":"event"}
17:29:48  1755797387.430613041 (stdio) <-- {"body":{"category":"console","output":"(lldb) settings set target.disable-aslr false\n"},"event":"output","seq":0,"type":"event"}
17:29:48  1755797387.430620909 (stdio) <-- {"body":{"category":"console","output":"(lldb) settings set target.detach-on-error false\n"},"event":"output","seq":0,"type":"event"}
17:29:48  1755797387.430636883 (stdio) <-- {"body":{"category":"console","output":"(lldb) settings set target.auto-apply-fixits false\n"},"event":"output","seq":0,"type":"event"}
17:29:48  1755797387.430644989 (stdio) <-- {"body":{"category":"console","output":"(lldb) settings set plugin.process.gdb-remote.packet-timeout 60\n"},"event":"output","seq":0,"type":"event"}
17:29:48  1755797387.430653095 (stdio) <-- {"body":{"category":"console","output":"(lldb) settings set symbols.clang-modules-cache-path \"/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/lldb-test-build.noindex/module-cache-lldb/lldb-api\"\n"},"event":"output","seq":0,"type":"event"}
17:29:48  1755797387.430660009 (stdio) <-- {"body":{"category":"console","output":"(lldb) settings set use-color false\n"},"event":"output","seq":0,"type":"event"}
17:29:48  1755797387.430666924 (stdio) <-- {"body":{"category":"console","output":"(lldb) settings set show-statusline false\n"},"event":"output","seq":0,"type":"event"}
17:29:48  1755797388.495152950 (stdio) <-- {"command":"launch","request_seq":2,"seq":0,"success":true,"type":"response"}
17:29:48  1755797388.495171070 (stdio) <-- {"body":{"module":{"addressRange":"0x100408000","debugInfoSize":"1.2KB","id":"0B3B8949-3ED6-3637-A6A3-5024B4916D28","name":"a.out","path":"/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/lldb-test-build.noindex/tools/lldb-dap/moduleSymbols/TestDAP_moduleSymbols.test_moduleSymbols/a.out","symbolFilePath":"/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/lldb-test-build.noindex/tools/lldb-dap/moduleSymbols/TestDAP_moduleSymbols.test_moduleSymbols/a.out.dSYM/Contents/Resources/DWARF/a.out","symbolStatus":"Symbols loaded."},"reason":"new"},"event":"module","seq":0,"type":"event"}
17:29:48  1755797388.495184898 (stdio) <-- {"event":"initialized","seq":0,"type":"event"}
17:29:48  1755797388.495203972 (stdio) <-- {"body":{"module":{"addressRange":"0x100630000","id":"EC7A3BA0-F9BF-3AB8-A0F4-8622E5606B20","name":"dyld","path":"/usr/lib/dyld","symbolStatus":"Symbols not found."},"reason":"new"},"event":"module","seq":0,"type":"event"}
17:29:48  1755797388.498173952 (stdio) --> {"command":"disconnect","type":"request","arguments":{"terminateDebuggee":true},"seq":3}
17:29:48  1755797388.498198032 (stdio) queued (command=disconnect seq=3)
17:29:48  1755797388.510476112 (stdio) <-- {"body":{"category":"console","output":"Process 50129 exited with status = 9 (0x00000009) killed\n"},"event":"output","seq":0,"type":"event"}
17:29:48  1755797388.511360884 (stdio) <-- {"body":{"$__lldb_statistics":{"commands":"{\"settings clear\":1}","memory":"{\"strings\":{\"bytesTotal\":3145728,\"bytesUnused\":1511539,\"bytesUsed\":1634189}}","plugins":"{\"abi\":[{\"enabled\":true,\"name\":\"SysV-arm64\"},{\"enabled\":true,\"name\":\"ABIMacOSX_arm64\"},{\"enabled\":true,\"name\":\"SysV-arm\"},{\"enabled\":true,\"name\":\"macosx-arm\"},{\"enabled\":true,\"name\":\"abi.macosx-i386\"},{\"enabled\":true,\"name\":\"sysv-i386\"},{\"enabled\":true,\"name\":\"sysv-x86_64\"},{\"enabled\":true,\"name\":\"windows-x86_64\"}],\"architecture\":[{\"enabled\":true,\"name\":\"arm\"},{\"enabled\":true,\"name\":\"mips\"},{\"enabled\":true,\"name\":\"ppc64\"},{\"enabled\":true,\"name\":\"aarch64\"}],\"disassembler\":[{\"enabled\":true,\"name\":\"llvm-mc\"}],\"dynamic-loader\":[{\"enabled\":true,\"name\":\"darwin-kernel\"},{\"enabled\":true,\"name\":\"freebsd-kernel\"},{\"enabled\":true,\"name\":\"macosx-dyld\"},{\"enabled\":true,\"name\":\"macos-dyld\"},{\"enabled\":true,\"name\":\"posix-dyld\"},{\"enabled\":true,\"name\":\"static\"},{\"enabled\":true,\"name\":\"hexagon-dyld\"},{\"enabled\":true,\"name\":\"windows-dyld\"},{\"enabled\":true,\"name\":\"wasm-dyld\"}],\"emulate-instruction\":[{\"enabled\":true,\"name\":\"arm\"},{\"enabled\":true,\"name\":\"arm64\"},{\"enabled\":true,\"name\":\"LoongArch\"},{\"enabled\":true,\"name\":\"mips32\"},{\"enabled\":true,\"name\":\"mips64\"},{\"enabled\":true,\"name\":\"ppc64\"},{\"enabled\":true,\"name\":\"riscv\"}],\"instrumentation-runtime\":[{\"enabled\":true,\"name\":\"AddressSanitizer\"},{\"enabled\":true,\"name\":\"Libsanitizers-ASan\"},{\"enabled\":true,\"name\":\"MainThreadChecker\"},{\"enabled\":true,\"name\":\"ThreadSanitizer\"},{\"enabled\":true,\"name\":\"UndefinedBehaviorSanitizer\"}],\"jit-loader\":[{\"enabled\":true,\"name\":\"gdb\"}],\"language\":[{\"enabled\":true,\"name\":\"cplusplus\"},{\"enabled\":true,\"name\":\"objc\"},{\"enabled\":true,\"name\":\"objcplusplus\"}],\"language-runtime\":[{\"enabled\":true,\"name\":\"itanium\"},{\"enabled\":true,\"name\":\"apple-objc-v2\"},{\"enabled\":true,\"name\":\"apple-objc-v1\"},{\"enabled\":true,\"name\":\"gnustep-objc-libobjc2\"}],\"memory-history\":[{\"enabled\":true,\"name\":\"asan\"}],\"object-container\":[{\"enabled\":true,\"name\":\"bsd-archive\"},{\"enabled\":true,\"name\":\"mach-o\"},{\"enabled\":true,\"name\":\"mach-o-fileset\"}],\"object-file\":[{\"enabled\":true,\"name\":\"breakpad\"},{\"enabled\":true,\"name\":\"COFF\"},{\"enabled\":true,\"name\":\"elf\"},{\"enabled\":true,\"name\":\"JSON\"},{\"enabled\":true,\"name\":\"mach-o\"},{\"enabled\":true,\"name\":\"minidump\"},{\"enabled\":true,\"name\":\"pdb\"},{\"enabled\":true,\"name\":\"pe-coff\"},{\"enabled\":true,\"name\":\"xcoff\"},{\"enabled\":true,\"name\":\"wasm\"}],\"operating-system\":[{\"enabled\":true,\"name\":\"python\"}],\"platform\":[{\"enabled\":true,\"name\":\"remote-AIX\"},{\"enabled\":true,\"name\":\"remote-linux\"},{\"enabled\":true,\"name\":\"remote-android\"},{\"enabled\":true,\"name\":\"remote-freebsd\"},{\"enabled\":true,\"name\":\"remote-gdb-server\"},{\"enabled\":true,\"name\":\"darwin\"},{\"enabled\":true,\"name\":\"remote-ios\"},{\"enabled\":true,\"name\":\"remote-macosx\"},{\"enabled\":true,\"name\":\"ios-simulator\"},{\"enabled\":true,\"name\":\"tvos-simulator\"},{\"enabled\":true,\"name\":\"watchos-simulator\"},{\"enabled\":true,\"name\":\"xros-simulator\"},{\"enabled\":true,\"name\":\"darwin-kernel\"},{\"enabled\":true,\"name\":\"remote-tvos\"},{\"enabled\":true,\"name\":\"remote-watchos\"},{\"enabled\":true,\"name\":\"remote-bridgeos\"},{\"enabled\":true,\"name\":\"remote-xros\"},{\"enabled\":true,\"name\":\"host\"},{\"enabled\":true,\"name\":\"remote-netbsd\"},{\"enabled\":true,\"name\":\"remote-openbsd\"},{\"enabled\":true,\"name\":\"qemu-user\"},{\"enabled\":true,\"name\":\"remote-windows\"}],\"process\":[{\"enabled\":true,\"name\":\"kdp-remote\"},{\"enabled\":true,\"name\":\"ScriptedProcess\"},{\"enabled\":true,\"name\":\"elf-core\"},{\"enabled\":true,\"name\":\"mach-o-core\"},{\"enabled\":true,\"name\":\"minidump\"},{\"enabled\":true,\"name\":\"wasm\"},{\"enabled\":true,\"name\":\"gdb-remote\"}],\"register-type-builder\":[{\"enabled\":true,\"name\":\"register-types-clang\"}],\"repl\":[{\"enabled\":true,\"name\":\"ClangREPL\"}],\"script-interpreter\":[{\"enabled\":true,\"name\":\"script-none\"},{\"enabled\":true,\"name\":\"script-python\"}],\"scripted-interface\":[{\"enabled\":true,\"name\":\"OperatingSystemPythonInterface\"},{\"enabled\":true,\"name\":\"ScriptedPlatformPythonInterface\"},{\"enabled\":true,\"name\":\"ScriptedProcessPythonInterface\"},{\"enabled\":true,\"name\":\"ScriptedStopHookPythonInterface\"},{\"enabled\":true,\"name\":\"ScriptedBreakpointPythonInterface\"},{\"enabled\":true,\"name\":\"ScriptedThreadPlanPythonInterface\"}],\"structured-data\":[{\"enabled\":true,\"name\":\"darwin-log\"}],\"symbol-file\":[{\"enabled\":true,\"name\":\"breakpad\"},{\"enabled\":true,\"name\":\"CTF\"},{\"enabled\":true,\"name\":\"dwarf\"},{\"enabled\":true,\"name\":\"dwarf-debugmap\"},{\"enabled\":true,\"name\":\"JSON\"},{\"enabled\":true,\"name\":\"native-pdb\"},{\"enabled\":true,\"name\":\"pdb\"},{\"enabled\":true,\"name\":\"symtab\"}],\"symbol-locator\":[{\"enabled\":true,\"name\":\"debuginfod\"},{\"enabled\":true,\"name\":\"Default\"},{\"enabled\":true,\"name\":\"DebugSymbols\"}],\"symbol-vendor\":[{\"enabled\":true,\"name\":\"ELF\"},{\"enabled\":true,\"name\":\"macosx\"},{\"enabled\":true,\"name\":\"PE-COFF\"},{\"enabled\":true,\"name\":\"WASM\"}],\"system-runtime\":[{\"enabled\":true,\"name\":\"systemruntime-macosx\"}],\"trace-exporter\":[{\"enabled\":true,\"name\":\"ctf\"}],\"type-system\":[{\"enabled\":true,\"name\":\"clang\"}],\"unwind-assembly\":[{\"enabled\":true,\"name\":\"inst-emulation\"},{\"enabled\":true,\"name\":\"x86\"}]}","targets":"[{\"breakpoints\":[{\"details\":{\"Breakpoint\":{\"BKPTOptions\":{\"AutoContinue\":false,\"ConditionText\":\"\",\"EnabledState\":true,\"IgnoreCount\":0,\"OneShotState\":false},\"BKPTResolver\":{\"Options\":{\"NameMask\":[4],\"Offset\":0,\"SkipPrologue\":false,\"SymbolNames\":[\"lldb_image_notifier\"]},\"Type\":\"SymbolName\"},\"Hardware\":false,\"SearchFilter\":{\"Options\":{\"ModuleList\":[\"/usr/lib/dyld\"]},\"Type\":\"Modules\"}}},\"hitCount\":0,\"id\":-1,\"internal\":true,\"kindDescription\":\"shared-library-event\",\"numLocations\":1,\"numResolvedLocations\":1,\"resolveTime\":6.8999999999999997e-05}],\"dyldPluginName\":\"macos-dyld\",\"expressionEvaluation\":{\"failures\":0,\"successes\":0},\"firstStopTime\":1.035927292,\"frameVariable\":{\"failures\":0,\"successes\":0},\"launchOrAttachTime\":1.033975334,\"moduleIdentifiers\":[5694392520,5157961880],\"signals\":[{\"SIGSTOP\":1}],\"sourceMapDeduceCount\":0,\"sourceRealpathAttemptCount\":0,\"sourceRealpathCompatibleCount\":0,\"stopCount\":2,\"summaryProviderStatistics\":[],\"targetCreateTime\":0.027956999999999999,\"totalBreakpointResolveTime\":6.8999999999999997e-05,\"totalSharedLibraryEventHitCount\":0}]","totalDebugInfoByteSize":1248,"totalDebugInfoEnabled":1,"totalDebugInfoIndexLoadedFromCache":0,"totalDebugInfoIndexSavedToCache":0,"totalDebugInfoIndexTime":0,"totalDebugInfoParseTime":1.2e-05,"totalDwoFileCount":0,"totalLoadedDwoFileCount":0,"totalModuleCount":2,"totalModuleCountHasDebugInfo":1,"totalModuleCountWithIncompleteTypes":0,"totalModuleCountWithVariableErrors":0,"totalSymbolLocatorTime":"{\"DebugSymbols\":8.4999999999999993e-05,\"Default\":0.00013300000000000001,\"debuginfod\":0}","totalSymbolTableIndexTime":0.0011609999999999999,"totalSymbolTableParseTime":0.0011870000000000001,"totalSymbolTableStripped":0,"totalSymbolTableSymbolCount":3562,"totalSymbolTablesLoaded":2,"totalSymbolTablesLoadedFromCache":0,"totalSymbolTablesSavedToCache":0}},"event":"terminated","seq":0,"type":"event"}
17:29:48  1755797388.511468887 (stdio) <-- {"command":"disconnect","request_seq":3,"seq":0,"success":true,"type":"response"}
17:29:48  1755797388.511492968 (stdio) <-- {"body":{"exitCode":9},"event":"exited","seq":0,"type":"event"}
17:29:48  
17:29:48  ========= END =========
17:29:48  FAIL: LLDB (/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/bin/clang-arm64) :: test_moduleSymbols (TestDAP_moduleSymbols.TestDAP_moduleSymbols)
17:29:48  Restore dir to: /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/tools/lldb/test
17:29:48  ======================================================================
17:29:48  ERROR: test_moduleSymbols (TestDAP_moduleSymbols.TestDAP_moduleSymbols)
17:29:48     Test that the moduleSymbols request returns correct symbols from the module.
17:29:48  ----------------------------------------------------------------------
17:29:48  Traceback (most recent call last):
17:29:48    File "/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/test/API/tools/lldb-dap/moduleSymbols/TestDAP_moduleSymbols.py", line 19, in test_moduleSymbols
17:29:48      next_symbol = self.dap_server.request_moduleSymbols(
17:29:48    File "/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/tools/lldb-dap/dap_server.py", line 1319, in request_moduleSymbols
17:29:48      return self.send_recv(command_dict)
17:29:48  AttributeError: 'DebugAdapterServer' object has no attribute 'send_recv'
17:29:48  Config=arm64-/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/bin/clang
17:29:48  ----------------------------------------------------------------------
17:29:48  Ran 1 test in 1.497s
17:29:48  
17:29:48  FAILED (errors=1)

ashgti added a commit to ashgti/llvm-project that referenced this pull request Aug 21, 2025
ashgti added a commit that referenced this pull request Aug 21, 2025
#154832)

This reverts commit 0f33b90 and
includes a fix for the added test that was submitted between my last
update and pull.
JDevlieghere pushed a commit to swiftlang/llvm-project that referenced this pull request Oct 10, 2025
Originally commited in 362b9d7 and then
reverted in cb63b75.

This re-lands a subset of the changes to
dap_server.py/DebugCommunication and addresses the python3.10
compatibility issue.

This includes less type annotations since those were the reason for the
failures on that specific version of python.

I've done additional testing on python3.8, python3.10 and python3.13 to
further validate these changes.

(cherry picked from commit 13eca52)
JDevlieghere pushed a commit to swiftlang/llvm-project that referenced this pull request Oct 10, 2025
…)"

This reverts commit 13eca52.

This change broke greendragon lldb test:

lldb-api.tools/lldb-dap/moduleSymbols.TestDAP_moduleSymbols.py

(cherry picked from commit 0f33b90)
JDevlieghere pushed a commit to swiftlang/llvm-project that referenced this pull request Oct 10, 2025
)" (llvm#154832)

This reverts commit 0f33b90 and
includes a fix for the added test that was submitted between my last
update and pull.

(cherry picked from commit 36d07ad)
JDevlieghere pushed a commit to swiftlang/llvm-project that referenced this pull request Oct 13, 2025
Originally commited in 362b9d7 and then
reverted in cb63b75.

This re-lands a subset of the changes to
dap_server.py/DebugCommunication and addresses the python3.10
compatibility issue.

This includes less type annotations since those were the reason for the
failures on that specific version of python.

I've done additional testing on python3.8, python3.10 and python3.13 to
further validate these changes.

(cherry picked from commit 13eca52)
JDevlieghere pushed a commit to swiftlang/llvm-project that referenced this pull request Oct 13, 2025
…)"

This reverts commit 13eca52.

This change broke greendragon lldb test:

lldb-api.tools/lldb-dap/moduleSymbols.TestDAP_moduleSymbols.py

(cherry picked from commit 0f33b90)
JDevlieghere pushed a commit to swiftlang/llvm-project that referenced this pull request Oct 13, 2025
)" (llvm#154832)

This reverts commit 0f33b90 and
includes a fix for the added test that was submitted between my last
update and pull.

(cherry picked from commit 36d07ad)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants