[lldb] Print ValueObject when GetObjectDescription fails (#152417) #11178
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes a few bugs, effectively through a fallback to
p
whenpo
fails.The motivating bug this fixes is when an error within the compiler causes
po
to fail.Previously when that happened, only its value (typically an object's address) was
printed – and problematically, no compiler diagnostics were shown. With this change,
compiler diagnostics are shown, and the object is fully printed (ie
p
).Another bug this fixes is when
po
is used on a type that doesn't provide an objectdescription (such as a struct). Again, the normal
ValueObject
printing is used.Additionally, this also improves how lldb handles an object description method that
fails in some way. Now an error will be shown (it wasn't before), and the value will be
printed normally.
(cherry picked from commit ae7e1b8)
rdar://134291640
rdar://134520818