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

Zequan Wu via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 31 10:46:05 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.
----------------
ZequanWu wrote:

Just what I did: not handling the S_CONSTANT case prevents the call to `lldb_private::npdb::MakeConstantLocationExpression` with a record type, hence not crash for now. 

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


More information about the lldb-commits mailing list