[Lldb-commits] [lldb] [lldb-dap] Migrate core file test (PR #217403)

Yao Qi via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 20 02:02:04 PDT 2026


================
@@ -2,197 +2,184 @@
 Test lldb-dap coreFile attaching
 """
 
-import dap_server
 from lldbsuite.test.decorators import *
-from lldbsuite.test.lldbtest import *
-from lldbsuite.test import lldbutil
-import lldbdap_testcase
-import os
+from lldbsuite.test.tools.lldb_dap import DAPTestCaseBase
+from lldbsuite.test.tools.lldb_dap.types import (
+    AttachArgs,
+    ContinueArgs,
+    NextArgs,
+    Source,
+    StackFrame,
+)
 
 # The expected backtrace when loading the bundled linux-x86_64.core. Shared by
 # the tests that load this core through different mechanisms (the "coreFile"
 # attach key and "attachCommands") so we can assert they behave identically.
 EXPECTED_CORE_FRAMES = [
-    {
-        "column": 0,
-        "id": 524288,
-        "line": 4,
-        "moduleId": "01DF54A6-045E-657D-3F8F-FB9CE1118789-14F8BD6D",
-        "name": "bar",
-        "source": {
-            "name": "main.c",
-            "path": "/home/labath/test/main.c",
-            "presentationHint": "deemphasize",
-        },
-        "instructionPointerReference": "0x40011C",
-    },
-    {
-        "column": 0,
-        "id": 524289,
-        "line": 10,
-        "moduleId": "01DF54A6-045E-657D-3F8F-FB9CE1118789-14F8BD6D",
-        "name": "foo",
-        "source": {
-            "name": "main.c",
-            "path": "/home/labath/test/main.c",
-            "presentationHint": "deemphasize",
-        },
-        "instructionPointerReference": "0x400142",
-    },
-    {
-        "column": 0,
-        "id": 524290,
-        "line": 16,
-        "moduleId": "01DF54A6-045E-657D-3F8F-FB9CE1118789-14F8BD6D",
-        "name": "_start",
-        "source": {
-            "name": "main.c",
-            "path": "/home/labath/test/main.c",
-            "presentationHint": "deemphasize",
-        },
-        "instructionPointerReference": "0x40015F",
-    },
+    StackFrame(
+        column=0,
+        id=524288,
+        line=4,
+        moduleId="01DF54A6-045E-657D-3F8F-FB9CE1118789-14F8BD6D",
+        name="bar",
+        source=Source(
+            name="main.c",
+            path="/home/labath/test/main.c",
+            presentationHint="deemphasize",
+        ),
+        instructionPointerReference="0x40011C",
+    ),
+    StackFrame(
+        column=0,
+        id=524289,
+        line=10,
+        moduleId="01DF54A6-045E-657D-3F8F-FB9CE1118789-14F8BD6D",
+        name="foo",
+        source=Source(
+            name="main.c",
+            path="/home/labath/test/main.c",
+            presentationHint="deemphasize",
+        ),
+        instructionPointerReference="0x400142",
+    ),
+    StackFrame(
+        column=0,
+        id=524290,
+        line=16,
+        moduleId="01DF54A6-045E-657D-3F8F-FB9CE1118789-14F8BD6D",
+        name="_start",
+        source=Source(
+            name="main.c",
+            path="/home/labath/test/main.c",
+            presentationHint="deemphasize",
+        ),
+        instructionPointerReference="0x40015F",
+    ),
 ]
 
 
-class TestDAP_coreFile(lldbdap_testcase.DAPTestCaseBase):
-    @skipIfLLVMTargetMissing("X86")
+ at skipIfLLVMTargetMissing("X86")
----------------
qiyao wrote:

the `@skipIfLLVMTargetMissing("X86")` decorator was moved from per-method to class level, which now also applies it to `test_wrong_core_file` (previously undecorated).  Is it intentional?

https://github.com/llvm/llvm-project/pull/217403


More information about the lldb-commits mailing list