1#include <stdio.h>
2#include <memory>
3
4class BaseClass
5{
6public:
7 BaseClass();
8 virtual ~BaseClass() { }
9};
10
11class DerivedClass : public BaseClass
12{
13public:
14 DerivedClass();
15 virtual ~DerivedClass() { }
16protected:
17 int mem;
18};
19
20BaseClass::BaseClass()
21{
22}
23
24DerivedClass::DerivedClass() : BaseClass()
25{
26 mem = 101;
27}
28
29int
30main (int argc, char **argv)
31{
32 BaseClass *b = nullptr; // Break here and check b has 0 children
33 b = new DerivedClass(); // Break here and check b still has 0 children
34 b = nullptr; // Break here and check b has one child now
35 return 0; // Break here and check b has 0 children again
36}
37

source code of lldb/test/API/functionalities/dynamic_value_child_count/pass-to-base.cpp