[Lldb-commits] [PATCH] D138724: [lldb][Target] Flush the scratch TypeSystem when process gets deleted

Dave Lee via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Nov 30 13:39:38 PST 2022


kastiglione added inline comments.


================
Comment at: lldb/source/Core/ModuleList.cpp:1080
+  bool ret = true;
+  ForEach([&](const ModuleSP &module_sp) {
+    ret &= callback(module_sp);
----------------
I wonder why ForEach doesn't deal out a `Module &`? I would think a ModuleList should not allow for null Module pointers.


================
Comment at: lldb/source/Target/Target.cpp:1686
+    const bool should_flush_type_systems =
+        module_list.AllOf([](const lldb::ModuleSP &module_sp) {
+          if (!module_sp)
----------------
How come this is `AllOf` and not a `AnyOf`?


================
Comment at: lldb/source/Target/Target.cpp:1704-1710
+    // If a module was torn down it will have torn
+    // down the 'TypeSystem's that we used as source
+    // 'ASTContext's for the persistent variables
+    // in the current target. Those would now be
+    // unsafe to access because the 'DeclOrigin'
+    // are now possibly stale. Thus clear all
+    // persistent variables.
----------------
nit: Why such a narrow line wrapping width?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138724/new/

https://reviews.llvm.org/D138724



More information about the lldb-commits mailing list