1 class Base { 2 public: 3 Base () = default; func()4 virtual int func() { return 1; } 5 virtual ~Base() = default; 6 }; 7 8 class Derived : public Base { 9 private: 10 int m_derived_data; 11 public: Derived()12 Derived () : Base(), m_derived_data(0x0fedbeef) {} 13 virtual ~Derived() = default; func()14 virtual int func() { return m_derived_data; } 15 }; 16 main(int argc,char const * argv[])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