Files
clang-p2996/lldb/test/API/lang/cpp/thunk/main.cpp
Jonas Devlieghere a3dc77c00a [lldb] Support stepping through C++ thunks (#127419)
This PR fixes LLDB stepping out, rather than stepping through a C++
thunk. The implementation is based on, and upstreams, the support for
runtime thunks in the Swift fork.

Fixes #43413
2025-02-17 15:44:41 -08:00

49 lines
806 B
C++

#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;
}