[Lldb-commits] [PATCH] D138558: [lldb][DataFormatter] Add std::ranges::ref_view formatter

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Dec 1 07:24:42 PST 2022


labath added a comment.

You may want to check that this kind of automatic dereferencing does not send lldb into a tailspin if the printed data structure is recursive. I know we had problems like that with smart pointer pretty printers.

I'd try some code like:

  #include <ranges>
  #include <vector>
  
  struct A {
    std::ranges::ref_view<std::vector<A>> a;
  };
  
  int main() {
      std::vector<A> v;
      v.push_back(A{v});
      v[0].a = v;
      // print v ?
  }


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138558



More information about the lldb-commits mailing list