about summary refs log tree commit diff
path: root/src/test/debuginfo
diff options
context:
space:
mode:
authorlrh2000 <lrh2000@pku.edu.cn>2021-04-30 20:02:53 +0800
committerlrh2000 <lrh2000@pku.edu.cn>2021-04-30 22:36:08 +0800
commit5bf989ece9e29941f2c517a39289a60bfb8595c0 (patch)
treeb4e8bc3c6ef8a960e99684cace4df5d9dfa9aaba /src/test/debuginfo
parent060deec4b1e94be6fbc640a027c1a935d970e33e (diff)
downloadrust-5bf989ece9e29941f2c517a39289a60bfb8595c0.tar.gz
rust-5bf989ece9e29941f2c517a39289a60bfb8595c0.zip
Remove artificial flag from generator variants
 - Literally, variants are not artificial. We have `yield` statements,
   upvars and inner variables in the source code.
 - Functionally, we don't want debuggers to suppress the variants. It
   contains the state of the generator, which is useful when debugging.
   So they shouldn't be marked artificial.
 - Debuggers may use artificial flags to find the active variant. In
   this case, marking variants artificial will make debuggers not work
   properly.

Fixes #79009.
Diffstat (limited to 'src/test/debuginfo')
-rw-r--r--src/test/debuginfo/generator-objects.rs12
-rw-r--r--src/test/debuginfo/issue-57822.rs2
2 files changed, 9 insertions, 5 deletions
diff --git a/src/test/debuginfo/generator-objects.rs b/src/test/debuginfo/generator-objects.rs
index 3437b295e6e..1beed1c835d 100644
--- a/src/test/debuginfo/generator-objects.rs
+++ b/src/test/debuginfo/generator-objects.rs
@@ -1,22 +1,26 @@
 // Require a gdb that can read DW_TAG_variant_part.
 // min-gdb-version: 8.2
 
+// LLDB without native Rust support cannot read DW_TAG_variant_part,
+// so it prints nothing for generators. But those tests are kept to
+// ensure that LLDB won't crash at least (like #57822).
+
 // compile-flags:-g
 
 // === GDB TESTS ===================================================================================
 
 // gdb-command:run
 // gdb-command:print b
-// gdb-check:$1 = <error reading variable>
+// gdb-check:$1 = generator_objects::main::generator-0::Unresumed(0x[...])
 // gdb-command:continue
 // gdb-command:print b
-// gdb-check:$2 = <error reading variable>
+// gdb-check:$2 = generator_objects::main::generator-0::Suspend0{c: 6, d: 7, __0: 0x[...]}
 // gdb-command:continue
 // gdb-command:print b
-// gdb-check:$3 = <error reading variable>
+// gdb-check:$3 = generator_objects::main::generator-0::Suspend1{c: 7, d: 8, __0: 0x[...]}
 // gdb-command:continue
 // gdb-command:print b
-// gdb-check:$4 = <error reading variable>
+// gdb-check:$4 = generator_objects::main::generator-0::Returned(0x[...])
 
 // === LLDB TESTS ==================================================================================
 
diff --git a/src/test/debuginfo/issue-57822.rs b/src/test/debuginfo/issue-57822.rs
index 3a9eaecd5e7..6b2b12edda5 100644
--- a/src/test/debuginfo/issue-57822.rs
+++ b/src/test/debuginfo/issue-57822.rs
@@ -14,7 +14,7 @@
 // gdb-check:$1 = issue_57822::main::closure-1 (issue_57822::main::closure-0 (1))
 
 // gdb-command:print b
-// gdb-check:$2 = <error reading variable>
+// gdb-check:$2 = issue_57822::main::generator-3::Unresumed(issue_57822::main::generator-2::Unresumed(2))
 
 // === LLDB TESTS ==================================================================================