[Lldb-commits] [lldb] [lldb][Expression] Encode Module and DIE UIDs into function AsmLabels (PR #148877)

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 24 06:37:48 PDT 2025


================
@@ -249,6 +250,28 @@ static unsigned GetCXXMethodCVQuals(const DWARFDIE &subprogram,
   return cv_quals;
 }
 
+static std::optional<std::string> MakeLLDBFuncAsmLabel(const DWARFDIE &die) {
+  char const *name = die.GetMangledName(/*substitute_name_allowed*/ false);
+  if (!name)
+    return std::nullopt;
+
+  auto module_sp = die.GetModule();
+  if (!module_sp)
+    return std::nullopt;
+
+  lldb::user_id_t module_id = module_sp->GetID();
+  if (module_id == LLDB_INVALID_UID)
+    return std::nullopt;
+
+  const auto die_id = die.GetID();
+  if (die_id == LLDB_INVALID_UID)
+    return std::nullopt;
+
+  return llvm::formatv("{0}:{1}:{2:x}:{3:x}", FunctionCallLabelPrefix, name,
----------------
labath wrote:

This should at least be in the same plugin (ideally, in the same file) as the code that parses it.

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


More information about the lldb-commits mailing list