2024-02-22 12:10:29 +00:00
|
|
|
//@ compile-flags:-g
|
2014-07-09 14:46:09 +02:00
|
|
|
|
|
|
|
// === GDB TESTS ===================================================================================
|
|
|
|
|
2014-04-24 11:35:48 +02:00
|
|
|
// gdb-command:run
|
|
|
|
|
|
|
|
// gdb-command:print variable
|
|
|
|
// gdb-check:$1 = 1
|
|
|
|
// gdb-command:print constant
|
|
|
|
// gdb-check:$2 = 2
|
|
|
|
// gdb-command:print a_struct
|
2024-08-17 17:31:49 -04:00
|
|
|
// gdb-check:$3 = var_captured_in_stack_closure::Struct {a: -3, b: 4.5, c: 5}
|
2014-04-24 11:35:48 +02:00
|
|
|
// gdb-command:print *struct_ref
|
2024-08-17 17:31:49 -04:00
|
|
|
// gdb-check:$4 = var_captured_in_stack_closure::Struct {a: -3, b: 4.5, c: 5}
|
2014-04-24 11:35:48 +02:00
|
|
|
// gdb-command:print *owned
|
|
|
|
// gdb-check:$5 = 6
|
2013-08-23 18:45:02 +02:00
|
|
|
|
2014-12-05 18:35:16 -05:00
|
|
|
// gdb-command:continue
|
|
|
|
|
|
|
|
// gdb-command:print variable
|
|
|
|
// gdb-check:$6 = 2
|
|
|
|
// gdb-command:print constant
|
|
|
|
// gdb-check:$7 = 2
|
|
|
|
// gdb-command:print a_struct
|
2024-08-17 17:31:49 -04:00
|
|
|
// gdb-check:$8 = var_captured_in_stack_closure::Struct {a: -3, b: 4.5, c: 5}
|
2014-12-05 18:35:16 -05:00
|
|
|
// gdb-command:print *struct_ref
|
2024-08-17 17:31:49 -04:00
|
|
|
// gdb-check:$9 = var_captured_in_stack_closure::Struct {a: -3, b: 4.5, c: 5}
|
2014-12-05 18:35:16 -05:00
|
|
|
// gdb-command:print *owned
|
|
|
|
// gdb-check:$10 = 6
|
|
|
|
|
2014-07-09 14:46:09 +02:00
|
|
|
|
|
|
|
// === LLDB TESTS ==================================================================================
|
|
|
|
|
|
|
|
// lldb-command:run
|
|
|
|
|
2024-03-15 15:05:57 +01:00
|
|
|
// lldb-command:v variable
|
2024-08-18 17:00:33 -04:00
|
|
|
// lldb-check:[...] 1
|
2024-03-15 15:05:57 +01:00
|
|
|
// lldb-command:v constant
|
2024-08-18 17:00:33 -04:00
|
|
|
// lldb-check:[...] 2
|
2024-03-15 15:05:57 +01:00
|
|
|
// lldb-command:v a_struct
|
2024-08-18 17:00:33 -04:00
|
|
|
// lldb-check:[...] { a = -3 b = 4.5 c = 5 }
|
2024-03-15 15:05:57 +01:00
|
|
|
// lldb-command:v *struct_ref
|
2024-08-18 17:00:33 -04:00
|
|
|
// lldb-check:[...] { a = -3 b = 4.5 c = 5 }
|
2024-03-15 15:05:57 +01:00
|
|
|
// lldb-command:v *owned
|
2024-08-18 17:00:33 -04:00
|
|
|
// lldb-check:[...] 6
|
2014-07-09 14:46:09 +02:00
|
|
|
|
2014-12-05 18:35:16 -05:00
|
|
|
// lldb-command:continue
|
|
|
|
|
2024-03-15 15:05:57 +01:00
|
|
|
// lldb-command:v variable
|
2024-08-18 17:00:33 -04:00
|
|
|
// lldb-check:[...] 2
|
2024-03-15 15:05:57 +01:00
|
|
|
// lldb-command:v constant
|
2024-08-18 17:00:33 -04:00
|
|
|
// lldb-check:[...] 2
|
2024-03-15 15:05:57 +01:00
|
|
|
// lldb-command:v a_struct
|
2024-08-18 17:00:33 -04:00
|
|
|
// lldb-check:[...] { a = -3 b = 4.5 c = 5 }
|
2024-03-15 15:05:57 +01:00
|
|
|
// lldb-command:v *struct_ref
|
2024-08-18 17:00:33 -04:00
|
|
|
// lldb-check:[...] { a = -3 b = 4.5 c = 5 }
|
2024-03-15 15:05:57 +01:00
|
|
|
// lldb-command:v *owned
|
2024-08-18 17:00:33 -04:00
|
|
|
// lldb-check:[...] 6
|
2014-12-05 18:35:16 -05:00
|
|
|
|
2021-04-06 13:34:17 -04:00
|
|
|
|
|
|
|
// === CDB TESTS ===================================================================================
|
|
|
|
|
|
|
|
// cdb-command: g
|
|
|
|
|
|
|
|
// cdb-command: dx variable
|
|
|
|
// cdb-check:variable : 1 [Type: [...]]
|
|
|
|
// cdb-command: dx constant
|
|
|
|
// cdb-check:constant : 2 [Type: [...]]
|
|
|
|
// cdb-command: dx a_struct
|
|
|
|
// cdb-check:a_struct [Type: var_captured_in_stack_closure::Struct]
|
|
|
|
// cdb-check: [+0x[...]] a : -3 [Type: [...]]
|
|
|
|
// cdb-check: [+0x[...]] b : 4.500000 [Type: [...]]
|
|
|
|
// cdb-check: [+0x[...]] c : 0x5 [Type: unsigned [...]]
|
|
|
|
// cdb-command: dx struct_ref
|
|
|
|
// cdb-check:struct_ref : 0x[...] [Type: var_captured_in_stack_closure::Struct *]
|
|
|
|
// cdb-check: [+0x[...]] a : -3 [Type: [...]]
|
|
|
|
// cdb-check: [+0x[...]] b : 4.500000 [Type: [...]]
|
|
|
|
// cdb-check: [+0x[...]] c : 0x5 [Type: unsigned [...]]
|
|
|
|
// cdb-command: dx owned
|
|
|
|
// cdb-check:owned : 0x[...] : 6 [Type: [...] *]
|
|
|
|
|
|
|
|
|
|
|
|
// cdb-command: g
|
|
|
|
|
|
|
|
// cdb-command: dx variable
|
|
|
|
// cdb-check:variable : 2 [Type: [...]]
|
|
|
|
// cdb-command: dx constant
|
|
|
|
// cdb-check:constant : 2 [Type: [...]]
|
|
|
|
// cdb-command: dx a_struct
|
|
|
|
// cdb-check:a_struct [Type: var_captured_in_stack_closure::Struct]
|
|
|
|
// cdb-check: [+0x[...]] a : -3 [Type: [...]]
|
|
|
|
// cdb-check: [+0x[...]] b : 4.500000 [Type: [...]]
|
|
|
|
// cdb-check: [+0x[...]] c : 0x5 [Type: unsigned [...]]
|
|
|
|
// cdb-command: dx struct_ref
|
|
|
|
// cdb-check:struct_ref : 0x[...] [Type: var_captured_in_stack_closure::Struct *]
|
|
|
|
// cdb-check: [+0x[...]] a : -3 [Type: [...]]
|
|
|
|
// cdb-check: [+0x[...]] b : 4.500000 [Type: [...]]
|
|
|
|
// cdb-check: [+0x[...]] c : 0x5 [Type: unsigned [...]]
|
|
|
|
// cdb-command: dx owned
|
|
|
|
// cdb-check:owned : 0x[...] : 6 [Type: [...] *]
|
|
|
|
|
2014-10-27 15:37:07 -07:00
|
|
|
#![allow(unused_variables)]
|
2015-09-19 16:33:47 -04:00
|
|
|
#![feature(omit_gdb_pretty_printer_section)]
|
2014-12-03 14:48:18 -08:00
|
|
|
#![omit_gdb_pretty_printer_section]
|
2013-08-23 18:45:02 +02:00
|
|
|
|
|
|
|
struct Struct {
|
2015-03-25 17:06:52 -07:00
|
|
|
a: isize,
|
2013-09-26 02:26:09 -04:00
|
|
|
b: f64,
|
2015-03-25 17:06:52 -07:00
|
|
|
c: usize
|
2013-08-23 18:45:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let mut variable = 1;
|
|
|
|
let constant = 2;
|
|
|
|
|
|
|
|
let a_struct = Struct {
|
|
|
|
a: -3,
|
|
|
|
b: 4.5,
|
|
|
|
c: 5
|
|
|
|
};
|
|
|
|
|
|
|
|
let struct_ref = &a_struct;
|
2021-08-25 02:39:40 +02:00
|
|
|
let owned: Box<_> = Box::new(6);
|
2013-08-23 18:45:02 +02:00
|
|
|
|
2014-12-05 18:35:16 -05:00
|
|
|
{
|
2016-04-16 21:51:26 +03:00
|
|
|
let mut first_closure = || {
|
2014-12-05 18:35:16 -05:00
|
|
|
zzz(); // #break
|
|
|
|
variable = constant + a_struct.a + struct_ref.a + *owned;
|
|
|
|
};
|
|
|
|
|
2015-01-05 08:23:17 -05:00
|
|
|
first_closure();
|
2014-12-05 18:35:16 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2016-04-16 21:51:26 +03:00
|
|
|
let mut second_closure = || {
|
2014-12-05 18:35:16 -05:00
|
|
|
zzz(); // #break
|
|
|
|
variable = constant + a_struct.a + struct_ref.a + *owned;
|
|
|
|
};
|
2015-01-05 08:23:17 -05:00
|
|
|
second_closure();
|
2014-12-05 18:35:16 -05:00
|
|
|
}
|
2013-08-23 18:45:02 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
fn zzz() {()}
|