INNER CODE UNIT · Python

get_child_at_index

mongodb/mongo-c-driver · lldb_bson.py:282

    def get_child_at_index(self, pos: int) -> SBValue:
        """
        Obtain the synthetic child of this value at index 'pos'.
        """
        # LLDB sometimes calls us with a child that we don't have?
        if pos >= len(self.__children):
            print(f'NOTE: lldb called get_child_at_index({pos}), but we only have {len(self.__children)} children')
            return SBValue()
        # Get the child:
        nth = self.__children[pos]
        # If not a tuple:
        if not isinstance(nth, tuple):
            # The type is a ValueFactory, which will return a new SBValue
            val = nth()
            assert val.error.success, f'{val.error=}, {nth=}, {pos=}'
            return val
        # Otherwise, they yielded a tuple:
        if len(nth) == 4:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…