1class Base {
2public:
3 Base () = default;
4 virtual int func() { return 1; }
5 virtual ~Base() = default;
6};
7
8class Derived : public Base {
9private:
10 int m_derived_data;
11public:
12 Derived () : Base(), m_derived_data(0x0fedbeef) {}
13 virtual ~Derived() = default;
14 virtual int func() { return m_derived_data; }
15};
16
17int main (int argc, char const *argv[])
18{
19 Base *base = new Derived();
20 return 0; //% stream = lldb.SBStream()
21 //% base = self.frame().FindVariable("base")
22 //% base.SetPreferDynamicValue(lldb.eDynamicDontRunTarget)
23 //% base.GetDescription(stream)
24 //% if self.TraceOn(): print(stream.GetData())
25 //% self.assertTrue(stream.GetData().startswith("(Derived *"))
26}
27

source code of lldb/test/API/functionalities/data-formatter/dump_dynamic/main.cpp