[Lldb-commits] [lldb] [LLDB] Reapply #100443 SBSaveCore Thread list (PR #104497)

via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 15 13:19:26 PDT 2024


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 2ef553c05ffe274d6910e3d11f52ed6417cc5061...c22b85a11ccb024b3f56112fad3e8d96ed7be041 lldb/test/API/functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump.py lldb/test/API/python_api/sbsavecoreoptions/TestSBSaveCoreOptions.py
``````````

</details>

<details>
<summary>
View the diff from darker here.
</summary>

``````````diff
--- functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump.py	2024-08-05 20:32:40.000000 +0000
+++ functionalities/process_save_core_minidump/TestProcessSaveCoreMinidump.py	2024-08-15 20:18:58.844477 +0000
@@ -281,22 +281,27 @@
                 thread = process.GetThreadAtIndex(thread_idx)
                 thread_id = thread.GetThreadID()
                 expected_threads.append(thread_id)
                 stacks_to_sp_map[thread_id] = thread.GetFrameAtIndex(0).GetSP()
 
-
             # This is almost identical to the single thread test case because
             # minidump defaults to stacks only, so we want to see if the
             # default options work as expected.
             options = lldb.SBSaveCoreOptions()
             default_value_spec = lldb.SBFileSpec(default_value_file)
             options.SetOutputFile(default_value_spec)
             options.SetPluginName("minidump")
             error = process.SaveCore(options)
             self.assertTrue(error.Success())
 
-            self.verify_core_file(default_value_file, expected_pid, expected_modules, expected_threads, stacks_to_sp_map)
+            self.verify_core_file(
+                default_value_file,
+                expected_pid,
+                expected_modules,
+                expected_threads,
+                stacks_to_sp_map,
+            )
 
         finally:
             self.assertTrue(self.dbg.DeleteTarget(target))
             if os.path.isfile(default_value_file):
                 os.unlink(default_value_file)
--- python_api/sbsavecoreoptions/TestSBSaveCoreOptions.py	2024-08-05 20:32:15.000000 +0000
+++ python_api/sbsavecoreoptions/TestSBSaveCoreOptions.py	2024-08-15 20:18:58.902293 +0000
@@ -8,13 +8,15 @@
     basic_minidump = "basic_minidump.yaml"
     basic_minidump_different_pid = "basic_minidump_different_pid.yaml"
 
     def get_process_from_yaml(self, yaml_file):
         minidump_path = self.getBuildArtifact(os.path.basename(yaml_file) + ".dmp")
-        print ("minidump_path: " + minidump_path)
+        print("minidump_path: " + minidump_path)
         self.yaml2obj(yaml_file, minidump_path)
-        self.assertTrue(os.path.exists(minidump_path), "yaml2obj did not emit a minidump file")
+        self.assertTrue(
+            os.path.exists(minidump_path), "yaml2obj did not emit a minidump file"
+        )
         target = self.dbg.CreateTarget(None)
         process = target.LoadCore(minidump_path)
         self.assertTrue(process.IsValid(), "Process is not valid")
         return process
 
@@ -57,11 +59,10 @@
         removed_success = options.RemoveThread(thread)
         self.assertTrue(removed_success)
         removed_success = options.RemoveThread(thread)
         self.assertFalse(removed_success)
 
-
     def test_adding_thread_different_process(self):
         """Test adding and removing a thread from save core options."""
         options = lldb.SBSaveCoreOptions()
         process = self.get_basic_process()
         process_2 = self.get_basic_process_different_pid()

``````````

</details>


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


More information about the lldb-commits mailing list