aboutsummaryrefslogtreecommitdiff
path: root/lldb/test/API/lang/cpp/thunk/main.cpp
blob: 82d17b1350093ee6540555491239c5781ad4b78d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <stdio.h>

class Base1 {
public:
  virtual ~Base1() {}
};

class Base2 {
public:
  virtual void doit() = 0;
  virtual void doit_debug() = 0;
};

Base2 *b;

class Derived1 : public Base1, public Base2 {
public:
  virtual void doit() { printf("Derived1\n"); }
  virtual void __attribute__((nodebug)) doit_debug() {
    printf("Derived1 (no debug)\n");
  }
};

class Derived2 : public Base2 {
public:
  virtual void doit() { printf("Derived2\n"); }
  virtual void doit_debug() { printf("Derived2 (debug)\n"); }
};

void testit() { b->doit(); }

void testit_debug() {
  b->doit_debug();
  printf("This is where I should step out to with nodebug.\n"); // Step here
}

int main() {

  b = new Derived1();
  testit();
  testit_debug();

  b = new Derived2();
  testit();
  testit_debug();

  return 0;
}