[Lldb-commits] [lldb] 16a1e05 - [lldb] Support building test inferiors without debug info (#197002)

via lldb-commits lldb-commits at lists.llvm.org
Wed May 13 17:48:12 PDT 2026


Author: Jonas Devlieghere
Date: 2026-05-13T17:48:08-07:00
New Revision: 16a1e05c02778a7b094a8c5343f13003b2e64851

URL: https://github.com/llvm/llvm-project/commit/16a1e05c02778a7b094a8c5343f13003b2e64851
DIFF: https://github.com/llvm/llvm-project/commit/16a1e05c02778a7b094a8c5343f13003b2e64851.diff

LOG: [lldb] Support building test inferiors without debug info (#197002)

Add first class support for building test inferiors without debug info,
instead of having to pass `-g0` in the Makefile or the build dictionary.

```
def test(self):
    self.build(debug_info="none")
```

rdar://164923931

Added: 
    

Modified: 
    lldb/packages/Python/lldbsuite/test/builders/builder.py
    lldb/packages/Python/lldbsuite/test/make/Makefile.rules
    lldb/test/API/commands/frame/var-dil/basics/NoDebugInfo/Makefile
    lldb/test/API/commands/frame/var-dil/basics/NoDebugInfo/TestFrameVarDILNoDebugInfo.py
    lldb/test/API/lang/objcxx/objc-from-cpp-frames-without-debuginfo/Makefile
    lldb/test/API/lang/objcxx/objc-from-cpp-frames-without-debuginfo/TestObjCFromCppFramesWithoutDebugInfo.py

Removed: 
    


################################################################################
diff  --git a/lldb/packages/Python/lldbsuite/test/builders/builder.py b/lldb/packages/Python/lldbsuite/test/builders/builder.py
index 03c1af579b018..40db227607ee5 100644
--- a/lldb/packages/Python/lldbsuite/test/builders/builder.py
+++ b/lldb/packages/Python/lldbsuite/test/builders/builder.py
@@ -259,6 +259,7 @@ def _getDebugInfoArgs(self, debug_info):
             "debug_names": {"MAKE_DEBUG_NAMES": "YES"},
             "dwp": {"MAKE_DSYM": "NO", "MAKE_DWP": "YES"},
             "pdb": {"MAKE_PDB": "YES"},
+            "none": {"MAKE_DSYM": "NO", "MAKE_NO_DEBUG_INFO": "YES"},
         }
 
         # Collect all flags, with later options overriding earlier ones

diff  --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
index 677124b8738f7..a3c5d94a570d1 100644
--- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
+++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
@@ -240,6 +240,10 @@ ifeq "$(OS)" "Windows_NT"
 	DEBUG_INFO_FLAG ?= -gdwarf
 endif
 
+ifeq "$(MAKE_NO_DEBUG_INFO)" "YES"
+	DEBUG_INFO_FLAG := -g0
+endif
+
 DEBUG_INFO_FLAG ?= -g
 
 CFLAGS ?= $(DEBUG_INFO_FLAG) -O0

diff  --git a/lldb/test/API/commands/frame/var-dil/basics/NoDebugInfo/Makefile b/lldb/test/API/commands/frame/var-dil/basics/NoDebugInfo/Makefile
index df9f4a7b518c7..99998b20bcb05 100644
--- a/lldb/test/API/commands/frame/var-dil/basics/NoDebugInfo/Makefile
+++ b/lldb/test/API/commands/frame/var-dil/basics/NoDebugInfo/Makefile
@@ -1,4 +1,3 @@
 CXX_SOURCES := main.cpp
-CFLAGS_EXTRAS := -g0
 
 include Makefile.rules

diff  --git a/lldb/test/API/commands/frame/var-dil/basics/NoDebugInfo/TestFrameVarDILNoDebugInfo.py b/lldb/test/API/commands/frame/var-dil/basics/NoDebugInfo/TestFrameVarDILNoDebugInfo.py
index defea39826267..10dbd3a6953f2 100644
--- a/lldb/test/API/commands/frame/var-dil/basics/NoDebugInfo/TestFrameVarDILNoDebugInfo.py
+++ b/lldb/test/API/commands/frame/var-dil/basics/NoDebugInfo/TestFrameVarDILNoDebugInfo.py
@@ -10,9 +10,10 @@
 
 class TestFrameVarDILNoDebugInfo(TestBase):
     NO_DEBUG_INFO_TESTCASE = True
+    SHARED_BUILD_TESTCASE = False
 
     def test_no_debug_info(self):
-        self.build()
+        self.build(debug_info="none")
         lldbutil.run_to_name_breakpoint(self, "main")
 
         self.runCmd("settings set target.experimental.use-DIL true")

diff  --git a/lldb/test/API/lang/objcxx/objc-from-cpp-frames-without-debuginfo/Makefile b/lldb/test/API/lang/objcxx/objc-from-cpp-frames-without-debuginfo/Makefile
index 7c3c32d6f82df..99998b20bcb05 100644
--- a/lldb/test/API/lang/objcxx/objc-from-cpp-frames-without-debuginfo/Makefile
+++ b/lldb/test/API/lang/objcxx/objc-from-cpp-frames-without-debuginfo/Makefile
@@ -1,4 +1,3 @@
 CXX_SOURCES := main.cpp
-CXXFLAGS_EXTRAS := -g0
 
 include Makefile.rules

diff  --git a/lldb/test/API/lang/objcxx/objc-from-cpp-frames-without-debuginfo/TestObjCFromCppFramesWithoutDebugInfo.py b/lldb/test/API/lang/objcxx/objc-from-cpp-frames-without-debuginfo/TestObjCFromCppFramesWithoutDebugInfo.py
index 497c0dd128f48..ddc7498a72e8d 100644
--- a/lldb/test/API/lang/objcxx/objc-from-cpp-frames-without-debuginfo/TestObjCFromCppFramesWithoutDebugInfo.py
+++ b/lldb/test/API/lang/objcxx/objc-from-cpp-frames-without-debuginfo/TestObjCFromCppFramesWithoutDebugInfo.py
@@ -10,8 +10,11 @@
 
 
 class TestObjCFromCppFramesWithoutDebugInfo(TestBase):
+    NO_DEBUG_INFO_TESTCASE = True
+    SHARED_BUILD_TESTCASE = False
+
     def test(self):
-        self.build()
+        self.build(debug_info="none")
         (_, process, _, _) = lldbutil.run_to_name_breakpoint(self, "main")
 
         self.assertState(process.GetState(), lldb.eStateStopped)


        


More information about the lldb-commits mailing list