[Lldb-commits] [PATCH] D132624: [LLDB] Devirtualize coroutine promise types for `std::coroutine_handle`

Jim Ingham via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 25 09:52:12 PDT 2022



> On Aug 25, 2022, at 8:11 AM, Pavel Labath via Phabricator via lldb-commits <lldb-commits at lists.llvm.org> wrote:
> 
> labath added a comment.
> 
> In D132624#3748434 <https://reviews.llvm.org/D132624#3748434>, @avogelsgesang wrote:
> 
>>> The only concern is that if it would be not so easy to read if there are too many levels? (Consider the 30levels example in D132451 <https://reviews.llvm.org/D132451>). If it would be better to print ... at certain level? Or this is already handled by lldb?
>> 
>> Agree, it would be better to limit the printing at some point. However, afaict, limiting the depth to which children are expanded cannot be done from inside the data formatter/synthetic children frontend. I am not sure if lldb already has a separate mechanism in place to limit printing in this case. If it does not, I think it makes sense to add it, but that would be a separate commit
> 
> The best (I think) mechanism we have is the "pointer depth" limit (defaulting to 1). It works fine on regular objects, but requires some care with synthetic children. The fact that it does not kick in here leads me to believe that the data formatter is creating the synthetic children as non pointer objects (e.g. by automatically dereferencing any nested pointers), even though the structures clearly contain some pointers inside. That is a problem. Not only it creates excessively large outputs, it can even cause lldb to hang (looping endlessly while trying to print "all" children) if the data structures it is trying to print are circular (e.g. due to corruption).

There are actually two separate controls for the depth of child traversal:

(lldb) help v
...
       -D <count> ( --depth <count> )
            Set the max recurse depth when dumping aggregate types (default is infinity).
...
       -P <count> ( --ptr-depth <count> )
            The number of pointers to be traversed when dumping values (default is zero).

There have to be two, because aggregate types can't have cycles, so it's safe to set those to a high value, but pointer following can lead to cycles and we don't currently do cycle detection so you have to be more careful with this setting.

Jim


> 
> 
> Repository:
>  rG LLVM Github Monorepo
> 
> CHANGES SINCE LAST ACTION
>  https://reviews.llvm.org/D132624/new/
> 
> https://reviews.llvm.org/D132624
> 
> _______________________________________________
> lldb-commits mailing list
> lldb-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits



More information about the lldb-commits mailing list