Add debug-info to access variables from generator state

This commit is contained in:
Wim Looman 2018-11-07 22:45:21 +01:00
parent 3e58dabc16
commit 61097bce0d
2 changed files with 39 additions and 6 deletions

View file

@ -7,6 +7,8 @@
// gdb-command:run
// gdb-command:print a
// gdb-check:$1 = 5
// gdb-command:print d
// gdb-check:$2 = 6
// === LLDB TESTS ==================================================================================
@ -14,8 +16,11 @@
// lldb-command:print a
// lldbg-check:(int) $0 = 5
// lldbr-check:(int) a = 5
// lldb-command:print d
// lldbg-check:(int) $1 = 6
// lldbr-check:(int) d = 6
#![feature(omit_gdb_pretty_printer_section, generators, generator_trait, pin)]
#![feature(omit_gdb_pretty_printer_section, generators, generator_trait)]
#![omit_gdb_pretty_printer_section]
use std::ops::Generator;
@ -24,9 +29,10 @@ use std::pin::Pin;
fn main() {
let mut a = 5;
let mut b = || {
let d = 6;
yield;
_zzz(); // #break
a = 6;
a = d;
};
Pin::new(&mut b).resume();
Pin::new(&mut b).resume();