1 //===-- main.cpp ------------------------------------------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 class Base { 10 public: 11 Base () = default; 12 virtual int func() { return 1; } 13 virtual ~Base() = default; 14 }; 15 16 class Derived : public Base { 17 private: 18 int m_derived_data; 19 public: 20 Derived () : Base(), m_derived_data(0x0fedbeef) {} 21 virtual ~Derived() = default; 22 virtual int func() { return m_derived_data; } 23 }; 24 25 int main (int argc, char const *argv[]) 26 { 27 Base *base = new Derived(); 28 return 0; //% stream = lldb.SBStream() 29 //% base = self.frame().FindVariable("base") 30 //% base.SetPreferDynamicValue(lldb.eDynamicDontRunTarget) 31 //% base.GetDescription(stream) 32 //% if self.TraceOn(): print(stream.GetData()) 33 //% self.assertTrue(stream.GetData().startswith("(Derived *")) 34 } 35