[Lldb-commits] [lldb] [lldb] Fix breakpoint resolver serialization bug (PR #76766)

via lldb-commits lldb-commits at lists.llvm.org
Tue Jan 2 15:52:42 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Alex Langford (bulbazord)

<details>
<summary>Changes</summary>

BreakpointResolverAddress optionally can include the module name related to the address that gets resolved. Currently this will never work because it sets the name to itself (which is empty).

---
Full diff: https://github.com/llvm/llvm-project/pull/76766.diff


1 Files Affected:

- (modified) lldb/source/Breakpoint/BreakpointResolverAddress.cpp (+3-7) 


``````````diff
diff --git a/lldb/source/Breakpoint/BreakpointResolverAddress.cpp b/lldb/source/Breakpoint/BreakpointResolverAddress.cpp
index a0c628a8e299ce..dcdcea101045f7 100644
--- a/lldb/source/Breakpoint/BreakpointResolverAddress.cpp
+++ b/lldb/source/Breakpoint/BreakpointResolverAddress.cpp
@@ -65,13 +65,9 @@ BreakpointResolverAddress::SerializeToStructuredData() {
       new StructuredData::Dictionary());
   SectionSP section_sp = m_addr.GetSection();
   if (section_sp) {
-    ModuleSP module_sp = section_sp->GetModule();
-    ConstString module_name;
-    if (module_sp)
-      module_name.SetCString(module_name.GetCString());
-
-    options_dict_sp->AddStringItem(GetKey(OptionNames::ModuleName),
-                                   module_name.GetCString());
+    if (ModuleSP module_sp = section_sp->GetModule())
+      options_dict_sp->AddStringItem(GetKey(OptionNames::ModuleName),
+                                     module_sp->GetObjectName().GetCString());
     options_dict_sp->AddIntegerItem(GetKey(OptionNames::AddressOffset),
                                     m_addr.GetOffset());
   } else {

``````````

</details>


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


More information about the lldb-commits mailing list