[Lldb-commits] [PATCH] D37154: lldb-mi: -var-update can hang when traversing complex types with pointers
Greg Clayton via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Wed Aug 30 14:20:07 PDT 2017
clayborg added inline comments.
================
Comment at: tools/lldb-mi/MICmdCmdVar.cpp:525-526
+ // Don't go down into pointers or references, to avoid a loop
+ lldb::SBType valueType = member.GetType();
+ if (!valueType.IsPointerType() && !valueType.IsReferenceType())
+ if (ExamineSBValueForChange(member, vrwbChanged) && vrwbChanged)
----------------
Better to keep this to 1 API call by using "uint32_t SBValue::GetTypeFlags()". That call returns a bunch of type info bits that will be set from lldb::TypeFlags and it allows you to get all of the info you need on a type pretty quickly:
```
// Skip pointers and references to avoid infinite loop
if (member.GetType().GetTypeFlags() & (lldb::eTypeIsPointer | lldb::eTypeIsReference))
continue;
```
https://reviews.llvm.org/D37154
More information about the lldb-commits
mailing list