aboutsummaryrefslogtreecommitdiff
path: root/lldb/packages/Python/lldbsuite/test
diff options
context:
space:
mode:
authorqxy11 <qxy11@meta.com>2025-06-24 15:25:23 -0700
committerGitHub <noreply@github.com>2025-06-24 15:25:23 -0700
commit9e3bb5bb91ced634585aa3b31366537152cc98f5 (patch)
tree68e6f9dd6f7154ee4bfd499fef0fab301460d2db /lldb/packages/Python/lldbsuite/test
parent46d33b6102f2266405123cf497d037f2e6b9a08c (diff)
downloadllvm-9e3bb5bb91ced634585aa3b31366537152cc98f5.zip
llvm-9e3bb5bb91ced634585aa3b31366537152cc98f5.tar.gz
llvm-9e3bb5bb91ced634585aa3b31366537152cc98f5.tar.bz2
Reland "[lldb] Add count for number of DWO files loaded in statistics #144424" (#145572)
This relands changes in #144424 for adding a count of DWO files parsed/loaded and the total number of DWO files. The previous PR was reverted in #145494 due to the newly added unit tests failing on Windows and MacOS CIs since these platforms don't support DWO. This change add an additional `@add_test_categories(["dwo"])` to the new tests to [skip](https://github.com/llvm/llvm-project/blob/cd46354dbd10820158edabe14dbd49d9f9010722/lldb/packages/Python/lldbsuite/test/test_categories.py#L56) these tests on Windows/MacOS. Original PR: #144424 ### Testing Ran unit tests ``` $ bin/lldb-dotest -p TestStats.py llvm-project/lldb/test/API/commands/statistics/basic/ ---------------------------------------------------------------------- Ran 24 tests in 211.391s OK (skipped=3) ```
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r--lldb/packages/Python/lldbsuite/test/builders/builder.py26
-rw-r--r--lldb/packages/Python/lldbsuite/test/make/Makefile.rules4
2 files changed, 23 insertions, 7 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/builders/builder.py b/lldb/packages/Python/lldbsuite/test/builders/builder.py
index de05732..ada6f9f 100644
--- a/lldb/packages/Python/lldbsuite/test/builders/builder.py
+++ b/lldb/packages/Python/lldbsuite/test/builders/builder.py
@@ -247,13 +247,25 @@ class Builder:
def _getDebugInfoArgs(self, debug_info):
if debug_info is None:
return []
- if debug_info == "dwarf":
- return ["MAKE_DSYM=NO"]
- if debug_info == "dwo":
- return ["MAKE_DSYM=NO", "MAKE_DWO=YES"]
- if debug_info == "gmodules":
- return ["MAKE_DSYM=NO", "MAKE_GMODULES=YES"]
- return None
+
+ debug_options = debug_info if isinstance(debug_info, list) else [debug_info]
+ option_flags = {
+ "dwarf": {"MAKE_DSYM": "NO"},
+ "dwo": {"MAKE_DSYM": "NO", "MAKE_DWO": "YES"},
+ "gmodules": {"MAKE_DSYM": "NO", "MAKE_GMODULES": "YES"},
+ "debug_names": {"MAKE_DEBUG_NAMES": "YES"},
+ "dwp": {"MAKE_DSYM": "NO", "MAKE_DWP": "YES"},
+ }
+
+ # Collect all flags, with later options overriding earlier ones
+ flags = {}
+
+ for option in debug_options:
+ if not option or option not in option_flags:
+ return None # Invalid options
+ flags.update(option_flags[option])
+
+ return [f"{key}={value}" for key, value in flags.items()]
def getBuildCommand(
self,
diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
index 06959f2..58833e1 100644
--- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
+++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
@@ -276,6 +276,10 @@ ifeq "$(MAKE_DWO)" "YES"
CFLAGS += -gsplit-dwarf
endif
+ifeq "$(MAKE_DEBUG_NAMES)" "YES"
+ CFLAGS += -gpubnames
+endif
+
ifeq "$(USE_PRIVATE_MODULE_CACHE)" "YES"
THE_CLANG_MODULE_CACHE_DIR := $(BUILDDIR)/private-module-cache
else