[Lldb-commits] [lldb] [lldb][NativePDB] Parse global variables. (PR #114303)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 31 13:08:20 PDT 2024


================
@@ -1810,7 +1813,27 @@ SymbolFileNativePDB::ParseVariablesForCompileUnit(CompileUnit &comp_unit,
                                                   VariableList &variables) {
   PdbSymUid sym_uid(comp_unit.GetID());
   lldbassert(sym_uid.kind() == PdbSymUidKind::Compiland);
-  return 0;
+  for (const uint32_t gid : m_index->globals().getGlobalsTable()) {
+    PdbGlobalSymId global{gid, false};
+    CVSymbol sym = m_index->ReadSymbolRecord(global);
+    // TODO: Handle S_CONSTANT which might be a record type (e.g.
+    // std::strong_ordering::equal). Currently
+    // lldb_private::npdb::MakeConstantLocationExpression doesn't handle this
+    // case and will crash if we do create global variables from it.
----------------
JDevlieghere wrote:

Like Pavel I understood the comment as if we'd still crash. Maybe update the wording to make it explicit that that's the reason we don't handle it here. 

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


More information about the lldb-commits mailing list