[lldb/Interpreter] Fix deep copying for OptionValue classes
Some implementations of the DeepCopy function called the copy constructor that copied m_parent member instead of setting a new parent. Others just leaved the base class's members (m_parent, m_callback, m_was_set) empty. One more problem is that not all classes override this function, e.g. OptionValueArgs::DeepCopy produces OptionValueArray instance, and Target[Process/Thread]ValueProperty::DeepCopy produces OptionValueProperty. This makes downcasting via static_cast invalid. The patch implements idiom "virtual constructor" to fix these issues. Add a test that checks DeepCopy for correct copying/setting all data members of the base class. Differential Revision: https://reviews.llvm.org/D96952
Loading
Please sign in to comment