github-actions[bot] wrote: <!--LLVM CODE FORMAT COMMENT: {darker}-->
:warning: Python code formatter, darker found issues in your code. :warning: <details> <summary> You can test this locally with the following command: </summary> ``````````bash darker --check --diff -r HEAD~1...HEAD lldb/packages/Python/lldbsuite/test/builders/builder.py lldb/test/API/commands/statistics/basic/TestStats.py `````````` </details> <details> <summary> View the diff from darker here. </summary> ``````````diff --- packages/Python/lldbsuite/test/builders/builder.py 2025-06-24 19:00:30.000000 +0000 +++ packages/Python/lldbsuite/test/builders/builder.py 2025-06-24 19:12:04.415972 +0000 @@ -245,28 +245,28 @@ return ["LLDB_OBJ_ROOT={}".format(configuration.lldb_obj_root)] def _getDebugInfoArgs(self, debug_info): if debug_info is None: return [] - + 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 + return None # Invalid options flags.update(option_flags[option]) - + return [f"{key}={value}" for key, value in flags.items()] def getBuildCommand( self, debug_info, --- test/API/commands/statistics/basic/TestStats.py 2025-06-24 19:00:30.000000 +0000 +++ test/API/commands/statistics/basic/TestStats.py 2025-06-24 19:12:04.724587 +0000 @@ -538,35 +538,35 @@ exe = self.getBuildArtifact("a.out") target = self.createTestTarget(file_path=exe) debug_stats = self.get_stats() self.assertIn("totalDwoFileCount", debug_stats) self.assertIn("totalLoadedDwoFileCount", debug_stats) - + # Verify that the dwo file count is zero self.assertEqual(debug_stats["totalDwoFileCount"], 0) self.assertEqual(debug_stats["totalLoadedDwoFileCount"], 0) - + @add_test_categories(["dwo"]) def test_no_debug_names_eager_loads_dwo_files(self): """ Test the eager loading behavior of DWO files when debug_names is absent by building a split-dwarf binary without debug_names and then running "statistics dump". DWO file loading behavior: - With debug_names: DebugNamesDWARFIndex allows for lazy loading. DWO files are loaded on-demand when symbols are actually looked up - Without debug_names: ManualDWARFIndex uses eager loading. - All DWO files are loaded upfront during the first symbol lookup to build a manual index. + All DWO files are loaded upfront during the first symbol lookup to build a manual index. """ da = {"CXX_SOURCES": "third.cpp baz.cpp", "EXE": self.getBuildArtifact("a.out")} self.build(dictionary=da, debug_info=["dwo"]) self.addTearDownCleanup(dictionary=da) exe = self.getBuildArtifact("a.out") target = self.createTestTarget(file_path=exe) debug_stats = self.get_stats() self.assertIn("totalDwoFileCount", debug_stats) self.assertIn("totalLoadedDwoFileCount", debug_stats) - + # Verify that all DWO files are loaded self.assertEqual(debug_stats["totalDwoFileCount"], 2) self.assertEqual(debug_stats["totalLoadedDwoFileCount"], 2) @add_test_categories(["dwo"]) @@ -592,44 +592,44 @@ self.assertEqual(len(debug_stats["modules"]), 1) self.assertIn("totalLoadedDwoFileCount", debug_stats) self.assertIn("totalDwoFileCount", debug_stats) self.assertEqual(debug_stats["totalLoadedDwoFileCount"], 0) self.assertEqual(debug_stats["totalDwoFileCount"], 2) - + # Since there's only one module, module stats should have the same counts as total counts self.assertIn("dwoFileCount", debug_stats["modules"][0]) self.assertIn("loadedDwoFileCount", debug_stats["modules"][0]) self.assertEqual(debug_stats["modules"][0]["loadedDwoFileCount"], 0) self.assertEqual(debug_stats["modules"][0]["dwoFileCount"], 2) - + # 2) Setting breakpoint in main triggers loading of third.dwo (contains main function) self.runCmd("b main") debug_stats = self.get_stats() self.assertEqual(debug_stats["totalLoadedDwoFileCount"], 1) self.assertEqual(debug_stats["totalDwoFileCount"], 2) self.assertEqual(debug_stats["modules"][0]["loadedDwoFileCount"], 1) self.assertEqual(debug_stats["modules"][0]["dwoFileCount"], 2) - + # 3) Type lookup forces loading of baz.dwo (contains struct Baz definition) self.runCmd("type lookup Baz") debug_stats = self.get_stats() self.assertEqual(debug_stats["totalLoadedDwoFileCount"], 2) self.assertEqual(debug_stats["totalDwoFileCount"], 2) self.assertEqual(debug_stats["modules"][0]["loadedDwoFileCount"], 2) self.assertEqual(debug_stats["modules"][0]["dwoFileCount"], 2) - + @add_test_categories(["dwo"]) def test_dwp_dwo_file_count(self): """ Test "statistics dump" and the loaded dwo file count. Builds a binary w/ a separate .dwp file and debug_names, and then verifies the loaded dwo file count is the expected count after running various commands. - We expect the DWO file counters to reflect the number of compile units + We expect the DWO file counters to reflect the number of compile units loaded from the DWP file (each representing what was originally a separate DWO file) """ da = {"CXX_SOURCES": "third.cpp baz.cpp", "EXE": self.getBuildArtifact("a.out")} self.build(dictionary=da, debug_info=["dwp", "debug_names"]) self.addTearDownCleanup(dictionary=da) @@ -640,23 +640,22 @@ # Initially: 2 DWO files available but none loaded yet self.assertIn("totalLoadedDwoFileCount", debug_stats) self.assertIn("totalDwoFileCount", debug_stats) self.assertEqual(debug_stats["totalLoadedDwoFileCount"], 0) self.assertEqual(debug_stats["totalDwoFileCount"], 2) - + # Setting breakpoint in main triggers parsing of the CU within a.dwp corresponding to third.dwo (contains main function) self.runCmd("b main") debug_stats = self.get_stats() self.assertEqual(debug_stats["totalLoadedDwoFileCount"], 1) self.assertEqual(debug_stats["totalDwoFileCount"], 2) - + # Type lookup forces parsing of the CU within a.dwp corresponding to baz.dwo (contains struct Baz definition) self.runCmd("type lookup Baz") debug_stats = self.get_stats() self.assertEqual(debug_stats["totalDwoFileCount"], 2) self.assertEqual(debug_stats["totalLoadedDwoFileCount"], 2) - @skipUnlessDarwin @no_debug_info_test def test_dsym_binary_has_symfile_in_stats(self): """ `````````` </details> https://github.com/llvm/llvm-project/pull/145572 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits