https://bugs.llvm.org/show_bug.cgi?id=39651
Bug ID: 39651
Summary: Stepping for C++ coroutines is broken
Product: libraries
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: Scalar Optimizations
Assignee: unassignedb...@nondot.org
Reporter: dav...@freebsd.org
CC: llvm-bugs@lists.llvm.org, modoca...@gmail.com
#include <experimental/coroutine>
using namespace std::experimental;
coroutine_handle<> g;
struct coro {
struct promise_type {
coro get_return_object() {
g = coroutine_handle<promise_type>::from_promise(*this);
return {};
}
suspend_never initial_suspend() { return {}; }
suspend_never final_suspend() { return {}; }
void return_void() {}
void unhandled_exception() {}
};
};
coro f() {
int i = 0;
++i; // break here
co_await suspend_always();
++i; // break here
co_await suspend_always();
int j = 0; // break here
++i; // break here
++j;
co_await suspend_always();
++j; // break here
}
int main() {
f();
g.resume();
g.resume();
g.resume();
}
# Run inside lldb:
Process 59665 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = step over
frame #0: 0x000000010000100d a.out`main at coro.cpp:35:5
32
33 int main() {
34 f();
-> 35 g.resume();
36 g.resume();
37 g.resume();
38 }
(lldb) s
Process 59665 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = step in
frame #0: 0x0000000100001019 a.out`main at coro.cpp:36:5
33 int main() {
34 f();
35 g.resume();
-> 36 g.resume();
37 g.resume();
38 }
So `step` skips entirely the resumption thunk inside the coroutine.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs