[Lldb-commits] [PATCH] D138259: Add the ability to see when a type in incomplete.

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 22 06:21:36 PST 2022


labath added a comment.

In D138259#3941859 <https://reviews.llvm.org/D138259#3941859>, @clayborg wrote:

> In D138259#3941465 <https://reviews.llvm.org/D138259#3941465>, @labath wrote:
>
>> In D138259#3941431 <https://reviews.llvm.org/D138259#3941431>, @clayborg wrote:
>>
>>> "a type should be complete but isn't and you are losing information that should have been available for you to debug".
>>
>> I agree, but there are still two (or more) ways to communicate that information.
>>
>> 1. "this type is complete" + "actually, I'm just missing the debug info and pretending it's complete"
>> 2. "this type is incomplete" + "it is incomplete because I am missing its debug info"
>>
>> My question is which method would be more useful to the user.
>
> Gotcha. We could change "bool SBType::IsTypeComplete()" to return false, and then add a new:
>
>   bool SBType::ShouldBeComplete();
>
> That would return true if IsTypeComplete() returned false because it was forcefully completed.

That is the expected behavior, but we wouldn't need to implement it that way. We could still implement it by calling the "is forcefully completed" metadata function, and so it wouldn't force the completion of the type. So a `true` return value would mean that the type has been forcefully completed, while a return value of `false` would mean that the type is complete (not just pretend-complete) **or** the completion of the type hasn't been attempted yet.

Note that I'm not saying that this is how it needs to be implemented. However, I think its worth thinking about this, given that we're adding a new public interface and all. I think it comes down to the question of which situation would be more/less confusing to the (SB) user

- querying a member/base class of an object and finding that it's incomplete (even though that is not possible in regular c++)
- querying a member/base class of an object and finding that it's empty (even though the truth is that we just don't know what it contains.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138259



More information about the lldb-commits mailing list