ignore invalid DOF provider sections
[binutils-gdb.git] / gdb / testsuite / gdb.cp / mb-ctor.cc
blobc2992601a163062d4e1d1982d3b8f0a7a86d8f10
2 #include <stdio.h>
4 class Base
6 public:
7 Base(int k);
8 ~Base();
9 virtual void foo() {}
10 private:
11 int k;
14 Base::Base(int k)
16 this->k = k;
19 Base::~Base()
21 printf("~Base\n");
24 class Derived : public virtual Base
26 public:
27 Derived(int i);
28 ~Derived();
29 private:
30 int i;
31 int i2;
34 Derived::Derived(int i) : Base(i)
36 this->i = i;
37 /* The next statement is spread over two lines on purpose to exercise
38 a bug where breakpoints set on all but the last line of a statement
39 would not get multiple breakpoints.
40 The second line's text for gdb_get_line_number is a subset of the
41 first line so that we don't care which line gdb prints when it stops. */
42 this->i2 = // set breakpoint here
43 i; // breakpoint here
46 Derived::~Derived()
48 printf("~Derived\n");
51 class DeeplyDerived : public Derived
53 public:
54 DeeplyDerived(int i) : Base(i), Derived(i) {}
57 int main()
59 /* Invokes the Derived ctor that constructs both
60 Derived and Base. */
61 Derived d(7);
62 /* Invokes the Derived ctor that constructs only
63 Derived. Base is constructed separately by
64 DeeplyDerived's ctor. */
65 DeeplyDerived dd(15);