[Lldb-commits] [lldb] [lldb][Commands] Show symbol change bit in SB API (PR #66144)

Chelsea Cassanova via lldb-commits lldb-commits at lists.llvm.org
Thu Sep 14 13:25:07 PDT 2023


================
@@ -57,6 +57,29 @@ def test_add_dsym_with_dSYM_bundle(self):
         self.exe_name = "a.out"
         self.do_add_dsym_with_dSYM_bundle(self.exe_name)
 
+    @no_debug_info_test
+    def test_report_symbol_load(self):
+        """Test that when adding a symbol file, the eBroadcastBitSymbolsLoaded event gets broadcasted."""
+        self.generate_main_cpp(version=1)
+        self.build(debug_info="dsym")
+
+        listener = lldb.SBListener("listener")
+        listener.StartListeningForEventClass(
+            self.dbg,
+            lldb.SBTarget.GetBroadcasterClassName(),
+            lldb.SBTarget.eBroadcastBitSymbolsLoaded,
+        )
+
+        # Add the dSYM
+        self.do_add_dsym_with_success(self.exe_name)
+
+        # Get the next event
+        event = lldb.SBEvent()
+        listener.WaitForEvent(1, event)
+
+        # Check that the event is valid
+        self.assertTrue(event.IsValid(), "Got a valid eBroadcastBitSymbolsLoaded event.")
----------------
chelcassanova wrote:

We can get the SBModules from the event using `SBTarget::GetModuleAtIndexFromEvent` and `SBTarget::GetNumModulesFromEvent`, unfortunately there's no way to get an SBModuleSpec from an SBModule.

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


More information about the lldb-commits mailing list