[all-commits] [llvm/llvm-project] fd0eca: [lldb] Surface GetIndexOfChildWithName errors inst...
Charles Zablit via All-commits
all-commits at lists.llvm.org
Thu Sep 17 08:57:33 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: fd0ecaccdc131ae3e541be4d1eb83d85758bf104
https://github.com/llvm/llvm-project/commit/fd0ecaccdc131ae3e541be4d1eb83d85758bf104
Author: Charles Zablit <c_zablit at apple.com>
Date: 2026-09-17 (Thu, 17 Sep 2026)
Changed paths:
M lldb/include/lldb/DataFormatters/TypeSynthetic.h
M lldb/include/lldb/ValueObject/ValueObject.h
M lldb/source/API/SBValue.cpp
M lldb/source/ValueObject/ValueObjectSynthetic.cpp
Log Message:
-----------
[lldb] Surface GetIndexOfChildWithName errors instead of dropping them (#224059)
`ValueObjectSynthetic::GetChildMemberWithName` and
`SBValue::GetIndexOfChildWithName` called `llvm::consumeError` on the
`llvm::Expected` returned by `GetIndexOfChildWithName` and reported the
failure as a null `ValueObjectSP` / `UINT32_MAX`, so the reason a lookup
failed never reached anyone. Log them instead: `LLDBLog::DataFormatters`
from ValueObject and formatter code, `LLDBLog::API` at the SB boundary.
That is the convention `BlockPointer.cpp` and `LibCxx.cpp` already
follow.
Also, in `ValueObjectSynthetic::GetIndexOfChildWithName`:
- A front-end with `TypeOptions::eTypeOptionCustomSubscripting` that
failed to find the child left `index` at its `SIZE_MAX` initializer,
dropped the front-end's error unread, then cached `SIZE_MAX` in
`m_name_toindex` and returned it as a valid index. Return the
front-end's error instead.
- Call `GetNumChildren(max)` rather than
`GetNumChildrenIgnoringErrors(max)` for the `"[N]"` subscript bounds
check and propagate the error, so a child count that fails to compute is
no longer reported as a subscript that is out of range.
- Return early on a cache hit rather than falling through a chain of
else-if branches that retested `found_index`.
Lower-cases the two `"Type has no child named"` messages in
`TypeSynthetic.h` for consistency with every other instance of that
string.
Follow-up to the review on #136693.
rdar://150281004
rdar://150281080
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list