1 | #include <stdio.h> |
2 | |
3 | class Base1 { |
4 | public: |
5 | virtual ~Base1() {} |
6 | }; |
7 | |
8 | class Base2 { |
9 | public: |
10 | virtual void doit() = 0; |
11 | virtual void doit_debug() = 0; |
12 | }; |
13 | |
14 | Base2 *b; |
15 | |
16 | class Derived1 : public Base1, public Base2 { |
17 | public: |
18 | virtual void doit() { printf(format: "Derived1\n" ); } |
19 | virtual void __attribute__((nodebug)) doit_debug() { |
20 | printf(format: "Derived1 (no debug)\n" ); |
21 | } |
22 | }; |
23 | |
24 | class Derived2 : public Base2 { |
25 | public: |
26 | virtual void doit() { printf(format: "Derived2\n" ); } |
27 | virtual void doit_debug() { printf(format: "Derived2 (debug)\n" ); } |
28 | }; |
29 | |
30 | void testit() { b->doit(); } |
31 | |
32 | void testit_debug() { |
33 | b->doit_debug(); |
34 | printf(format: "This is where I should step out to with nodebug.\n" ); // Step here |
35 | } |
36 | |
37 | int main() { |
38 | |
39 | b = new Derived1(); |
40 | testit(); |
41 | testit_debug(); |
42 | |
43 | b = new Derived2(); |
44 | testit(); |
45 | testit_debug(); |
46 | |
47 | return 0; |
48 | } |
49 | |