@@ -300,18 +300,8 @@ CMICmdBase *CMICmdCmdVarCreate::CreateSelf() {
300
300
void CMICmdCmdVarCreate::CompleteSBValue (lldb::SBValue &vrwValue) {
301
301
// Force a value to update
302
302
vrwValue.GetValueDidChange ();
303
-
304
- // And update its children
305
- lldb::SBType valueType = vrwValue.GetType ();
306
- if (!valueType.IsPointerType () && !valueType.IsReferenceType ()) {
307
- const auto temp = vrwValue.GetNumChildren ();
308
- const MIuint nChildren = temp > 64 ? 64 : temp;
309
- for (MIuint i = 0 ; i < nChildren; ++i) {
310
- lldb::SBValue member = vrwValue.GetChildAtIndex (i);
311
- if (member.IsValid ())
312
- CompleteSBValue (member);
313
- }
314
- }
303
+ // Do not traverse the Children values. For reference, see
304
+ // https://github.com/lldb-tools/lldb-mi/pull/115#discussion_r1706360623.
315
305
}
316
306
317
307
// ++
@@ -588,33 +578,10 @@ void CMICmdCmdVarUpdate::MIFormResponse(const CMIUtilString &vrStrVarName,
588
578
// --
589
579
bool CMICmdCmdVarUpdate::ExamineSBValueForChange (lldb::SBValue &vrwValue,
590
580
bool &vrwbChanged) {
591
- // Note SBValue::GetValueDidChange() returns false if value changes from
592
- // invalid (for example if it represents a field of a structure, and
593
- // structure is pointed at with a NULL pointer) to a valid value, which is not
594
- // a desired result for -var-update changelist - it will miss case of
595
- // invalid-to-valid change.
596
- if (vrwValue.GetValueDidChange ()) {
597
- vrwbChanged = true ;
598
- return MIstatus::success;
599
- }
581
+ vrwbChanged = vrwValue.GetValueDidChange ();
582
+ // Do not traverse the Children values. For reference, see
583
+ // https://github.com/lldb-tools/lldb-mi/pull/115#discussion_r1706367538.
600
584
601
- const auto temp = vrwValue.GetNumChildren ();
602
- const MIuint nChildren = temp > 64 ? 64 : temp;
603
- for (MIuint i = 0 ; i < nChildren; ++i) {
604
- lldb::SBValue member = vrwValue.GetChildAtIndex (i);
605
- if (!member.IsValid ())
606
- continue ;
607
-
608
- // skip pointers and references to avoid infinite loop
609
- if (member.GetType ().GetTypeFlags () &
610
- (lldb::eTypeIsPointer | lldb::eTypeIsReference))
611
- continue ;
612
-
613
- // Handle composite types (i.e. struct or arrays)
614
- if (ExamineSBValueForChange (member, vrwbChanged) && vrwbChanged)
615
- return MIstatus::success;
616
- }
617
- vrwbChanged = false ;
618
585
return MIstatus::success;
619
586
}
620
587
0 commit comments