@@ -621,13 +621,17 @@ void ValueObjectPrinter::PrintChild(
621
621
}
622
622
}
623
623
624
- uint32_t ValueObjectPrinter::GetMaxNumChildrenToPrint (bool &print_dotdotdot) {
624
+ llvm::Expected<uint32_t >
625
+ ValueObjectPrinter::GetMaxNumChildrenToPrint (bool &print_dotdotdot) {
625
626
ValueObject &synth_valobj = GetValueObjectForChildrenGeneration ();
626
627
627
628
if (m_options.m_pointer_as_array )
628
629
return m_options.m_pointer_as_array .m_element_count ;
629
630
630
- uint32_t num_children = synth_valobj.GetNumChildrenIgnoringErrors ();
631
+ auto num_children_or_err = synth_valobj.GetNumChildren ();
632
+ if (!num_children_or_err)
633
+ return num_children_or_err;
634
+ uint32_t num_children = *num_children_or_err;
631
635
print_dotdotdot = false ;
632
636
if (num_children) {
633
637
const size_t max_num_children = GetMostSpecializedValue ()
@@ -704,7 +708,12 @@ void ValueObjectPrinter::PrintChildren(
704
708
ValueObject &synth_valobj = GetValueObjectForChildrenGeneration ();
705
709
706
710
bool print_dotdotdot = false ;
707
- size_t num_children = GetMaxNumChildrenToPrint (print_dotdotdot);
711
+ auto num_children_or_err = GetMaxNumChildrenToPrint (print_dotdotdot);
712
+ if (!num_children_or_err) {
713
+ *m_stream << " <" << llvm::toString (num_children_or_err.takeError ()) << ' >' ;
714
+ return ;
715
+ }
716
+ uint32_t num_children = *num_children_or_err;
708
717
if (num_children) {
709
718
bool any_children_printed = false ;
710
719
@@ -753,7 +762,12 @@ bool ValueObjectPrinter::PrintChildrenOneLiner(bool hide_names) {
753
762
ValueObject &synth_valobj = GetValueObjectForChildrenGeneration ();
754
763
755
764
bool print_dotdotdot = false ;
756
- size_t num_children = GetMaxNumChildrenToPrint (print_dotdotdot);
765
+ auto num_children_or_err = GetMaxNumChildrenToPrint (print_dotdotdot);
766
+ if (!num_children_or_err) {
767
+ *m_stream << ' <' << llvm::toString (num_children_or_err.takeError ()) << ' >' ;
768
+ return true ;
769
+ }
770
+ uint32_t num_children = *num_children_or_err;
757
771
758
772
if (num_children) {
759
773
m_stream->PutChar (' (' );
0 commit comments