diff --git a/src/test/debuginfo/basic-types.rs b/src/test/debuginfo/basic-types.rs index ae554cafb50..67f77014c9f 100644 --- a/src/test/debuginfo/basic-types.rs +++ b/src/test/debuginfo/basic-types.rs @@ -17,6 +17,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run // gdb-command:finish @@ -49,6 +52,42 @@ // gdb-command:print f64 // gdb-check:$14 = 3.5 + +// === LLDB TESTS ================================================================================== + +// lldb-command:run +// lldb-command:print b +// lldb-check:[...]$0 = false +// lldb-command:print i +// lldb-check:[...]$1 = -1 + +// NOTE: LLDB does not support 32bit chars +// d ebugger:print (uint)(c) +// c heck:$3 = 97 + +// lldb-command:print i8 +// lldb-check:[...]$2 = 'D' +// lldb-command:print i16 +// lldb-check:[...]$3 = -16 +// lldb-command:print i32 +// lldb-check:[...]$4 = -32 +// lldb-command:print i64 +// lldb-check:[...]$5 = -64 +// lldb-command:print u +// lldb-check:[...]$6 = 1 +// lldb-command:print u8 +// lldb-check:[...]$7 = 'd' +// lldb-command:print u16 +// lldb-check:[...]$8 = 16 +// lldb-command:print u32 +// lldb-check:[...]$9 = 32 +// lldb-command:print u64 +// lldb-check:[...]$10 = 64 +// lldb-command:print f32 +// lldb-check:[...]$11 = 2.5 +// lldb-command:print f64 +// lldb-check:[...]$12 = 3.5 + #![allow(unused_variable)] fn main() { @@ -66,7 +105,7 @@ fn main() { let u64: u64 = 64; let f32: f32 = 2.5; let f64: f64 = 3.5; - _zzz(); + _zzz(); // #break } fn _zzz() {()} diff --git a/src/test/debuginfo/borrowed-basic.rs b/src/test/debuginfo/borrowed-basic.rs index d511e5ed20f..84610b3c740 100644 --- a/src/test/debuginfo/borrowed-basic.rs +++ b/src/test/debuginfo/borrowed-basic.rs @@ -14,6 +14,9 @@ // its numerical value. // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run // gdb-command:finish @@ -59,6 +62,53 @@ // gdb-command:print *f64_ref // gdb-check:$14 = 3.5 + +// === LLDB TESTS ================================================================================== + +// lldb-command:run +// lldb-command:print *bool_ref +// lldb-check:[...]$0 = true + +// lldb-command:print *int_ref +// lldb-check:[...]$1 = -1 + +// NOTE: lldb doesn't support 32bit chars at the moment +// d ebugger:print *char_ref +// c heck:[...]$x = 97 + +// lldb-command:print *i8_ref +// lldb-check:[...]$2 = 'D' + +// lldb-command:print *i16_ref +// lldb-check:[...]$3 = -16 + +// lldb-command:print *i32_ref +// lldb-check:[...]$4 = -32 + +// lldb-command:print *i64_ref +// lldb-check:[...]$5 = -64 + +// lldb-command:print *uint_ref +// lldb-check:[...]$6 = 1 + +// lldb-command:print *u8_ref +// lldb-check:[...]$7 = 'd' + +// lldb-command:print *u16_ref +// lldb-check:[...]$8 = 16 + +// lldb-command:print *u32_ref +// lldb-check:[...]$9 = 32 + +// lldb-command:print *u64_ref +// lldb-check:[...]$10 = 64 + +// lldb-command:print *f32_ref +// lldb-check:[...]$11 = 2.5 + +// lldb-command:print *f64_ref +// lldb-check:[...]$12 = 3.5 + #![allow(unused_variable)] fn main() { @@ -103,7 +153,8 @@ fn main() { let f64_val: f64 = 3.5; let f64_ref: &f64 = &f64_val; - zzz(); + + zzz(); // #break } fn zzz() {()} diff --git a/src/test/debuginfo/borrowed-c-style-enum.rs b/src/test/debuginfo/borrowed-c-style-enum.rs index 9ab7e0701cc..2270cfb6d21 100644 --- a/src/test/debuginfo/borrowed-c-style-enum.rs +++ b/src/test/debuginfo/borrowed-c-style-enum.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run // gdb-command:finish @@ -24,6 +27,20 @@ // gdb-command:print *the_c_ref // gdb-check:$3 = TheC + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print *the_a_ref +// lldb-check:[...]$0 = TheA + +// lldb-command:print *the_b_ref +// lldb-check:[...]$1 = TheB + +// lldb-command:print *the_c_ref +// lldb-check:[...]$2 = TheC + #![allow(unused_variable)] enum ABC { TheA, TheB, TheC } @@ -38,7 +55,7 @@ fn main() { let the_c = TheC; let the_c_ref: &ABC = &the_c; - zzz(); + zzz(); // #break } fn zzz() {()} diff --git a/src/test/debuginfo/borrowed-enum.rs b/src/test/debuginfo/borrowed-enum.rs index a377d68a33d..b6f5096c726 100644 --- a/src/test/debuginfo/borrowed-enum.rs +++ b/src/test/debuginfo/borrowed-enum.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run // gdb-command:finish @@ -24,6 +27,18 @@ // gdb-command:print *univariant_ref // gdb-check:$3 = {{4820353753753434}} + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print *the_a_ref +// lldb-check:[...]$0 = TheA { x: 0, y: 8970181431921507452 } +// lldb-command:print *the_b_ref +// lldb-check:[...]$1 = TheB(0, 286331153, 286331153) +// lldb-command:print *univariant_ref +// lldb-check:[...]$2 = TheOnlyCase(4820353753753434) + #![allow(unused_variable)] #![feature(struct_variant)] @@ -59,7 +74,7 @@ fn main() { let univariant = TheOnlyCase(4820353753753434); let univariant_ref: &Univariant = &univariant; - zzz(); + zzz(); // #break } fn zzz() {()} diff --git a/src/test/debuginfo/borrowed-managed-basic.rs b/src/test/debuginfo/borrowed-managed-basic.rs index 0f81e530fdd..82e44b46d3c 100644 --- a/src/test/debuginfo/borrowed-managed-basic.rs +++ b/src/test/debuginfo/borrowed-managed-basic.rs @@ -16,6 +16,9 @@ // its numerical value. // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run // gdb-command:finish @@ -61,6 +64,56 @@ // gdb-command:print *f64_ref // gdb-check:$14 = 3.5 + +// === LLDB TESTS ================================================================================== + +// lldb-command:type format add -f decimal char +// lldb-command:type format add -f decimal 'unsigned char' +// lldb-command:run + +// lldb-command:print *bool_ref +// lldb-check:[...]$0 = true + +// lldb-command:print *int_ref +// lldb-check:[...]$1 = -1 + +// LLDB can't handle 32bit chars yet +// d ebugger:print *char_ref +// c heck:[...]$x = 97 + +// lldb-command:print *i8_ref +// lldb-check:[...]$2 = 68 + +// lldb-command:print *i16_ref +// lldb-check:[...]$3 = -16 + +// lldb-command:print *i32_ref +// lldb-check:[...]$4 = -32 + +// lldb-command:print *i64_ref +// lldb-check:[...]$5 = -64 + +// lldb-command:print *uint_ref +// lldb-check:[...]$6 = 1 + +// lldb-command:print *u8_ref +// lldb-check:[...]$7 = 100 + +// lldb-command:print *u16_ref +// lldb-check:[...]$8 = 16 + +// lldb-command:print *u32_ref +// lldb-check:[...]$9 = 32 + +// lldb-command:print *u64_ref +// lldb-check:[...]$10 = 64 + +// lldb-command:print *f32_ref +// lldb-check:[...]$11 = 2.5 + +// lldb-command:print *f64_ref +// lldb-check:[...]$12 = 3.5 + #![allow(unused_variable)] use std::gc::{Gc, GC}; @@ -107,7 +160,8 @@ fn main() { let f64_box: Gc = box(GC) 3.5; let f64_ref: &f64 = f64_box; - zzz(); + + zzz(); // #break } fn zzz() {()} diff --git a/src/test/debuginfo/borrowed-struct.rs b/src/test/debuginfo/borrowed-struct.rs index 98b66098862..5ad0fe89d2c 100644 --- a/src/test/debuginfo/borrowed-struct.rs +++ b/src/test/debuginfo/borrowed-struct.rs @@ -9,8 +9,10 @@ // except according to those terms. // ignore-android: FIXME(#10381) - // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run // gdb-command:finish @@ -45,6 +47,41 @@ // gdb-command:print *unique_val_interior_ref_2 // gdb-check:$10 = 26.5 + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print *stack_val_ref +// lldb-check:[...]$0 = SomeStruct { x: 10, y: 23.5 } + +// lldb-command:print *stack_val_interior_ref_1 +// lldb-check:[...]$1 = 10 + +// lldb-command:print *stack_val_interior_ref_2 +// lldb-check:[...]$2 = 23.5 + +// lldb-command:print *ref_to_unnamed +// lldb-check:[...]$3 = SomeStruct { x: 11, y: 24.5 } + +// lldb-command:print *managed_val_ref +// lldb-check:[...]$4 = SomeStruct { x: 12, y: 25.5 } + +// lldb-command:print *managed_val_interior_ref_1 +// lldb-check:[...]$5 = 12 + +// lldb-command:print *managed_val_interior_ref_2 +// lldb-check:[...]$6 = 25.5 + +// lldb-command:print *unique_val_ref +// lldb-check:[...]$7 = SomeStruct { x: 13, y: 26.5 } + +// lldb-command:print *unique_val_interior_ref_1 +// lldb-check:[...]$8 = 13 + +// lldb-command:print *unique_val_interior_ref_2 +// lldb-check:[...]$9 = 26.5 + #![feature(managed_boxes)] #![allow(unused_variable)] @@ -72,7 +109,7 @@ fn main() { let unique_val_interior_ref_1: &int = &unique_val.x; let unique_val_interior_ref_2: &f64 = &unique_val.y; - zzz(); + zzz(); // #break } fn zzz() {()} diff --git a/src/test/debuginfo/borrowed-tuple.rs b/src/test/debuginfo/borrowed-tuple.rs index b88161e4a0b..5c20c7471ec 100644 --- a/src/test/debuginfo/borrowed-tuple.rs +++ b/src/test/debuginfo/borrowed-tuple.rs @@ -13,6 +13,9 @@ #![feature(managed_boxes)] // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run // gdb-command:finish @@ -29,6 +32,24 @@ // gdb-command:print *unique_val_ref // gdb-check:$4 = {-17, -22} + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print *stack_val_ref +// lldb-check:[...]$0 = (-14, -19) + +// lldb-command:print *ref_to_unnamed +// lldb-check:[...]$1 = (-15, -20) + +// lldb-command:print *managed_val_ref +// lldb-check:[...]$2 = (-16, -21) + +// lldb-command:print *unique_val_ref +// lldb-check:[...]$3 = (-17, -22) + + #![allow(unused_variable)] use std::gc::{Gc, GC}; @@ -44,7 +65,7 @@ fn main() { let unique_val: Box<(i16, f32)> = box() (-17, -22f32); let unique_val_ref: &(i16, f32) = unique_val; - zzz(); + zzz(); // #break } fn zzz() {()} diff --git a/src/test/debuginfo/borrowed-unique-basic.rs b/src/test/debuginfo/borrowed-unique-basic.rs index 6e8fa62ed26..821c85fdcf3 100644 --- a/src/test/debuginfo/borrowed-unique-basic.rs +++ b/src/test/debuginfo/borrowed-unique-basic.rs @@ -14,6 +14,9 @@ // its numerical value. // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run // gdb-command:finish @@ -59,6 +62,55 @@ // gdb-command:print *f64_ref // gdb-check:$14 = 3.5 + +// === LLDB TESTS ================================================================================== + +// lldb-command:type format add -f decimal char +// lldb-command:type format add -f decimal 'unsigned char' +// lldb-command:run + +// lldb-command:print *bool_ref +// lldb-check:[...]$0 = true + +// lldb-command:print *int_ref +// lldb-check:[...]$1 = -1 + +// d ebugger:print *char_ref +// c heck:[...]$3 = 97 + +// lldb-command:print *i8_ref +// lldb-check:[...]$2 = 68 + +// lldb-command:print *i16_ref +// lldb-check:[...]$3 = -16 + +// lldb-command:print *i32_ref +// lldb-check:[...]$4 = -32 + +// lldb-command:print *i64_ref +// lldb-check:[...]$5 = -64 + +// lldb-command:print *uint_ref +// lldb-check:[...]$6 = 1 + +// lldb-command:print *u8_ref +// lldb-check:[...]$7 = 100 + +// lldb-command:print *u16_ref +// lldb-check:[...]$8 = 16 + +// lldb-command:print *u32_ref +// lldb-check:[...]$9 = 32 + +// lldb-command:print *u64_ref +// lldb-check:[...]$10 = 64 + +// lldb-command:print *f32_ref +// lldb-check:[...]$11 = 2.5 + +// lldb-command:print *f64_ref +// lldb-check:[...]$12 = 3.5 + #![allow(unused_variable)] @@ -104,7 +156,8 @@ fn main() { let f64_box: Box = box 3.5; let f64_ref: &f64 = f64_box; - zzz(); + + zzz(); // #break } fn zzz() {()} diff --git a/src/test/debuginfo/box.rs b/src/test/debuginfo/box.rs index dcfe1804510..5b799b25bbf 100644 --- a/src/test/debuginfo/box.rs +++ b/src/test/debuginfo/box.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:set print pretty off // gdb-command:rbreak zzz // gdb-command:run @@ -24,6 +27,19 @@ // gdb-command:print d->val // gdb-check:$4 = false + +// === LLDB TESTS ================================================================================== + +// lldb-command:run +// lldb-command:print *a +// lldb-check:[...]$0 = 1 +// lldb-command:print *b +// lldb-check:[...]$1 = (2, 3.5) +// lldb-command:print c->val +// lldb-check:[...]$2 = 4 +// lldb-command:print d->val +// lldb-check:[...]$3 = false + #![feature(managed_boxes)] #![allow(unused_variable)] @@ -34,7 +50,8 @@ fn main() { let b = box() (2i, 3.5f64); let c = box(GC) 4i; let d = box(GC) false; - _zzz(); + + zzz(); // #break } -fn _zzz() {()} +fn zzz() { () } diff --git a/src/test/debuginfo/boxed-struct.rs b/src/test/debuginfo/boxed-struct.rs index f583016b93f..0e958545fb3 100644 --- a/src/test/debuginfo/boxed-struct.rs +++ b/src/test/debuginfo/boxed-struct.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run // gdb-command:finish @@ -27,6 +30,23 @@ // gdb-command:print managed_dtor->val // gdb-check:$4 = {x = 33, y = 333, z = 3333, w = 33333} + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print *unique +// lldb-check:[...]$0 = StructWithSomePadding { x: 99, y: 999, z: 9999, w: 99999 } + +// lldb-command:print managed->val +// lldb-check:[...]$1 = StructWithSomePadding { x: 88, y: 888, z: 8888, w: 88888 } + +// lldb-command:print *unique_dtor +// lldb-check:[...]$2 = StructWithDestructor { x: 77, y: 777, z: 7777, w: 77777 } + +// lldb-command:print managed_dtor->val +// lldb-check:[...]$3 = StructWithDestructor { x: 33, y: 333, z: 3333, w: 33333 } + #![feature(managed_boxes)] #![allow(unused_variable)] @@ -58,7 +78,7 @@ fn main() { let unique_dtor = box StructWithDestructor { x: 77, y: 777, z: 7777, w: 77777 }; let managed_dtor = box(GC) StructWithDestructor { x: 33, y: 333, z: 3333, w: 33333 }; - zzz(); + zzz(); // #break } -fn zzz() {()} +fn zzz() { () } diff --git a/src/test/debuginfo/by-value-non-immediate-argument.rs b/src/test/debuginfo/by-value-non-immediate-argument.rs index 873e0623521..2e1c4c79af0 100644 --- a/src/test/debuginfo/by-value-non-immediate-argument.rs +++ b/src/test/debuginfo/by-value-non-immediate-argument.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run @@ -43,6 +46,35 @@ // gdb-check:$7 = {{Case1, x = 0, y = 8970181431921507452}, {Case1, 0, 2088533116, 2088533116}} // gdb-command:continue + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print s +// lldb-check:[...]$0 = Struct { a: 1, b: 2.5 } +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$1 = Struct { a: 3, b: 4.5 } +// lldb-command:print y +// lldb-check:[...]$2 = 5 +// lldb-command:print z +// lldb-check:[...]$3 = 6.5 +// lldb-command:continue + +// lldb-command:print a +// lldb-check:[...]$4 = (7, 8, 9.5, 10.5) +// lldb-command:continue + +// lldb-command:print a +// lldb-check:[...]$5 = Newtype(11.5, 12.5, 13, 14) +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$6 = Case1 { x: 0, y: 8970181431921507452 } +// lldb-command:continue + #![feature(struct_variant)] #[deriving(Clone)] @@ -58,21 +90,21 @@ struct StructStruct { } fn fun(s: Struct) { - zzz(); + zzz(); // #break } fn fun_fun(StructStruct { a: x, b: Struct { a: y, b: z } }: StructStruct) { - zzz(); + zzz(); // #break } fn tup(a: (int, uint, f64, f64)) { - zzz(); + zzz(); // #break } struct Newtype(f64, f64, int, uint); fn new_type(a: Newtype) { - zzz(); + zzz(); // #break } // The first element is to ensure proper alignment, irrespective of the machines word size. Since @@ -84,7 +116,7 @@ enum Enum { } fn by_val_enum(x: Enum) { - zzz(); + zzz(); // #break } fn main() { @@ -100,4 +132,4 @@ fn main() { by_val_enum(Case1 { x: 0, y: 8970181431921507452 }); } -fn zzz() {()} +fn zzz() { () } diff --git a/src/test/debuginfo/by-value-self-argument-in-trait-impl.rs b/src/test/debuginfo/by-value-self-argument-in-trait-impl.rs index 0da2d44d5ae..4d6064c185b 100644 --- a/src/test/debuginfo/by-value-self-argument-in-trait-impl.rs +++ b/src/test/debuginfo/by-value-self-argument-in-trait-impl.rs @@ -13,6 +13,9 @@ #![feature(managed_boxes)] // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run @@ -36,6 +39,27 @@ // gdb-check:$4 = 8888 // gdb-command:continue + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print self +// lldb-check:[...]$0 = 1111 +// lldb-command:continue + +// lldb-command:print self +// lldb-check:[...]$1 = Struct { x: 2222, y: 3333 } +// lldb-command:continue + +// lldb-command:print self +// lldb-check:[...]$2 = (4444.5, 5555, 6666, 7777.5) +// lldb-command:continue + +// lldb-command:print self->val +// lldb-check:[...]$3 = 8888 +// lldb-command:continue + use std::gc::{Gc, GC}; trait Trait { @@ -44,7 +68,7 @@ trait Trait { impl Trait for int { fn method(self) -> int { - zzz(); + zzz(); // #break self } } @@ -56,21 +80,21 @@ struct Struct { impl Trait for Struct { fn method(self) -> Struct { - zzz(); + zzz(); // #break self } } impl Trait for (f64, int, int, f64) { fn method(self) -> (f64, int, int, f64) { - zzz(); + zzz(); // #break self } } impl Trait for Gc { fn method(self) -> Gc { - zzz(); + zzz(); // #break self } } @@ -82,4 +106,4 @@ fn main() { let _ = (box(GC) 8888).method(); } -fn zzz() {()} +fn zzz() { () } diff --git a/src/test/debuginfo/c-style-enum-in-composite.rs b/src/test/debuginfo/c-style-enum-in-composite.rs index 3e76bf1987b..f7351728290 100644 --- a/src/test/debuginfo/c-style-enum-in-composite.rs +++ b/src/test/debuginfo/c-style-enum-in-composite.rs @@ -8,9 +8,13 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-tidy-linelength // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run // gdb-command:finish @@ -36,6 +40,31 @@ // gdb-command:print struct_with_drop // gdb-check:$7 = {{a = OneHundred, b = Vienna}, 9} + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print tuple_interior_padding +// lldb-check:[...]$0 = (0, OneHundred) + +// lldb-command:print tuple_padding_at_end +// lldb-check:[...]$1 = ((1, OneThousand), 2) +// lldb-command:print tuple_different_enums +// lldb-check:[...]$2 = (OneThousand, MountainView, OneMillion, Vienna) + +// lldb-command:print padded_struct +// lldb-check:[...]$3 = PaddedStruct { a: 3, b: OneMillion, c: 4, d: Toronto, e: 5 } + +// lldb-command:print packed_struct +// lldb-check:[...]$4 = PackedStruct { a: 6, b: OneHundred, c: 7, d: Vienna, e: 8 } + +// lldb-command:print non_padded_struct +// lldb-check:[...]$5 = NonPaddedStruct { a: OneMillion, b: MountainView, c: OneThousand, d: Toronto } + +// lldb-command:print struct_with_drop +// lldb-check:[...]$6 = (StructWithDrop { a: OneHundred, b: Vienna }, 9) + #![allow(unused_variable)] enum AnEnum { @@ -115,7 +144,7 @@ fn main() { let struct_with_drop = (StructWithDrop { a: OneHundred, b: Vienna }, 9_i64); - zzz(); + zzz(); // #break } -fn zzz() {()} +fn zzz() { () } diff --git a/src/test/debuginfo/c-style-enum.rs b/src/test/debuginfo/c-style-enum.rs index 19f8398f1a9..da30363f271 100644 --- a/src/test/debuginfo/c-style-enum.rs +++ b/src/test/debuginfo/c-style-enum.rs @@ -12,6 +12,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:print 'c-style-enum::SINGLE_VARIANT' @@ -71,6 +74,32 @@ // gdb-command:print 'c-style-enum::MANUAL_THREE' // gdb-check:$18 = OneMillion + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print auto_one +// lldb-check:[...]$0 = One + +// lldb-command:print auto_two +// lldb-check:[...]$1 = Two + +// lldb-command:print auto_three +// lldb-check:[...]$2 = Three + +// lldb-command:print manual_one_hundred +// lldb-check:[...]$3 = OneHundred + +// lldb-command:print manual_one_thousand +// lldb-check:[...]$4 = OneThousand + +// lldb-command:print manual_one_million +// lldb-check:[...]$5 = OneMillion + +// lldb-command:print single_variant +// lldb-check:[...]$6 = TheOnlyVariant + #![allow(unused_variable)] #![allow(dead_code)] @@ -120,11 +149,11 @@ fn main() { MANUAL_THREE = OneMillion; }; - zzz(); + zzz(); // #break let a = SINGLE_VARIANT; let a = unsafe { AUTO_ONE }; let a = unsafe { MANUAL_ONE }; } -fn zzz() {()} +fn zzz() { () } diff --git a/src/test/debuginfo/closure-in-generic-function.rs b/src/test/debuginfo/closure-in-generic-function.rs index cc241040f2b..67601221e7a 100644 --- a/src/test/debuginfo/closure-in-generic-function.rs +++ b/src/test/debuginfo/closure-in-generic-function.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run @@ -28,10 +31,27 @@ // gdb-check:$4 = 110 // gdb-command:continue + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print x +// lldb-check:[...]$0 = 0.5 +// lldb-command:print y +// lldb-check:[...]$1 = 10 +// lldb-command:continue + +// lldb-command:print *x +// lldb-check:[...]$2 = 29 +// lldb-command:print *y +// lldb-check:[...]$3 = 110 +// lldb-command:continue + fn some_generic_fun(a: T1, b: T2) -> (T2, T1) { let closure = |x, y| { - zzz(); + zzz(); // #break (y, x) }; @@ -43,4 +63,4 @@ fn main() { some_generic_fun(&29i, box 110i); } -fn zzz() {()} +fn zzz() { () } diff --git a/src/test/debuginfo/destructured-fn-argument.rs b/src/test/debuginfo/destructured-fn-argument.rs index 697703034f6..48d14a46c83 100644 --- a/src/test/debuginfo/destructured-fn-argument.rs +++ b/src/test/debuginfo/destructured-fn-argument.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run @@ -181,6 +184,154 @@ // gdb-check:$49 = 62 // gdb-command:continue + +// === LLDB TESTS ================================================================================== +// lldb-command:run + +// lldb-command:print a +// lldb-check:[...]$0 = 1 +// lldb-command:print b +// lldb-check:[...]$1 = false +// lldb-command:continue + +// lldb-command:print a +// lldb-check:[...]$2 = 2 +// lldb-command:print b +// lldb-check:[...]$3 = 3 +// lldb-command:print c +// lldb-check:[...]$4 = 4 +// lldb-command:continue + +// lldb-command:print a +// lldb-check:[...]$5 = 5 +// lldb-command:print b +// lldb-check:[...]$6 = (6, 7) +// lldb-command:continue + +// lldb-command:print h +// lldb-check:[...]$7 = 8 +// lldb-command:print i +// lldb-check:[...]$8 = Struct { a: 9, b: 10 } +// lldb-command:print j +// lldb-check:[...]$9 = 11 +// lldb-command:continue + +// lldb-command:print k +// lldb-check:[...]$10 = 12 +// lldb-command:print l +// lldb-check:[...]$11 = 13 +// lldb-command:continue + +// lldb-command:print m +// lldb-check:[...]$12 = 14 +// lldb-command:print n +// lldb-check:[...]$13 = 16 +// lldb-command:continue + +// lldb-command:print o +// lldb-check:[...]$14 = 18 +// lldb-command:continue + +// lldb-command:print p +// lldb-check:[...]$15 = 19 +// lldb-command:print q +// lldb-check:[...]$16 = 20 +// lldb-command:print r +// lldb-check:[...]$17 = Struct { a: 21, b: 22 } +// lldb-command:continue + +// lldb-command:print s +// lldb-check:[...]$18 = 24 +// lldb-command:print t +// lldb-check:[...]$19 = 23 +// lldb-command:continue + +// lldb-command:print u +// lldb-check:[...]$20 = 25 +// lldb-command:print v +// lldb-check:[...]$21 = 26 +// lldb-command:print w +// lldb-check:[...]$22 = 27 +// lldb-command:print x +// lldb-check:[...]$23 = 28 +// lldb-command:print y +// lldb-check:[...]$24 = 29 +// lldb-command:print z +// lldb-check:[...]$25 = 30 +// lldb-command:print ae +// lldb-check:[...]$26 = 31 +// lldb-command:print oe +// lldb-check:[...]$27 = 32 +// lldb-command:print ue +// lldb-check:[...]$28 = 33 +// lldb-command:continue + +// lldb-command:print aa +// lldb-check:[...]$29 = (34, 35) +// lldb-command:continue + +// lldb-command:print bb +// lldb-check:[...]$30 = (36, 37) +// lldb-command:continue + +// lldb-command:print cc +// lldb-check:[...]$31 = 38 +// lldb-command:continue + +// lldb-command:print dd +// lldb-check:[...]$32 = (40, 41, 42) +// lldb-command:continue + +// lldb-command:print *ee +// lldb-check:[...]$33 = (43, 44, 45) +// lldb-command:continue + +// lldb-command:print *ff +// lldb-check:[...]$34 = 46 +// lldb-command:print gg +// lldb-check:[...]$35 = (47, 48) +// lldb-command:continue + +// lldb-command:print *hh +// lldb-check:[...]$36 = 50 +// lldb-command:continue + +// lldb-command:print ii +// lldb-check:[...]$37 = 51 +// lldb-command:continue + +// lldb-command:print *jj +// lldb-check:[...]$38 = 52 +// lldb-command:continue + +// lldb-command:print kk +// lldb-check:[...]$39 = 53 +// lldb-command:print ll +// lldb-check:[...]$40 = 54 +// lldb-command:continue + +// lldb-command:print mm +// lldb-check:[...]$41 = 55 +// lldb-command:print *nn +// lldb-check:[...]$42 = 56 +// lldb-command:continue + +// lldb-command:print oo +// lldb-check:[...]$43 = 57 +// lldb-command:print pp +// lldb-check:[...]$44 = 58 +// lldb-command:print qq +// lldb-check:[...]$45 = 59 +// lldb-command:continue + +// lldb-command:print rr +// lldb-check:[...]$46 = 60 +// lldb-command:print ss +// lldb-check:[...]$47 = 61 +// lldb-command:print tt +// lldb-check:[...]$48 = 62 +// lldb-command:continue + #![allow(unused_variable)] @@ -197,93 +348,93 @@ struct TupleStruct (f64, int); fn simple_tuple((a, b): (int, bool)) { - zzz(); + zzz(); // #break } fn nested_tuple((a, (b, c)): (int, (u16, u16))) { - zzz(); + zzz(); // #break } fn destructure_only_first_level((a, b): (int, (u32, u32))) { - zzz(); + zzz(); // #break } fn struct_as_tuple_element((h, i, j): (i16, Struct, i16)) { - zzz(); + zzz(); // #break } fn struct_pattern(Struct { a: k, b: l }: Struct) { - zzz(); + zzz(); // #break } fn ignored_tuple_element((m, _, n): (int, u16, i32)) { - zzz(); + zzz(); // #break } fn ignored_struct_field(Struct { b: o, .. }: Struct) { - zzz(); + zzz(); // #break } fn one_struct_destructured_one_not((Struct { a: p, b: q }, r): (Struct, Struct)) { - zzz(); + zzz(); // #break } fn different_order_of_struct_fields(Struct { b: s, a: t }: Struct ) { - zzz(); + zzz(); // #break } fn complex_nesting(((u, v ), ((w, (x, Struct { a: y, b: z})), Struct { a: ae, b: oe }), ue ): ((i16, i32), ((i64, (i32, Struct, )), Struct ), u16)) { - zzz(); + zzz(); // #break } fn managed_box(&aa: &(int, int)) { - zzz(); + zzz(); // #break } fn borrowed_pointer(&bb: &(int, int)) { - zzz(); + zzz(); // #break } fn contained_borrowed_pointer((&cc, _): (&int, int)) { - zzz(); + zzz(); // #break } fn unique_pointer(box dd: Box<(int, int, int)>) { - zzz(); + zzz(); // #break } fn ref_binding(ref ee: (int, int, int)) { - zzz(); + zzz(); // #break } fn ref_binding_in_tuple((ref ff, gg): (int, (int, int))) { - zzz(); + zzz(); // #break } fn ref_binding_in_struct(Struct { b: ref hh, .. }: Struct) { - zzz(); + zzz(); // #break } fn univariant_enum(Unit(ii): Univariant) { - zzz(); + zzz(); // #break } fn univariant_enum_with_ref_binding(Unit(ref jj): Univariant) { - zzz(); + zzz(); // #break } fn tuple_struct(TupleStruct(kk, ll): TupleStruct) { - zzz(); + zzz(); // #break } fn tuple_struct_with_ref_binding(TupleStruct(mm, ref nn): TupleStruct) { - zzz(); + zzz(); // #break } fn multiple_arguments((oo, pp): (int, int), qq : int) { - zzz(); + zzz(); // #break } fn main() { @@ -311,11 +462,10 @@ fn main() { multiple_arguments((57, 58), 59); fn nested_function(rr: int, (ss, tt): (int, int)) { - zzz(); + zzz(); // #break } nested_function(60, (61, 62)); } - -fn zzz() {()} +fn zzz() { () } diff --git a/src/test/debuginfo/destructured-local.rs b/src/test/debuginfo/destructured-local.rs index d91d98f4305..837a6dc0622 100644 --- a/src/test/debuginfo/destructured-local.rs +++ b/src/test/debuginfo/destructured-local.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run // gdb-command:finish @@ -125,6 +128,122 @@ // gdb-command:print *nn // gdb-check:$43 = 56 + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print a +// lldb-check:[...]$0 = 1 +// lldb-command:print b +// lldb-check:[...]$1 = false + +// lldb-command:print c +// lldb-check:[...]$2 = 2 +// lldb-command:print d +// lldb-check:[...]$3 = 3 +// lldb-command:print e +// lldb-check:[...]$4 = 4 + +// lldb-command:print f +// lldb-check:[...]$5 = 5 +// lldb-command:print g +// lldb-check:[...]$6 = (6, 7) + +// lldb-command:print h +// lldb-check:[...]$7 = 8 +// lldb-command:print i +// lldb-check:[...]$8 = Struct { a: 9, b: 10 } +// lldb-command:print j +// lldb-check:[...]$9 = 11 + +// lldb-command:print k +// lldb-check:[...]$10 = 12 +// lldb-command:print l +// lldb-check:[...]$11 = 13 + +// lldb-command:print m +// lldb-check:[...]$12 = 14 +// lldb-command:print n +// lldb-check:[...]$13 = 16 + +// lldb-command:print o +// lldb-check:[...]$14 = 18 + +// lldb-command:print p +// lldb-check:[...]$15 = 19 +// lldb-command:print q +// lldb-check:[...]$16 = 20 +// lldb-command:print r +// lldb-check:[...]$17 = Struct { a: 21, b: 22 } + +// lldb-command:print s +// lldb-check:[...]$18 = 24 +// lldb-command:print t +// lldb-check:[...]$19 = 23 + +// lldb-command:print u +// lldb-check:[...]$20 = 25 +// lldb-command:print v +// lldb-check:[...]$21 = 26 +// lldb-command:print w +// lldb-check:[...]$22 = 27 +// lldb-command:print x +// lldb-check:[...]$23 = 28 +// lldb-command:print y +// lldb-check:[...]$24 = 29 +// lldb-command:print z +// lldb-check:[...]$25 = 30 +// lldb-command:print ae +// lldb-check:[...]$26 = 31 +// lldb-command:print oe +// lldb-check:[...]$27 = 32 +// lldb-command:print ue +// lldb-check:[...]$28 = 33 + +// lldb-command:print aa +// lldb-check:[...]$29 = (34, 35) + +// lldb-command:print bb +// lldb-check:[...]$30 = (36, 37) + +// lldb-command:print cc +// lldb-check:[...]$31 = 38 + +// lldb-command:print dd +// lldb-check:[...]$32 = (40, 41, 42) + +// lldb-command:print *ee +// lldb-check:[...]$33 = (43, 44, 45) + +// lldb-command:print *ff +// lldb-check:[...]$34 = 46 + +// lldb-command:print gg +// lldb-check:[...]$35 = (47, 48) + +// lldb-command:print *hh +// lldb-check:[...]$36 = 50 + +// lldb-command:print ii +// lldb-check:[...]$37 = 51 + +// lldb-command:print *jj +// lldb-check:[...]$38 = 52 + +// lldb-command:print kk +// lldb-check:[...]$39 = 53 + +// lldb-command:print ll +// lldb-check:[...]$40 = 54 + +// lldb-command:print mm +// lldb-check:[...]$41 = 55 + +// lldb-command:print *nn +// lldb-check:[...]$42 = 56 + + #![allow(unused_variable)] struct Struct { @@ -204,7 +323,7 @@ fn main() { // tuple struct with ref binding let &TupleStruct(mm, ref nn) = &TupleStruct(55.0, 56); - zzz(); + zzz(); // #break } -fn zzz() {()} +fn zzz() { () } diff --git a/src/test/debuginfo/evec-in-struct.rs b/src/test/debuginfo/evec-in-struct.rs index 913038c44be..b5ce865a4aa 100644 --- a/src/test/debuginfo/evec-in-struct.rs +++ b/src/test/debuginfo/evec-in-struct.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:set print pretty off // gdb-command:rbreak zzz // gdb-command:run @@ -30,6 +33,25 @@ // gdb-command:print struct_padded_at_end // gdb-check:$5 = {x = {22, 23}, y = {24, 25}} + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print no_padding1 +// lldb-check:[...]$0 = NoPadding1 { x: [0, 1, 2], y: -3, z: [4.5, 5.5] } +// lldb-command:print no_padding2 +// lldb-check:[...]$1 = NoPadding2 { x: [6, 7, 8], y: [[9, 10], [11, 12]] } + +// lldb-command:print struct_internal_padding +// lldb-check:[...]$2 = StructInternalPadding { x: [13, 14], y: [15, 16] } + +// lldb-command:print single_vec +// lldb-check:[...]$3 = SingleVec { x: [17, 18, 19, 20, 21] } + +// lldb-command:print struct_padded_at_end +// lldb-check:[...]$4 = StructPaddedAtEnd { x: [22, 23], y: [24, 25] } + #![allow(unused_variable)] struct NoPadding1 { @@ -84,7 +106,7 @@ fn main() { y: [24, 25] }; - zzz(); + zzz(); // #break } -fn zzz() {()} +fn zzz() { () } diff --git a/src/test/debuginfo/function-arg-initialization.rs b/src/test/debuginfo/function-arg-initialization.rs index 535efa0b84e..640e04cf71c 100644 --- a/src/test/debuginfo/function-arg-initialization.rs +++ b/src/test/debuginfo/function-arg-initialization.rs @@ -18,18 +18,19 @@ // compile-flags:-g // gdb-command:set print pretty off -// gdb-command:break function-arg-initialization.rs:139 -// gdb-command:break function-arg-initialization.rs:154 -// gdb-command:break function-arg-initialization.rs:158 -// gdb-command:break function-arg-initialization.rs:162 -// gdb-command:break function-arg-initialization.rs:166 -// gdb-command:break function-arg-initialization.rs:170 -// gdb-command:break function-arg-initialization.rs:174 -// gdb-command:break function-arg-initialization.rs:178 -// gdb-command:break function-arg-initialization.rs:182 -// gdb-command:break function-arg-initialization.rs:190 -// gdb-command:break function-arg-initialization.rs:197 +// gdb-command:break function-arg-initialization.rs:243 +// gdb-command:break function-arg-initialization.rs:258 +// gdb-command:break function-arg-initialization.rs:262 +// gdb-command:break function-arg-initialization.rs:266 +// gdb-command:break function-arg-initialization.rs:270 +// gdb-command:break function-arg-initialization.rs:274 +// gdb-command:break function-arg-initialization.rs:278 +// gdb-command:break function-arg-initialization.rs:282 +// gdb-command:break function-arg-initialization.rs:286 +// gdb-command:break function-arg-initialization.rs:294 +// gdb-command:break function-arg-initialization.rs:301 +// === GDB TESTS =================================================================================== // gdb-command:run @@ -130,13 +131,116 @@ // gdb-check:$32 = 45 // gdb-command:continue + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// IMMEDIATE ARGS +// lldb-command:print a +// lldb-check:[...]$0 = 1 +// lldb-command:print b +// lldb-check:[...]$1 = true +// lldb-command:print c +// lldb-check:[...]$2 = 2.5 +// lldb-command:continue + +// NON IMMEDIATE ARGS +// lldb-command:print a +// lldb-check:[...]$3 = BigStruct { a: 3, b: 4, c: 5, d: 6, e: 7, f: 8, g: 9, h: 10 } +// lldb-command:print b +// lldb-check:[...]$4 = BigStruct { a: 11, b: 12, c: 13, d: 14, e: 15, f: 16, g: 17, h: 18 } +// lldb-command:continue + +// BINDING +// lldb-command:print a +// lldb-check:[...]$5 = 19 +// lldb-command:print b +// lldb-check:[...]$6 = 20 +// lldb-command:print c +// lldb-check:[...]$7 = 21.5 +// lldb-command:continue + +// ASSIGNMENT +// lldb-command:print a +// lldb-check:[...]$8 = 22 +// lldb-command:print b +// lldb-check:[...]$9 = 23 +// lldb-command:print c +// lldb-check:[...]$10 = 24.5 +// lldb-command:continue + +// FUNCTION CALL +// lldb-command:print x +// lldb-check:[...]$11 = 25 +// lldb-command:print y +// lldb-check:[...]$12 = 26 +// lldb-command:print z +// lldb-check:[...]$13 = 27.5 +// lldb-command:continue + +// EXPR +// lldb-command:print x +// lldb-check:[...]$14 = 28 +// lldb-command:print y +// lldb-check:[...]$15 = 29 +// lldb-command:print z +// lldb-check:[...]$16 = 30.5 +// lldb-command:continue + +// RETURN EXPR +// lldb-command:print x +// lldb-check:[...]$17 = 31 +// lldb-command:print y +// lldb-check:[...]$18 = 32 +// lldb-command:print z +// lldb-check:[...]$19 = 33.5 +// lldb-command:continue + +// ARITHMETIC EXPR +// lldb-command:print x +// lldb-check:[...]$20 = 34 +// lldb-command:print y +// lldb-check:[...]$21 = 35 +// lldb-command:print z +// lldb-check:[...]$22 = 36.5 +// lldb-command:continue + +// IF EXPR +// lldb-command:print x +// lldb-check:[...]$23 = 37 +// lldb-command:print y +// lldb-check:[...]$24 = 38 +// lldb-command:print z +// lldb-check:[...]$25 = 39.5 +// lldb-command:continue + +// WHILE EXPR +// lldb-command:print x +// lldb-check:[...]$26 = 40 +// lldb-command:print y +// lldb-check:[...]$27 = 41 +// lldb-command:print z +// lldb-check:[...]$28 = 42 +// lldb-command:continue + +// LOOP EXPR +// lldb-command:print x +// lldb-check:[...]$29 = 43 +// lldb-command:print y +// lldb-check:[...]$30 = 44 +// lldb-command:print z +// lldb-check:[...]$31 = 45 +// lldb-command:continue + + + #![allow(unused_variable)] - fn immediate_args(a: int, b: bool, c: f64) { - () + () // #break } struct BigStruct { @@ -151,35 +255,35 @@ struct BigStruct { } fn non_immediate_args(a: BigStruct, b: BigStruct) { - () + () // #break } fn binding(a: i64, b: u64, c: f64) { - let x = 0i; + let x = 0i; // #break } fn assignment(mut a: u64, b: u64, c: f64) { - a = b; + a = b; // #break } fn function_call(x: u64, y: u64, z: f64) { - std::io::stdio::print("Hi!") + std::io::stdio::print("Hi!") // #break } fn identifier(x: u64, y: u64, z: f64) -> u64 { - x + x // #break } fn return_expr(x: u64, y: u64, z: f64) -> u64 { - return x; + return x; // #break } fn arithmetic_expr(x: u64, y: u64, z: f64) -> u64 { - x + y + x + y // #break } fn if_expr(x: u64, y: u64, z: f64) -> u64 { - if x + y < 1000 { + if x + y < 1000 { // #break x } else { y @@ -187,14 +291,14 @@ fn if_expr(x: u64, y: u64, z: f64) -> u64 { } fn while_expr(mut x: u64, y: u64, z: u64) -> u64 { - while x + y < 1000 { + while x + y > 1000 { // #break x += z } return x; } fn loop_expr(mut x: u64, y: u64, z: u64) -> u64 { - loop { + loop { // #break x += z; if x + y > 1000 { diff --git a/src/test/debuginfo/function-arguments.rs b/src/test/debuginfo/function-arguments.rs index e65b9a2519d..69bd5ae1d6c 100644 --- a/src/test/debuginfo/function-arguments.rs +++ b/src/test/debuginfo/function-arguments.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run // gdb-command:finish @@ -28,21 +31,38 @@ // gdb-command:print b // gdb-check:$4 = 3000 + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print x +// lldb-check:[...]$0 = 111102 +// lldb-command:print y +// lldb-check:[...]$1 = true +// lldb-command:continue + +// lldb-command:print a +// lldb-check:[...]$2 = 2000 +// lldb-command:print b +// lldb-check:[...]$3 = 3000 +// lldb-command:continue + fn main() { fun(111102, true); nested(2000, 3000); fn nested(a: i32, b: i64) -> (i32, i64) { - zzz(); + zzz(); // #break (a, b) } } fn fun(x: int, y: bool) -> (int, bool) { - zzz(); + zzz(); // #break (x, y) } -fn zzz() {()} +fn zzz() { () } diff --git a/src/test/debuginfo/function-prologue-stepping-no-split-stack.rs b/src/test/debuginfo/function-prologue-stepping-no-split-stack.rs index 0160a6f1879..05e2c5eb6c7 100644 --- a/src/test/debuginfo/function-prologue-stepping-no-split-stack.rs +++ b/src/test/debuginfo/function-prologue-stepping-no-split-stack.rs @@ -14,9 +14,13 @@ // beginning of a function. Functions with the #[no_split_stack] attribute have the same prologue as // regular C functions compiled with GCC or Clang and therefore are better handled by GDB. As a // consequence, and as opposed to regular Rust functions, we can set the breakpoints via the -// function name (and don't have to fall back on using line numbers). +// function name (and don't have to fall back on using line numbers). For LLDB this shouldn't make +// a difference because it can handle both cases. // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:set print pretty off // gdb-command:rbreak immediate_args // gdb-command:rbreak binding @@ -127,6 +131,119 @@ // gdb-check:$32 = 45 // gdb-command:continue + +// === LLDB TESTS ================================================================================== + +// lldb-command:breakpoint set --name immediate_args +// lldb-command:breakpoint set --name non_immediate_args +// lldb-command:breakpoint set --name binding +// lldb-command:breakpoint set --name assignment +// lldb-command:breakpoint set --name function_call +// lldb-command:breakpoint set --name identifier +// lldb-command:breakpoint set --name return_expr +// lldb-command:breakpoint set --name arithmetic_expr +// lldb-command:breakpoint set --name if_expr +// lldb-command:breakpoint set --name while_expr +// lldb-command:breakpoint set --name loop_expr +// lldb-command:run + +// IMMEDIATE ARGS +// lldb-command:print a +// lldb-check:[...]$0 = 1 +// lldb-command:print b +// lldb-check:[...]$1 = true +// lldb-command:print c +// lldb-check:[...]$2 = 2.5 +// lldb-command:continue + +// NON IMMEDIATE ARGS +// lldb-command:print a +// lldb-check:[...]$3 = BigStruct { a: 3, b: 4, c: 5, d: 6, e: 7, f: 8, g: 9, h: 10 } +// lldb-command:print b +// lldb-check:[...]$4 = BigStruct { a: 11, b: 12, c: 13, d: 14, e: 15, f: 16, g: 17, h: 18 } +// lldb-command:continue + +// BINDING +// lldb-command:print a +// lldb-check:[...]$5 = 19 +// lldb-command:print b +// lldb-check:[...]$6 = 20 +// lldb-command:print c +// lldb-check:[...]$7 = 21.5 +// lldb-command:continue + +// ASSIGNMENT +// lldb-command:print a +// lldb-check:[...]$8 = 22 +// lldb-command:print b +// lldb-check:[...]$9 = 23 +// lldb-command:print c +// lldb-check:[...]$10 = 24.5 +// lldb-command:continue + +// FUNCTION CALL +// lldb-command:print x +// lldb-check:[...]$11 = 25 +// lldb-command:print y +// lldb-check:[...]$12 = 26 +// lldb-command:print z +// lldb-check:[...]$13 = 27.5 +// lldb-command:continue + +// EXPR +// lldb-command:print x +// lldb-check:[...]$14 = 28 +// lldb-command:print y +// lldb-check:[...]$15 = 29 +// lldb-command:print z +// lldb-check:[...]$16 = 30.5 +// lldb-command:continue + +// RETURN EXPR +// lldb-command:print x +// lldb-check:[...]$17 = 31 +// lldb-command:print y +// lldb-check:[...]$18 = 32 +// lldb-command:print z +// lldb-check:[...]$19 = 33.5 +// lldb-command:continue + +// ARITHMETIC EXPR +// lldb-command:print x +// lldb-check:[...]$20 = 34 +// lldb-command:print y +// lldb-check:[...]$21 = 35 +// lldb-command:print z +// lldb-check:[...]$22 = 36.5 +// lldb-command:continue + +// IF EXPR +// lldb-command:print x +// lldb-check:[...]$23 = 37 +// lldb-command:print y +// lldb-check:[...]$24 = 38 +// lldb-command:print z +// lldb-check:[...]$25 = 39.5 +// lldb-command:continue + +// WHILE EXPR +// lldb-command:print x +// lldb-check:[...]$26 = 40 +// lldb-command:print y +// lldb-check:[...]$27 = 41 +// lldb-command:print z +// lldb-check:[...]$28 = 42 +// lldb-command:continue + +// LOOP EXPR +// lldb-command:print x +// lldb-check:[...]$29 = 43 +// lldb-command:print y +// lldb-check:[...]$30 = 44 +// lldb-command:print z +// lldb-check:[...]$31 = 45 +// lldb-command:continue + #![allow(unused_variable)] #[no_split_stack] diff --git a/src/test/debuginfo/function-prologue-stepping-regular.rs b/src/test/debuginfo/function-prologue-stepping-regular.rs new file mode 100644 index 00000000000..7cb9c6bba52 --- /dev/null +++ b/src/test/debuginfo/function-prologue-stepping-regular.rs @@ -0,0 +1,232 @@ +// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// This test case checks if function arguments already have the correct value when breaking at the +// beginning of a function. + +// ignore-gdb +// compile-flags:-g + +// lldb-command:breakpoint set --name immediate_args +// lldb-command:breakpoint set --name non_immediate_args +// lldb-command:breakpoint set --name binding +// lldb-command:breakpoint set --name assignment +// lldb-command:breakpoint set --name function_call +// lldb-command:breakpoint set --name identifier +// lldb-command:breakpoint set --name return_expr +// lldb-command:breakpoint set --name arithmetic_expr +// lldb-command:breakpoint set --name if_expr +// lldb-command:breakpoint set --name while_expr +// lldb-command:breakpoint set --name loop_expr +// lldb-command:run + +// IMMEDIATE ARGS +// lldb-command:print a +// lldb-check:[...]$0 = 1 +// lldb-command:print b +// lldb-check:[...]$1 = true +// lldb-command:print c +// lldb-check:[...]$2 = 2.5 +// lldb-command:continue + +// NON IMMEDIATE ARGS +// lldb-command:print a +// lldb-check:[...]$3 = BigStruct { a: 3, b: 4, c: 5, d: 6, e: 7, f: 8, g: 9, h: 10 } +// lldb-command:print b +// lldb-check:[...]$4 = BigStruct { a: 11, b: 12, c: 13, d: 14, e: 15, f: 16, g: 17, h: 18 } +// lldb-command:continue + +// BINDING +// lldb-command:print a +// lldb-check:[...]$5 = 19 +// lldb-command:print b +// lldb-check:[...]$6 = 20 +// lldb-command:print c +// lldb-check:[...]$7 = 21.5 +// lldb-command:continue + +// ASSIGNMENT +// lldb-command:print a +// lldb-check:[...]$8 = 22 +// lldb-command:print b +// lldb-check:[...]$9 = 23 +// lldb-command:print c +// lldb-check:[...]$10 = 24.5 +// lldb-command:continue + +// FUNCTION CALL +// lldb-command:print x +// lldb-check:[...]$11 = 25 +// lldb-command:print y +// lldb-check:[...]$12 = 26 +// lldb-command:print z +// lldb-check:[...]$13 = 27.5 +// lldb-command:continue + +// EXPR +// lldb-command:print x +// lldb-check:[...]$14 = 28 +// lldb-command:print y +// lldb-check:[...]$15 = 29 +// lldb-command:print z +// lldb-check:[...]$16 = 30.5 +// lldb-command:continue + +// RETURN EXPR +// lldb-command:print x +// lldb-check:[...]$17 = 31 +// lldb-command:print y +// lldb-check:[...]$18 = 32 +// lldb-command:print z +// lldb-check:[...]$19 = 33.5 +// lldb-command:continue + +// ARITHMETIC EXPR +// lldb-command:print x +// lldb-check:[...]$20 = 34 +// lldb-command:print y +// lldb-check:[...]$21 = 35 +// lldb-command:print z +// lldb-check:[...]$22 = 36.5 +// lldb-command:continue + +// IF EXPR +// lldb-command:print x +// lldb-check:[...]$23 = 37 +// lldb-command:print y +// lldb-check:[...]$24 = 38 +// lldb-command:print z +// lldb-check:[...]$25 = 39.5 +// lldb-command:continue + +// WHILE EXPR +// lldb-command:print x +// lldb-check:[...]$26 = 40 +// lldb-command:print y +// lldb-check:[...]$27 = 41 +// lldb-command:print z +// lldb-check:[...]$28 = 42 +// lldb-command:continue + +// LOOP EXPR +// lldb-command:print x +// lldb-check:[...]$29 = 43 +// lldb-command:print y +// lldb-check:[...]$30 = 44 +// lldb-command:print z +// lldb-check:[...]$31 = 45 +// lldb-command:continue + +#![allow(unused_variable)] + +fn immediate_args(a: int, b: bool, c: f64) { + () +} + +struct BigStruct { + a: u64, + b: u64, + c: u64, + d: u64, + e: u64, + f: u64, + g: u64, + h: u64 +} + +fn non_immediate_args(a: BigStruct, b: BigStruct) { + () +} + +fn binding(a: i64, b: u64, c: f64) { + let x = 0i; +} + +fn assignment(mut a: u64, b: u64, c: f64) { + a = b; +} + +fn function_call(x: u64, y: u64, z: f64) { + std::io::stdio::print("Hi!") +} + +fn identifier(x: u64, y: u64, z: f64) -> u64 { + x +} + +fn return_expr(x: u64, y: u64, z: f64) -> u64 { + return x; +} + +fn arithmetic_expr(x: u64, y: u64, z: f64) -> u64 { + x + y +} + +fn if_expr(x: u64, y: u64, z: f64) -> u64 { + if x + y < 1000 { + x + } else { + y + } +} + +fn while_expr(mut x: u64, y: u64, z: u64) -> u64 { + while x + y < 1000 { + x += z + } + return x; +} + +fn loop_expr(mut x: u64, y: u64, z: u64) -> u64 { + loop { + x += z; + + if x + y > 1000 { + return x; + } + } +} + +fn main() { + immediate_args(1, true, 2.5); + + non_immediate_args( + BigStruct { + a: 3, + b: 4, + c: 5, + d: 6, + e: 7, + f: 8, + g: 9, + h: 10 + }, + BigStruct { + a: 11, + b: 12, + c: 13, + d: 14, + e: 15, + f: 16, + g: 17, + h: 18 + } + ); + + binding(19, 20, 21.5); + assignment(22, 23, 24.5); + function_call(25, 26, 27.5); + identifier(28, 29, 30.5); + return_expr(31, 32, 33.5); + arithmetic_expr(34, 35, 36.5); + if_expr(37, 38, 39.5); + while_expr(40, 41, 42); + loop_expr(43, 44, 45); +} diff --git a/src/test/debuginfo/generic-function.rs b/src/test/debuginfo/generic-function.rs index 1777c168d9b..c3996929e7c 100644 --- a/src/test/debuginfo/generic-function.rs +++ b/src/test/debuginfo/generic-function.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run @@ -41,6 +44,36 @@ // gdb-check:$9 = {{5, {a = 6, b = 7.5}}, {{a = 6, b = 7.5}, 5}} // gdb-command:continue + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print *t0 +// lldb-check:[...]$0 = 1 +// lldb-command:print *t1 +// lldb-check:[...]$1 = 2.5 +// lldb-command:print ret +// lldb-check:[...]$2 = ((1, 2.5), (2.5, 1)) +// lldb-command:continue + +// lldb-command:print *t0 +// lldb-check:[...]$3 = 3.5 +// lldb-command:print *t1 +// lldb-check:[...]$4 = 4 +// lldb-command:print ret +// lldb-check:[...]$5 = ((3.5, 4), (4, 3.5)) +// lldb-command:continue + +// lldb-command:print *t0 +// lldb-check:[...]$6 = 5 +// lldb-command:print *t1 +// lldb-check:[...]$7 = Struct { a: 6, b: 7.5 } +// lldb-command:print ret +// lldb-check:[...]$8 = ((5, Struct { a: 6, b: 7.5 }), (Struct { a: 6, b: 7.5 }, 5)) +// lldb-command:continue + + #[deriving(Clone)] struct Struct { a: int, @@ -49,7 +82,7 @@ struct Struct { fn dup_tup(t0: &T0, t1: &T1) -> ((T0, T1), (T1, T0)) { let ret = ((t0.clone(), t1.clone()), (t1.clone(), t0.clone())); - zzz(); + zzz(); // #break ret } diff --git a/src/test/debuginfo/generic-functions-nested.rs b/src/test/debuginfo/generic-functions-nested.rs index 1805405dc1e..2546c2c2339 100644 --- a/src/test/debuginfo/generic-functions-nested.rs +++ b/src/test/debuginfo/generic-functions-nested.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run @@ -42,12 +45,41 @@ // gdb-check:$8 = 2.5 // gdb-command:continue + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print x +// lldb-check:[...]$0 = -1 +// lldb-command:print y +// lldb-check:[...]$1 = 1 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$2 = -1 +// lldb-command:print y +// lldb-check:[...]$3 = 2.5 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$4 = -2.5 +// lldb-command:print y +// lldb-check:[...]$5 = 1 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$6 = -2.5 +// lldb-command:print y +// lldb-check:[...]$7 = 2.5 +// lldb-command:continue + fn outer(a: TA) { inner(a.clone(), 1i); inner(a.clone(), 2.5f64); fn inner(x: TX, y: TY) { - zzz(); + zzz(); // #break } } @@ -56,4 +88,4 @@ fn main() { outer(-2.5f64); } -fn zzz() {()} +fn zzz() { () } diff --git a/src/test/debuginfo/generic-method-on-generic-struct.rs b/src/test/debuginfo/generic-method-on-generic-struct.rs index 9ed1c0175a9..0f05eea6282 100644 --- a/src/test/debuginfo/generic-method-on-generic-struct.rs +++ b/src/test/debuginfo/generic-method-on-generic-struct.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run @@ -20,8 +23,8 @@ // gdb-check:$1 = {x = {8888, -8888}} // gdb-command:print arg1 // gdb-check:$2 = -1 -// gdb-command:print/d arg2 -// gdb-check:$3 = -2 +// gdb-command:print arg2 +// gdb-check:$3 = 2 // gdb-command:continue // STACK BY VAL @@ -64,6 +67,57 @@ // gdb-check:$15 = -10.5 // gdb-command:continue + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// STACK BY REF +// lldb-command:print *self +// lldb-check:[...]$0 = Struct<(u32, i32)> { x: (8888, -8888) } +// lldb-command:print arg1 +// lldb-check:[...]$1 = -1 +// lldb-command:print arg2 +// lldb-check:[...]$2 = 2 +// lldb-command:continue + +// STACK BY VAL +// lldb-command:print self +// lldb-check:[...]$3 = Struct<(u32, i32)> { x: (8888, -8888) } +// lldb-command:print arg1 +// lldb-check:[...]$4 = -3 +// lldb-command:print arg2 +// lldb-check:[...]$5 = -4 +// lldb-command:continue + +// OWNED BY REF +// lldb-command:print *self +// lldb-check:[...]$6 = Struct { x: 1234.5 } +// lldb-command:print arg1 +// lldb-check:[...]$7 = -5 +// lldb-command:print arg2 +// lldb-check:[...]$8 = -6 +// lldb-command:continue + +// OWNED BY VAL +// lldb-command:print self +// lldb-check:[...]$9 = Struct { x: 1234.5 } +// lldb-command:print arg1 +// lldb-check:[...]$10 = -7 +// lldb-command:print arg2 +// lldb-check:[...]$11 = -8 +// lldb-command:continue + +// OWNED MOVED +// lldb-command:print *self +// lldb-check:[...]$12 = Struct { x: 1234.5 } +// lldb-command:print arg1 +// lldb-check:[...]$13 = -9 +// lldb-command:print arg2 +// lldb-check:[...]$14 = -10.5 +// lldb-command:continue + + struct Struct { x: T } @@ -71,24 +125,24 @@ struct Struct { impl Struct { fn self_by_ref(&self, arg1: int, arg2: T2) -> int { - zzz(); + zzz(); // #break arg1 } fn self_by_val(self, arg1: int, arg2: T2) -> int { - zzz(); + zzz(); // #break arg1 } fn self_owned(~self, arg1: int, arg2: T2) -> int { - zzz(); + zzz(); // #break arg1 } } fn main() { let stack = Struct { x: (8888_u32, -8888_i32) }; - let _ = stack.self_by_ref(-1, -2_i8); + let _ = stack.self_by_ref(-1, 2_u16); let _ = stack.self_by_val(-3, -4_i16); let owned = box Struct { x: 1234.5f64 }; diff --git a/src/test/debuginfo/generic-struct.rs b/src/test/debuginfo/generic-struct.rs index a2c5a0973fc..65ccb1314ad 100644 --- a/src/test/debuginfo/generic-struct.rs +++ b/src/test/debuginfo/generic-struct.rs @@ -8,9 +8,13 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-tidy-linelength // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run @@ -24,6 +28,20 @@ // gdb-command:print float_int_float // gdb-check:$4 = {key = 6.5, value = {key = 7, value = 8.5}} +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print int_int +// lldb-check:[...]$0 = AGenericStruct { key: 0, value: 1 } +// lldb-command:print int_float +// lldb-check:[...]$1 = AGenericStruct { key: 2, value: 3.5 } +// lldb-command:print float_int +// lldb-check:[...]$2 = AGenericStruct { key: 4.5, value: 5 } + +// lldb-command:print float_int_float +// lldb-check:[...]$3 = AGenericStruct> { key: 6.5, value: AGenericStruct { key: 7, value: 8.5 } } + struct AGenericStruct { key: TKey, value: TValue @@ -39,7 +57,7 @@ fn main() { value: AGenericStruct { key: 7i, value: 8.5f64 }, }; - zzz(); + zzz(); // #break } -fn zzz() {()} +fn zzz() { () } diff --git a/src/test/debuginfo/generic-tuple-style-enum.rs b/src/test/debuginfo/generic-tuple-style-enum.rs index 07f7546068c..8638ae3b49d 100644 --- a/src/test/debuginfo/generic-tuple-style-enum.rs +++ b/src/test/debuginfo/generic-tuple-style-enum.rs @@ -12,6 +12,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:set print union on // gdb-command:rbreak zzz // gdb-command:run @@ -30,6 +33,23 @@ // gdb-check:$4 = {{-1}} +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print case1 +// lldb-check:[...]$0 = Case1(0, 31868, 31868, 31868, 31868) + +// lldb-command:print case2 +// lldb-check:[...]$1 = Case2(0, 286331153, 286331153) + +// lldb-command:print case3 +// lldb-check:[...]$2 = Case3(0, 6438275382588823897) + +// lldb-command:print univariant +// lldb-check:[...]$3 = TheOnlyCase(-1) + + // NOTE: This is a copy of the non-generic test case. The `Txx` type parameters have to be // substituted with something of size `xx` bits and the same alignment as an integer type of the // same size. @@ -73,7 +93,7 @@ fn main() { let univariant = TheOnlyCase(-1_i64); - zzz(); + zzz(); // #break } -fn zzz() {()} +fn zzz() { () } diff --git a/src/test/debuginfo/include_string.rs b/src/test/debuginfo/include_string.rs index 977e304a32e..ed9767c78f3 100644 --- a/src/test/debuginfo/include_string.rs +++ b/src/test/debuginfo/include_string.rs @@ -15,13 +15,27 @@ // gdb-command:run // gdb-command:finish // gdb-command:print string1.length -// gdb-check:$1 = 49 +// gdb-check:$1 = 48 // gdb-command:print string2.length // gdb-check:$2 = 49 // gdb-command:print string3.length -// gdb-check:$3 = 49 +// gdb-check:$3 = 50 // gdb-command:continue + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print string1.length +// lldb-check:[...]$0 = 48 +// lldb-command:print string2.length +// lldb-check:[...]$1 = 49 +// lldb-command:print string3.length +// lldb-check:[...]$2 = 50 + +// lldb-command:continue + #![allow(unused_variable)] // This test case makes sure that debug info does not ICE when include_str is @@ -31,7 +45,8 @@ fn main() { let string1 = include_str!("text-to-include-1.txt"); let string2 = include_str!("text-to-include-2.txt"); let string3 = include_str!("text-to-include-3.txt"); - zzz(); + + zzz(); // #break } fn zzz() {()} diff --git a/src/test/debuginfo/lexical-scope-in-for-loop.rs b/src/test/debuginfo/lexical-scope-in-for-loop.rs index 0fb823a74cc..13cae3252d8 100644 --- a/src/test/debuginfo/lexical-scope-in-for-loop.rs +++ b/src/test/debuginfo/lexical-scope-in-for-loop.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run @@ -53,6 +56,43 @@ // gdb-check:$7 = 1000000 // gdb-command:continue + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// FIRST ITERATION +// lldb-command:print x +// lldb-check:[...]$0 = 1 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$1 = -1 +// lldb-command:continue + +// SECOND ITERATION +// lldb-command:print x +// lldb-check:[...]$2 = 2 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$3 = -2 +// lldb-command:continue + +// THIRD ITERATION +// lldb-command:print x +// lldb-check:[...]$4 = 3 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$5 = -3 +// lldb-command:continue + +// AFTER LOOP +// lldb-command:print x +// lldb-check:[...]$6 = 1000000 +// lldb-command:continue + fn main() { let range = [1i, 2, 3]; @@ -60,16 +100,16 @@ fn main() { let x = 1000000i; // wan meeeljen doollaars! for &x in range.iter() { - zzz(); + zzz(); // #break sentinel(); let x = -1i * x; - zzz(); + zzz(); // #break sentinel(); } - zzz(); + zzz(); // #break sentinel(); } diff --git a/src/test/debuginfo/lexical-scope-in-if.rs b/src/test/debuginfo/lexical-scope-in-if.rs index 6018e62af00..ce30886c7d3 100644 --- a/src/test/debuginfo/lexical-scope-in-if.rs +++ b/src/test/debuginfo/lexical-scope-in-if.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run @@ -78,47 +81,109 @@ // gdb-check:$16 = -1 // gdb-command:continue + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// BEFORE if +// lldb-command:print x +// lldb-check:[...]$0 = 999 +// lldb-command:print y +// lldb-check:[...]$1 = -1 +// lldb-command:continue + +// AT BEGINNING of 'then' block +// lldb-command:print x +// lldb-check:[...]$2 = 999 +// lldb-command:print y +// lldb-check:[...]$3 = -1 +// lldb-command:continue + +// AFTER 1st redeclaration of 'x' +// lldb-command:print x +// lldb-check:[...]$4 = 1001 +// lldb-command:print y +// lldb-check:[...]$5 = -1 +// lldb-command:continue + +// AFTER 2st redeclaration of 'x' +// lldb-command:print x +// lldb-check:[...]$6 = 1002 +// lldb-command:print y +// lldb-check:[...]$7 = 1003 +// lldb-command:continue + +// AFTER 1st if expression +// lldb-command:print x +// lldb-check:[...]$8 = 999 +// lldb-command:print y +// lldb-check:[...]$9 = -1 +// lldb-command:continue + +// BEGINNING of else branch +// lldb-command:print x +// lldb-check:[...]$10 = 999 +// lldb-command:print y +// lldb-check:[...]$11 = -1 +// lldb-command:continue + +// BEGINNING of else branch +// lldb-command:print x +// lldb-check:[...]$12 = 1004 +// lldb-command:print y +// lldb-check:[...]$13 = 1005 +// lldb-command:continue + +// BEGINNING of else branch +// lldb-command:print x +// lldb-check:[...]$14 = 999 +// lldb-command:print y +// lldb-check:[...]$15 = -1 +// lldb-command:continue + + fn main() { let x = 999i; let y = -1i; - zzz(); + zzz(); // #break sentinel(); if x < 1000 { - zzz(); + zzz(); // #break sentinel(); let x = 1001i; - zzz(); + zzz(); // #break sentinel(); let x = 1002i; let y = 1003i; - zzz(); + zzz(); // #break sentinel(); } else { unreachable!(); } - zzz(); + zzz(); // #break sentinel(); if x > 1000 { unreachable!(); } else { - zzz(); + zzz(); // #break sentinel(); let x = 1004i; let y = 1005i; - zzz(); + zzz(); // #break sentinel(); } - zzz(); + zzz(); // #break sentinel(); } diff --git a/src/test/debuginfo/lexical-scope-in-match.rs b/src/test/debuginfo/lexical-scope-in-match.rs index 7bec677e4b1..78e9b278e53 100644 --- a/src/test/debuginfo/lexical-scope-in-match.rs +++ b/src/test/debuginfo/lexical-scope-in-match.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run @@ -74,6 +77,64 @@ // gdb-check:$18 = 232 // gdb-command:continue + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print shadowed +// lldb-check:[...]$0 = 231 +// lldb-command:print not_shadowed +// lldb-check:[...]$1 = 232 +// lldb-command:continue + +// lldb-command:print shadowed +// lldb-check:[...]$2 = 233 +// lldb-command:print not_shadowed +// lldb-check:[...]$3 = 232 +// lldb-command:print local_to_arm +// lldb-check:[...]$4 = 234 +// lldb-command:continue + +// lldb-command:print shadowed +// lldb-check:[...]$5 = 236 +// lldb-command:print not_shadowed +// lldb-check:[...]$6 = 232 +// lldb-command:continue + +// lldb-command:print shadowed +// lldb-check:[...]$7 = 237 +// lldb-command:print not_shadowed +// lldb-check:[...]$8 = 232 +// lldb-command:print local_to_arm +// lldb-check:[...]$9 = 238 +// lldb-command:continue + +// lldb-command:print shadowed +// lldb-check:[...]$10 = 239 +// lldb-command:print not_shadowed +// lldb-check:[...]$11 = 232 +// lldb-command:continue + +// lldb-command:print shadowed +// lldb-check:[...]$12 = 241 +// lldb-command:print not_shadowed +// lldb-check:[...]$13 = 232 +// lldb-command:continue + +// lldb-command:print shadowed +// lldb-check:[...]$14 = 243 +// lldb-command:print *local_to_arm +// lldb-check:[...]$15 = 244 +// lldb-command:continue + +// lldb-command:print shadowed +// lldb-check:[...]$16 = 231 +// lldb-command:print not_shadowed +// lldb-check:[...]$17 = 232 +// lldb-command:continue + + struct Struct { x: int, y: int @@ -84,13 +145,13 @@ fn main() { let shadowed = 231i; let not_shadowed = 232i; - zzz(); + zzz(); // #break sentinel(); match (233i, 234i) { (shadowed, local_to_arm) => { - zzz(); + zzz(); // #break sentinel(); } } @@ -99,7 +160,7 @@ fn main() { // with literal (235, shadowed) => { - zzz(); + zzz(); // #break sentinel(); } _ => {} @@ -108,7 +169,7 @@ fn main() { match (Struct { x: 237, y: 238 }) { Struct { x: shadowed, y: local_to_arm } => { - zzz(); + zzz(); // #break sentinel(); } } @@ -117,7 +178,7 @@ fn main() { // ignored field Struct { x: shadowed, .. } => { - zzz(); + zzz(); // #break sentinel(); } } @@ -126,7 +187,7 @@ fn main() { // with literal Struct { x: shadowed, y: 242 } => { - zzz(); + zzz(); // #break sentinel(); } _ => {} @@ -135,12 +196,12 @@ fn main() { match (243i, 244i) { (shadowed, ref local_to_arm) => { - zzz(); + zzz(); // #break sentinel(); } } - zzz(); + zzz(); // #break sentinel(); } diff --git a/src/test/debuginfo/lexical-scope-in-stack-closure.rs b/src/test/debuginfo/lexical-scope-in-stack-closure.rs index 0168eaa86c2..aca6cc06abd 100644 --- a/src/test/debuginfo/lexical-scope-in-stack-closure.rs +++ b/src/test/debuginfo/lexical-scope-in-stack-closure.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run @@ -44,34 +47,63 @@ // gdb-check:$6 = false // gdb-command:continue + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print x +// lldb-check:[...]$0 = false +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$1 = false +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$2 = 1000 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$3 = 2.5 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$4 = true +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$5 = false +// lldb-command:continue + fn main() { let x = false; - zzz(); + zzz(); // #break sentinel(); let stack_closure: |int| = |x| { - zzz(); + zzz(); // #break sentinel(); let x = 2.5f64; - zzz(); + zzz(); // #break sentinel(); let x = true; - zzz(); + zzz(); // #break sentinel(); }; - zzz(); + zzz(); // #break sentinel(); stack_closure(1000); - zzz(); + zzz(); // #break sentinel(); } diff --git a/src/test/debuginfo/lexical-scope-in-unconditional-loop.rs b/src/test/debuginfo/lexical-scope-in-unconditional-loop.rs index 48edd7ae12a..3096dfbd2a6 100644 --- a/src/test/debuginfo/lexical-scope-in-unconditional-loop.rs +++ b/src/test/debuginfo/lexical-scope-in-unconditional-loop.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run @@ -82,6 +85,66 @@ // gdb-check:$13 = 2 // gdb-command:continue + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// FIRST ITERATION +// lldb-command:print x +// lldb-check:[...]$0 = 0 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$1 = 1 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$2 = 101 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$3 = 101 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$4 = -987 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$5 = 101 +// lldb-command:continue + + +// SECOND ITERATION +// lldb-command:print x +// lldb-check:[...]$6 = 1 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$7 = 2 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$8 = 102 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$9 = 102 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$10 = -987 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$11 = 102 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$12 = 2 +// lldb-command:continue + fn main() { let mut x = 0i; @@ -91,35 +154,35 @@ fn main() { break; } - zzz(); + zzz(); // #break sentinel(); x += 1; - zzz(); + zzz(); // #break sentinel(); // Shadow x let x = x + 100; - zzz(); + zzz(); // #break sentinel(); // open scope within loop's top level scope { - zzz(); + zzz(); // #break sentinel(); let x = -987i; - zzz(); + zzz(); // #break sentinel(); } // Check that we get the x before the inner scope again - zzz(); + zzz(); // #break sentinel(); } - zzz(); + zzz(); // #break sentinel(); } diff --git a/src/test/debuginfo/lexical-scope-in-unique-closure.rs b/src/test/debuginfo/lexical-scope-in-unique-closure.rs index ce3b2a530e2..590b7238c12 100644 --- a/src/test/debuginfo/lexical-scope-in-unique-closure.rs +++ b/src/test/debuginfo/lexical-scope-in-unique-closure.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run @@ -44,34 +47,63 @@ // gdb-check:$6 = false // gdb-command:continue + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print x +// lldb-check:[...]$0 = false +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$1 = false +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$2 = 1000 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$3 = 2.5 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$4 = true +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$5 = false +// lldb-command:continue + fn main() { let x = false; - zzz(); + zzz(); // #break sentinel(); let unique_closure: proc(int) = proc(x) { - zzz(); + zzz(); // #break sentinel(); let x = 2.5f64; - zzz(); + zzz(); // #break sentinel(); let x = true; - zzz(); + zzz(); // #break sentinel(); }; - zzz(); + zzz(); // #break sentinel(); unique_closure(1000); - zzz(); + zzz(); // #break sentinel(); } diff --git a/src/test/debuginfo/lexical-scope-in-while.rs b/src/test/debuginfo/lexical-scope-in-while.rs index d726eb6581e..b211c11128a 100644 --- a/src/test/debuginfo/lexical-scope-in-while.rs +++ b/src/test/debuginfo/lexical-scope-in-while.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run @@ -82,40 +85,101 @@ // gdb-check:$13 = 2 // gdb-command:continue + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// FIRST ITERATION +// lldb-command:print x +// lldb-check:[...]$0 = 0 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$1 = 1 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$2 = 101 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$3 = 101 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$4 = -987 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$5 = 101 +// lldb-command:continue + + +// SECOND ITERATION +// lldb-command:print x +// lldb-check:[...]$6 = 1 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$7 = 2 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$8 = 102 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$9 = 102 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$10 = -987 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$11 = 102 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$12 = 2 +// lldb-command:continue + + fn main() { let mut x = 0i; while x < 2 { - zzz(); + zzz(); // #break sentinel(); x += 1; - zzz(); + zzz(); // #break sentinel(); // Shadow x let x = x + 100; - zzz(); + zzz(); // #break sentinel(); // open scope within loop's top level scope { - zzz(); + zzz(); // #break sentinel(); let x = -987i; - zzz(); + zzz(); // #break sentinel(); } // Check that we get the x before the inner scope again - zzz(); + zzz(); // #break sentinel(); } - zzz(); + zzz(); // #break sentinel(); } diff --git a/src/test/debuginfo/lexical-scope-with-macro.rs b/src/test/debuginfo/lexical-scope-with-macro.rs index e55271239d4..27070dd867d 100644 --- a/src/test/debuginfo/lexical-scope-with-macro.rs +++ b/src/test/debuginfo/lexical-scope-with-macro.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run @@ -65,6 +68,56 @@ // gdb-check:$15 = 400 // gdb-command:continue + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print a +// lldb-check:[...]$0 = 10 +// lldb-command:print b +// lldb-check:[...]$1 = 34 +// lldb-command:continue + +// lldb-command:print a +// lldb-check:[...]$2 = 890242 +// lldb-command:print b +// lldb-check:[...]$3 = 34 +// lldb-command:continue + +// lldb-command:print a +// lldb-check:[...]$4 = 10 +// lldb-command:print b +// lldb-check:[...]$5 = 34 +// lldb-command:continue + +// lldb-command:print a +// lldb-check:[...]$6 = 102 +// lldb-command:print b +// lldb-check:[...]$7 = 34 +// lldb-command:continue + +// lldb-command:print a +// lldb-check:[...]$8 = 110 +// lldb-command:print b +// lldb-check:[...]$9 = 34 +// lldb-command:continue + +// lldb-command:print a +// lldb-check:[...]$10 = 10 +// lldb-command:print b +// lldb-check:[...]$11 = 34 +// lldb-command:continue + +// lldb-command:print a +// lldb-check:[...]$12 = 10 +// lldb-command:print b +// lldb-check:[...]$13 = 34 +// lldb-command:print c +// lldb-check:[...]$14 = 400 +// lldb-command:continue + + #![feature(macro_rules)] macro_rules! trivial( @@ -78,7 +131,7 @@ macro_rules! no_new_scope( macro_rules! new_scope( () => ({ let a = 890242i; - zzz(); + zzz(); // #break sentinel(); }) ) @@ -87,12 +140,12 @@ macro_rules! shadow_within_macro( ($e1:expr) => ({ let a = $e1 + 2; - zzz(); + zzz(); // #break sentinel(); let a = $e1 + 10; - zzz(); + zzz(); // #break sentinel(); }) ) @@ -108,22 +161,22 @@ fn main() { let a = trivial!(10i); let b = no_new_scope!(33i); - zzz(); + zzz(); // #break sentinel(); new_scope!(); - zzz(); + zzz(); // #break sentinel(); shadow_within_macro!(100i); - zzz(); + zzz(); // #break sentinel(); let c = dup_expr!(10i * 20); - zzz(); + zzz(); // #break sentinel(); } diff --git a/src/test/debuginfo/lexical-scopes-in-block-expression.rs b/src/test/debuginfo/lexical-scopes-in-block-expression.rs index 2a9969dc6e9..b5f9622e79a 100644 --- a/src/test/debuginfo/lexical-scopes-in-block-expression.rs +++ b/src/test/debuginfo/lexical-scopes-in-block-expression.rs @@ -12,6 +12,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run @@ -211,6 +214,164 @@ // gdb-check:$57 = 10 // gdb-command:continue + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// STRUCT EXPRESSION +// lldb-command:print val +// lldb-check:[...]$0 = -1 +// lldb-command:print ten +// lldb-check:[...]$1 = 10 +// lldb-command:continue + +// lldb-command:print val +// lldb-check:[...]$2 = 11 +// lldb-command:print ten +// lldb-check:[...]$3 = 10 +// lldb-command:continue + +// lldb-command:print val +// lldb-check:[...]$4 = -1 +// lldb-command:print ten +// lldb-check:[...]$5 = 10 +// lldb-command:continue + +// FUNCTION CALL +// lldb-command:print val +// lldb-check:[...]$6 = -1 +// lldb-command:print ten +// lldb-check:[...]$7 = 10 +// lldb-command:continue + +// lldb-command:print val +// lldb-check:[...]$8 = 12 +// lldb-command:print ten +// lldb-check:[...]$9 = 10 +// lldb-command:continue + +// lldb-command:print val +// lldb-check:[...]$10 = -1 +// lldb-command:print ten +// lldb-check:[...]$11 = 10 +// lldb-command:continue + +// TUPLE EXPRESSION +// lldb-command:print val +// lldb-check:[...]$12 = -1 +// lldb-command:print ten +// lldb-check:[...]$13 = 10 +// lldb-command:continue + +// lldb-command:print val +// lldb-check:[...]$14 = 13 +// lldb-command:print ten +// lldb-check:[...]$15 = 10 +// lldb-command:continue + +// lldb-command:print val +// lldb-check:[...]$16 = -1 +// lldb-command:print ten +// lldb-check:[...]$17 = 10 +// lldb-command:continue + +// VEC EXPRESSION +// lldb-command:print val +// lldb-check:[...]$18 = -1 +// lldb-command:print ten +// lldb-check:[...]$19 = 10 +// lldb-command:continue + +// lldb-command:print val +// lldb-check:[...]$20 = 14 +// lldb-command:print ten +// lldb-check:[...]$21 = 10 +// lldb-command:continue + +// lldb-command:print val +// lldb-check:[...]$22 = -1 +// lldb-command:print ten +// lldb-check:[...]$23 = 10 +// lldb-command:continue + +// REPEAT VEC EXPRESSION +// lldb-command:print val +// lldb-check:[...]$24 = -1 +// lldb-command:print ten +// lldb-check:[...]$25 = 10 +// lldb-command:continue + +// lldb-command:print val +// lldb-check:[...]$26 = 15 +// lldb-command:print ten +// lldb-check:[...]$27 = 10 +// lldb-command:continue + +// lldb-command:print val +// lldb-check:[...]$28 = -1 +// lldb-command:print ten +// lldb-check:[...]$29 = 10 +// lldb-command:continue + +// ASSIGNMENT EXPRESSION +// lldb-command:print val +// lldb-check:[...]$30 = -1 +// lldb-command:print ten +// lldb-check:[...]$31 = 10 +// lldb-command:continue + +// lldb-command:print val +// lldb-check:[...]$32 = 16 +// lldb-command:print ten +// lldb-check:[...]$33 = 10 +// lldb-command:continue + +// lldb-command:print val +// lldb-check:[...]$34 = -1 +// lldb-command:print ten +// lldb-check:[...]$35 = 10 +// lldb-command:continue + + +// ARITHMETIC EXPRESSION +// lldb-command:print val +// lldb-check:[...]$36 = -1 +// lldb-command:print ten +// lldb-check:[...]$37 = 10 +// lldb-command:continue + +// lldb-command:print val +// lldb-check:[...]$38 = 17 +// lldb-command:print ten +// lldb-check:[...]$39 = 10 +// lldb-command:continue + +// lldb-command:print val +// lldb-check:[...]$40 = -1 +// lldb-command:print ten +// lldb-check:[...]$41 = 10 +// lldb-command:continue + +// INDEX EXPRESSION +// lldb-command:print val +// lldb-check:[...]$42 = -1 +// lldb-command:print ten +// lldb-check:[...]$43 = 10 +// lldb-command:continue + +// lldb-command:print val +// lldb-check:[...]$44 = 18 +// lldb-command:print ten +// lldb-check:[...]$45 = 10 +// lldb-command:continue + +// lldb-command:print val +// lldb-check:[...]$46 = -1 +// lldb-command:print ten +// lldb-check:[...]$47 = 10 +// lldb-command:continue + #![allow(unused_variable)] #![allow(dead_assignment)] @@ -233,13 +394,13 @@ fn main() { // surrounded by struct expression let point = Point { x: { - zzz(); + zzz(); // #break sentinel(); let val = ten + 1; unsafe {MUT_INT = 1;}; - zzz(); + zzz(); // #break sentinel(); val @@ -247,129 +408,129 @@ fn main() { y: 10 }; - zzz(); + zzz(); // #break sentinel(); // surrounded by function call let _ = a_function({ - zzz(); + zzz(); // #break sentinel(); let val = ten + 2; unsafe {MUT_INT = 2;}; - zzz(); + zzz(); // #break sentinel(); val }); - zzz(); + zzz(); // #break sentinel(); // surrounded by tup let _ = ({ - zzz(); + zzz(); // #break sentinel(); let val = ten + 3; unsafe {MUT_INT = 3;}; - zzz(); + zzz(); // #break sentinel(); val }, 0i); - zzz(); + zzz(); // #break sentinel(); // surrounded by vec let _ = [{ - zzz(); + zzz(); // #break sentinel(); let val = ten + 4; unsafe {MUT_INT = 4;}; - zzz(); + zzz(); // #break sentinel(); val }, 0, 0]; - zzz(); + zzz(); // #break sentinel(); // surrounded by repeat vec let _ = [{ - zzz(); + zzz(); // #break sentinel(); let val = ten + 5; unsafe {MUT_INT = 5;}; - zzz(); + zzz(); // #break sentinel(); val }, ..10]; - zzz(); + zzz(); // #break sentinel(); // assignment expression let mut var = 0; var = { - zzz(); + zzz(); // #break sentinel(); let val = ten + 6; unsafe {MUT_INT = 6;}; - zzz(); + zzz(); // #break sentinel(); val }; - zzz(); + zzz(); // #break sentinel(); // arithmetic expression var = 10 + -{ - zzz(); + zzz(); // #break sentinel(); let val = ten + 7; unsafe {MUT_INT = 7;}; - zzz(); + zzz(); // #break sentinel(); val } * 5; - zzz(); + zzz(); // #break sentinel(); // index expression let a_vector = [10i, ..20]; let _ = a_vector[{ - zzz(); + zzz(); // #break sentinel(); let val = ten + 8; unsafe {MUT_INT = 8;}; - zzz(); + zzz(); // #break sentinel(); val as uint }]; - zzz(); + zzz(); // #break sentinel(); } diff --git a/src/test/debuginfo/limited-debuginfo.rs b/src/test/debuginfo/limited-debuginfo.rs index 9cda2c45131..6c71971a0f8 100644 --- a/src/test/debuginfo/limited-debuginfo.rs +++ b/src/test/debuginfo/limited-debuginfo.rs @@ -10,6 +10,8 @@ // ignore-android: FIXME(#10381) +// ignore-lldb + // compile-flags:--debuginfo=1 // Make sure functions have proper names diff --git a/src/test/debuginfo/managed-enum.rs b/src/test/debuginfo/managed-enum.rs index bb236a28a88..2fd43d3e9ca 100644 --- a/src/test/debuginfo/managed-enum.rs +++ b/src/test/debuginfo/managed-enum.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run // gdb-command:finish @@ -24,6 +27,20 @@ // gdb-command:print univariant->val // gdb-check:$3 = {{-9747455}} + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print the_a->val +// lldb-check:[...]$0 = TheA { x: 0, y: 8970181431921507452 } + +// lldb-command:print the_b->val +// lldb-check:[...]$1 = TheB(0, 286331153, 286331153) + +// lldb-command:print univariant->val +// lldb-check:[...]$2 = TheOnlyCase(-9747455) + #![allow(unused_variable)] #![feature(struct_variant, managed_boxes)] @@ -62,7 +79,7 @@ fn main() { let univariant = box(GC) TheOnlyCase(-9747455); - zzz(); + zzz(); // #break } fn zzz() {()} diff --git a/src/test/debuginfo/managed-pointer-within-unique-vec.rs b/src/test/debuginfo/managed-pointer-within-unique-vec.rs index d1f38be1d89..6abd174b1aa 100644 --- a/src/test/debuginfo/managed-pointer-within-unique-vec.rs +++ b/src/test/debuginfo/managed-pointer-within-unique-vec.rs @@ -13,6 +13,9 @@ #![feature(managed_boxes)] // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run // gdb-command:finish @@ -29,6 +32,24 @@ // gdb-command:print unique.ptr[3]->val // gdb-check:$4 = 13 + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print unique.ptr[0]->val +// lldb-check:[...]$0 = 10 + +// lldb-command:print unique.ptr[1]->val +// lldb-check:[...]$1 = 11 + +// lldb-command:print unique.ptr[2]->val +// lldb-check:[...]$2 = 12 + +// lldb-command:print unique.ptr[3]->val +// lldb-check:[...]$3 = 13 + + #![allow(unused_variable)] use std::gc::{Gc, GC}; @@ -37,7 +58,7 @@ fn main() { let unique: Vec> = vec!(box(GC) 10, box(GC) 11, box(GC) 12, box(GC) 13); - zzz(); + zzz(); // #break } fn zzz() {()} diff --git a/src/test/debuginfo/managed-pointer-within-unique.rs b/src/test/debuginfo/managed-pointer-within-unique.rs index cc18ea64f38..7f1b32936c8 100644 --- a/src/test/debuginfo/managed-pointer-within-unique.rs +++ b/src/test/debuginfo/managed-pointer-within-unique.rs @@ -13,6 +13,9 @@ #![feature(managed_boxes)] // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:set print pretty off // gdb-command:rbreak zzz // gdb-command:run @@ -27,6 +30,19 @@ // gdb-command:print managed_within_unique->y->val // gdb-check:$3 = -4 +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print *ordinary_unique +// lldb-check:[...]$0 = (-1, -2) + +// lldb-command:print managed_within_unique->x +// lldb-check:[...]$1 = -3 + +// lldb-command:print managed_within_unique->y->val +// lldb-check:[...]$2 = -4 + #![allow(unused_variable)] use std::gc::{GC, Gc}; @@ -41,7 +57,7 @@ fn main() { let managed_within_unique = box ContainsManaged { x: -3, y: box(GC) -4i }; - zzz(); + zzz(); // #break } fn zzz() {()} diff --git a/src/test/debuginfo/method-on-enum.rs b/src/test/debuginfo/method-on-enum.rs index 1a5fac18a69..f3d723e88bc 100644 --- a/src/test/debuginfo/method-on-enum.rs +++ b/src/test/debuginfo/method-on-enum.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run @@ -64,6 +67,56 @@ // gdb-check:$15 = -10 // gdb-command:continue + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// STACK BY REF +// lldb-command:print *self +// lldb-check:[...]$0 = Variant2(117901063) +// lldb-command:print arg1 +// lldb-check:[...]$1 = -1 +// lldb-command:print arg2 +// lldb-check:[...]$2 = -2 +// lldb-command:continue + +// STACK BY VAL +// lldb-command:print self +// lldb-check:[...]$3 = Variant2(117901063) +// lldb-command:print arg1 +// lldb-check:[...]$4 = -3 +// lldb-command:print arg2 +// lldb-check:[...]$5 = -4 +// lldb-command:continue + +// OWNED BY REF +// lldb-command:print *self +// lldb-check:[...]$6 = Variant1 { x: 1799, y: 1799 } +// lldb-command:print arg1 +// lldb-check:[...]$7 = -5 +// lldb-command:print arg2 +// lldb-check:[...]$8 = -6 +// lldb-command:continue + +// OWNED BY VAL +// lldb-command:print self +// lldb-check:[...]$9 = Variant1 { x: 1799, y: 1799 } +// lldb-command:print arg1 +// lldb-check:[...]$10 = -7 +// lldb-command:print arg2 +// lldb-check:[...]$11 = -8 +// lldb-command:continue + +// OWNED MOVED +// lldb-command:print *self +// lldb-check:[...]$12 = Variant1 { x: 1799, y: 1799 } +// lldb-command:print arg1 +// lldb-check:[...]$13 = -9 +// lldb-command:print arg2 +// lldb-check:[...]$14 = -10 +// lldb-command:continue + #![feature(struct_variant)] enum Enum { @@ -74,17 +127,17 @@ enum Enum { impl Enum { fn self_by_ref(&self, arg1: int, arg2: int) -> int { - zzz(); + zzz(); // #break arg1 + arg2 } fn self_by_val(self, arg1: int, arg2: int) -> int { - zzz(); + zzz(); // #break arg1 + arg2 } fn self_owned(~self, arg1: int, arg2: int) -> int { - zzz(); + zzz(); // #break arg1 + arg2 } } diff --git a/src/test/debuginfo/method-on-generic-struct.rs b/src/test/debuginfo/method-on-generic-struct.rs index 0bac86b1e66..489ea114e1f 100644 --- a/src/test/debuginfo/method-on-generic-struct.rs +++ b/src/test/debuginfo/method-on-generic-struct.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run @@ -64,6 +67,57 @@ // gdb-check:$15 = -10 // gdb-command:continue + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// STACK BY REF +// lldb-command:print *self +// lldb-check:[...]$0 = Struct<(u32, i32)> { x: (8888, -8888) } +// lldb-command:print arg1 +// lldb-check:[...]$1 = -1 +// lldb-command:print arg2 +// lldb-check:[...]$2 = -2 +// lldb-command:continue + +// STACK BY VAL +// lldb-command:print self +// lldb-check:[...]$3 = Struct<(u32, i32)> { x: (8888, -8888) } +// lldb-command:print arg1 +// lldb-check:[...]$4 = -3 +// lldb-command:print arg2 +// lldb-check:[...]$5 = -4 +// lldb-command:continue + +// OWNED BY REF +// lldb-command:print *self +// lldb-check:[...]$6 = Struct { x: 1234.5 } +// lldb-command:print arg1 +// lldb-check:[...]$7 = -5 +// lldb-command:print arg2 +// lldb-check:[...]$8 = -6 +// lldb-command:continue + +// OWNED BY VAL +// lldb-command:print self +// lldb-check:[...]$9 = Struct { x: 1234.5 } +// lldb-command:print arg1 +// lldb-check:[...]$10 = -7 +// lldb-command:print arg2 +// lldb-check:[...]$11 = -8 +// lldb-command:continue + +// OWNED MOVED +// lldb-command:print *self +// lldb-check:[...]$12 = Struct { x: 1234.5 } +// lldb-command:print arg1 +// lldb-check:[...]$13 = -9 +// lldb-command:print arg2 +// lldb-check:[...]$14 = -10 +// lldb-command:continue + + struct Struct { x: T } @@ -71,17 +125,17 @@ struct Struct { impl Struct { fn self_by_ref(&self, arg1: int, arg2: int) -> int { - zzz(); + zzz(); // #break arg1 + arg2 } fn self_by_val(self, arg1: int, arg2: int) -> int { - zzz(); + zzz(); // #break arg1 + arg2 } fn self_owned(~self, arg1: int, arg2: int) -> int { - zzz(); + zzz(); // #break arg1 + arg2 } } diff --git a/src/test/debuginfo/method-on-struct.rs b/src/test/debuginfo/method-on-struct.rs index 3d7cc96ca17..f2db6e3af47 100644 --- a/src/test/debuginfo/method-on-struct.rs +++ b/src/test/debuginfo/method-on-struct.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run @@ -64,6 +67,56 @@ // gdb-check:$15 = -10 // gdb-command:continue + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// STACK BY REF +// lldb-command:print *self +// lldb-check:[...]$0 = Struct { x: 100 } +// lldb-command:print arg1 +// lldb-check:[...]$1 = -1 +// lldb-command:print arg2 +// lldb-check:[...]$2 = -2 +// lldb-command:continue + +// STACK BY VAL +// lldb-command:print self +// lldb-check:[...]$3 = Struct { x: 100 } +// lldb-command:print arg1 +// lldb-check:[...]$4 = -3 +// lldb-command:print arg2 +// lldb-check:[...]$5 = -4 +// lldb-command:continue + +// OWNED BY REF +// lldb-command:print *self +// lldb-check:[...]$6 = Struct { x: 200 } +// lldb-command:print arg1 +// lldb-check:[...]$7 = -5 +// lldb-command:print arg2 +// lldb-check:[...]$8 = -6 +// lldb-command:continue + +// OWNED BY VAL +// lldb-command:print self +// lldb-check:[...]$9 = Struct { x: 200 } +// lldb-command:print arg1 +// lldb-check:[...]$10 = -7 +// lldb-command:print arg2 +// lldb-check:[...]$11 = -8 +// lldb-command:continue + +// OWNED MOVED +// lldb-command:print *self +// lldb-check:[...]$12 = Struct { x: 200 } +// lldb-command:print arg1 +// lldb-check:[...]$13 = -9 +// lldb-command:print arg2 +// lldb-check:[...]$14 = -10 +// lldb-command:continue + struct Struct { x: int } @@ -71,17 +124,17 @@ struct Struct { impl Struct { fn self_by_ref(&self, arg1: int, arg2: int) -> int { - zzz(); + zzz(); // #break self.x + arg1 + arg2 } fn self_by_val(self, arg1: int, arg2: int) -> int { - zzz(); + zzz(); // #break self.x + arg1 + arg2 } fn self_owned(~self, arg1: int, arg2: int) -> int { - zzz(); + zzz(); // #break self.x + arg1 + arg2 } } diff --git a/src/test/debuginfo/method-on-trait.rs b/src/test/debuginfo/method-on-trait.rs index a2b73629a67..e38aace11b9 100644 --- a/src/test/debuginfo/method-on-trait.rs +++ b/src/test/debuginfo/method-on-trait.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run @@ -64,6 +67,56 @@ // gdb-check:$15 = -10 // gdb-command:continue + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// STACK BY REF +// lldb-command:print *self +// lldb-check:[...]$0 = Struct { x: 100 } +// lldb-command:print arg1 +// lldb-check:[...]$1 = -1 +// lldb-command:print arg2 +// lldb-check:[...]$2 = -2 +// lldb-command:continue + +// STACK BY VAL +// lldb-command:print self +// lldb-check:[...]$3 = Struct { x: 100 } +// lldb-command:print arg1 +// lldb-check:[...]$4 = -3 +// lldb-command:print arg2 +// lldb-check:[...]$5 = -4 +// lldb-command:continue + +// OWNED BY REF +// lldb-command:print *self +// lldb-check:[...]$6 = Struct { x: 200 } +// lldb-command:print arg1 +// lldb-check:[...]$7 = -5 +// lldb-command:print arg2 +// lldb-check:[...]$8 = -6 +// lldb-command:continue + +// OWNED BY VAL +// lldb-command:print self +// lldb-check:[...]$9 = Struct { x: 200 } +// lldb-command:print arg1 +// lldb-check:[...]$10 = -7 +// lldb-command:print arg2 +// lldb-check:[...]$11 = -8 +// lldb-command:continue + +// OWNED MOVED +// lldb-command:print *self +// lldb-check:[...]$12 = Struct { x: 200 } +// lldb-command:print arg1 +// lldb-check:[...]$13 = -9 +// lldb-command:print arg2 +// lldb-check:[...]$14 = -10 +// lldb-command:continue + struct Struct { x: int } @@ -77,17 +130,17 @@ trait Trait { impl Trait for Struct { fn self_by_ref(&self, arg1: int, arg2: int) -> int { - zzz(); + zzz(); // #break self.x + arg1 + arg2 } fn self_by_val(self, arg1: int, arg2: int) -> int { - zzz(); + zzz(); // #break self.x + arg1 + arg2 } fn self_owned(~self, arg1: int, arg2: int) -> int { - zzz(); + zzz(); // #break self.x + arg1 + arg2 } } diff --git a/src/test/debuginfo/method-on-tuple-struct.rs b/src/test/debuginfo/method-on-tuple-struct.rs index fe7271716bb..6f8a6182063 100644 --- a/src/test/debuginfo/method-on-tuple-struct.rs +++ b/src/test/debuginfo/method-on-tuple-struct.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run @@ -64,22 +67,72 @@ // gdb-check:$15 = -10 // gdb-command:continue + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// STACK BY REF +// lldb-command:print *self +// lldb-check:[...]$0 = TupleStruct(100, -100.5) +// lldb-command:print arg1 +// lldb-check:[...]$1 = -1 +// lldb-command:print arg2 +// lldb-check:[...]$2 = -2 +// lldb-command:continue + +// STACK BY VAL +// lldb-command:print self +// lldb-check:[...]$3 = TupleStruct(100, -100.5) +// lldb-command:print arg1 +// lldb-check:[...]$4 = -3 +// lldb-command:print arg2 +// lldb-check:[...]$5 = -4 +// lldb-command:continue + +// OWNED BY REF +// lldb-command:print *self +// lldb-check:[...]$6 = TupleStruct(200, -200.5) +// lldb-command:print arg1 +// lldb-check:[...]$7 = -5 +// lldb-command:print arg2 +// lldb-check:[...]$8 = -6 +// lldb-command:continue + +// OWNED BY VAL +// lldb-command:print self +// lldb-check:[...]$9 = TupleStruct(200, -200.5) +// lldb-command:print arg1 +// lldb-check:[...]$10 = -7 +// lldb-command:print arg2 +// lldb-check:[...]$11 = -8 +// lldb-command:continue + +// OWNED MOVED +// lldb-command:print *self +// lldb-check:[...]$12 = TupleStruct(200, -200.5) +// lldb-command:print arg1 +// lldb-check:[...]$13 = -9 +// lldb-command:print arg2 +// lldb-check:[...]$14 = -10 +// lldb-command:continue + struct TupleStruct(int, f64); impl TupleStruct { fn self_by_ref(&self, arg1: int, arg2: int) -> int { - zzz(); + zzz(); // #break arg1 + arg2 } fn self_by_val(self, arg1: int, arg2: int) -> int { - zzz(); + zzz(); // #break arg1 + arg2 } fn self_owned(~self, arg1: int, arg2: int) -> int { - zzz(); + zzz(); // #break arg1 + arg2 } } diff --git a/src/test/debuginfo/multiple-functions-equal-var-names.rs b/src/test/debuginfo/multiple-functions-equal-var-names.rs index 9e40f03c201..1d9427a3bfe 100644 --- a/src/test/debuginfo/multiple-functions-equal-var-names.rs +++ b/src/test/debuginfo/multiple-functions-equal-var-names.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run // gdb-command:finish @@ -28,22 +31,38 @@ // gdb-command:print abc // gdb-check:$3 = 30303 + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print abc +// lldb-check:[...]$0 = 10101 +// lldb-command:continue + +// lldb-command:print abc +// lldb-check:[...]$1 = 20202 +// lldb-command:continue + +// lldb-command:print abc +// lldb-check:[...]$2 = 30303 + #![allow(unused_variable)] fn function_one() { let abc = 10101i; - zzz(); + zzz(); // #break } fn function_two() { let abc = 20202i; - zzz(); + zzz(); // #break } fn function_three() { let abc = 30303i; - zzz(); + zzz(); // #break } diff --git a/src/test/debuginfo/multiple-functions.rs b/src/test/debuginfo/multiple-functions.rs index ef1c69f9eb8..25d9dc02404 100644 --- a/src/test/debuginfo/multiple-functions.rs +++ b/src/test/debuginfo/multiple-functions.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run // gdb-command:finish @@ -28,22 +31,38 @@ // gdb-command:print c // gdb-check:$3 = 30303 + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print a +// lldb-check:[...]$0 = 10101 +// lldb-command:continue + +// lldb-command:print b +// lldb-check:[...]$1 = 20202 +// lldb-command:continue + +// lldb-command:print c +// lldb-check:[...]$2 = 30303 + #![allow(unused_variable)] fn function_one() { let a = 10101i; - zzz(); + zzz(); // #break } fn function_two() { let b = 20202i; - zzz(); + zzz(); // #break } fn function_three() { let c = 30303i; - zzz(); + zzz(); // #break } diff --git a/src/test/debuginfo/name-shadowing-and-scope-nesting.rs b/src/test/debuginfo/name-shadowing-and-scope-nesting.rs index 8ee6d434016..3462735f6d1 100644 --- a/src/test/debuginfo/name-shadowing-and-scope-nesting.rs +++ b/src/test/debuginfo/name-shadowing-and-scope-nesting.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run @@ -56,38 +59,79 @@ // gdb-check:$12 = 20 // gdb-command:continue + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print x +// lldb-check:[...]$0 = false +// lldb-command:print y +// lldb-check:[...]$1 = true +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$2 = 10 +// lldb-command:print y +// lldb-check:[...]$3 = true +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$4 = 10.5 +// lldb-command:print y +// lldb-check:[...]$5 = 20 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$6 = true +// lldb-command:print y +// lldb-check:[...]$7 = 2220 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$8 = 203203.5 +// lldb-command:print y +// lldb-check:[...]$9 = 2220 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$10 = 10.5 +// lldb-command:print y +// lldb-check:[...]$11 = 20 +// lldb-command:continue + fn main() { let x = false; let y = true; - zzz(); + zzz(); // #break sentinel(); let x = 10i; - zzz(); + zzz(); // #break sentinel(); let x = 10.5f64; let y = 20i; - zzz(); + zzz(); // #break sentinel(); { let x = true; let y = 2220i; - zzz(); + zzz(); // #break sentinel(); let x = 203203.5f64; - zzz(); + zzz(); // #break sentinel(); } - zzz(); + zzz(); // #break sentinel(); } diff --git a/src/test/debuginfo/nil-enum.rs b/src/test/debuginfo/nil-enum.rs index 43d82e75c4d..511786999ab 100644 --- a/src/test/debuginfo/nil-enum.rs +++ b/src/test/debuginfo/nil-enum.rs @@ -8,6 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// LLDB can't handle zero-sized values +// ignore-lldb + // ignore-android: FIXME(#10381) // compile-flags:-g diff --git a/src/test/debuginfo/option-like-enum.rs b/src/test/debuginfo/option-like-enum.rs index de6d6814308..f9e2f61564b 100644 --- a/src/test/debuginfo/option-like-enum.rs +++ b/src/test/debuginfo/option-like-enum.rs @@ -12,6 +12,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run // gdb-command:finish @@ -25,17 +28,41 @@ // gdb-command:print full // gdb-check:$3 = {RUST$ENCODED$ENUM$1$Empty = {454545, 0x87654321, 9988}} -// gdb-command:print empty->discr +// gdb-command:print empty_gdb->discr // gdb-check:$4 = (int *) 0x0 // gdb-command:print droid // gdb-check:$5 = {RUST$ENCODED$ENUM$2$Void = {id = 675675, range = 10000001, internals = 0x43218765}} -// gdb-command:print void_droid->internals +// gdb-command:print void_droid_gdb->internals // gdb-check:$6 = (int *) 0x0 // gdb-command:continue + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print some +// lldb-check:[...]$0 = Some(&0x12345678) + +// lldb-command:print none +// lldb-check:[...]$1 = None + +// lldb-command:print full +// lldb-check:[...]$2 = Full(454545, &0x87654321, 9988) + +// lldb-command:print empty +// lldb-check:[...]$3 = Empty + +// lldb-command:print droid +// lldb-check:[...]$4 = Droid { id: 675675, range: 10000001, internals: &0x43218765 } + +// lldb-command:print void_droid +// lldb-check:[...]$5 = Void + + #![feature(struct_variant)] // If a struct has exactly two variants, one of them is empty, and the other one @@ -77,8 +104,8 @@ fn main() { let full = Full(454545, unsafe { std::mem::transmute(0x87654321u) }, 9988); - let int_val = 0i; - let empty: &MoreFieldsRepr = unsafe { std::mem::transmute(&Empty) }; + let empty = Empty; + let empty_gdb: &MoreFieldsRepr = unsafe { std::mem::transmute(&Empty) }; let droid = Droid { id: 675675, @@ -86,9 +113,10 @@ fn main() { internals: unsafe { std::mem::transmute(0x43218765u) } }; - let void_droid: &NamedFieldsRepr = unsafe { std::mem::transmute(&Void) }; + let void_droid = Void; + let void_droid_gdb: &NamedFieldsRepr = unsafe { std::mem::transmute(&Void) }; - zzz(); + zzz(); // #break } fn zzz() {()} diff --git a/src/test/debuginfo/packed-struct-with-destructor.rs b/src/test/debuginfo/packed-struct-with-destructor.rs index 29087b18d5a..215d961b71b 100644 --- a/src/test/debuginfo/packed-struct-with-destructor.rs +++ b/src/test/debuginfo/packed-struct-with-destructor.rs @@ -12,6 +12,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:set print pretty off // gdb-command:rbreak zzz // gdb-command:run @@ -42,6 +45,36 @@ // gdb-command:print deeplyNested // gdb-check:$8 = {a = {a = 1, b = {x = 2, y = 3, z = 4}, c = 5, d = {x = 6, y = 7, z = 8}}, b = {a = 9, b = {x = 10, y = 11, z = 12}, c = {x = 13, y = 14, z = 15}, d = 16}, c = {a = 17, b = {x = 18, y = 19, z = 20}, c = 21, d = {x = 22, y = 23, z = 24}}, d = {a = 25, b = {x = 26, y = 27, z = 28}, c = 29, d = {x = 30, y = 31, z = 32}}, e = {a = 33, b = {x = 34, y = 35, z = 36}, c = {x = 37, y = 38, z = 39}, d = 40}, f = {a = 41, b = {x = 42, y = 43, z = 44}, c = 45, d = {x = 46, y = 47, z = 48}}} + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print packed +// lldb-check:[...]$0 = Packed { x: 123, y: 234, z: 345 } + +// lldb-command:print packedInPacked +// lldb-check:[...]$1 = PackedInPacked { a: 1111, b: Packed { x: 2222, y: 3333, z: 4444 }, c: 5555, d: Packed { x: 6666, y: 7777, z: 8888 } } + +// lldb-command:print packedInUnpacked +// lldb-check:[...]$2 = PackedInUnpacked { a: -1111, b: Packed { x: -2222, y: -3333, z: -4444 }, c: -5555, d: Packed { x: -6666, y: -7777, z: -8888 } } + +// lldb-command:print unpackedInPacked +// lldb-check:[...]$3 = UnpackedInPacked { a: 987, b: Unpacked { x: 876, y: 765, z: 654 }, c: Unpacked { x: 543, y: 432, z: 321 }, d: 210 } + +// lldb-command:print packedInPackedWithDrop +// lldb-check:[...]$4 = PackedInPackedWithDrop { a: 11, b: Packed { x: 22, y: 33, z: 44 }, c: 55, d: Packed { x: 66, y: 77, z: 88 } } + +// lldb-command:print packedInUnpackedWithDrop +// lldb-check:[...]$5 = PackedInUnpackedWithDrop { a: -11, b: Packed { x: -22, y: -33, z: -44 }, c: -55, d: Packed { x: -66, y: -77, z: -88 } } + +// lldb-command:print unpackedInPackedWithDrop +// lldb-check:[...]$6 = UnpackedInPackedWithDrop { a: 98, b: Unpacked { x: 87, y: 76, z: 65 }, c: Unpacked { x: 54, y: 43, z: 32 }, d: 21 } + +// lldb-command:print deeplyNested +// lldb-check:[...]$7 = DeeplyNested { a: PackedInPacked { a: 1, b: Packed { x: 2, y: 3, z: 4 }, c: 5, d: Packed { x: 6, y: 7, z: 8 } }, b: UnpackedInPackedWithDrop { a: 9, b: Unpacked { x: 10, y: 11, z: 12 }, c: Unpacked { x: 13, y: 14, z: 15 }, d: 16 }, c: PackedInUnpacked { a: 17, b: Packed { x: 18, y: 19, z: 20 }, c: 21, d: Packed { x: 22, y: 23, z: 24 } }, d: PackedInUnpackedWithDrop { a: 25, b: Packed { x: 26, y: 27, z: 28 }, c: 29, d: Packed { x: 30, y: 31, z: 32 } }, e: UnpackedInPacked { a: 33, b: Unpacked { x: 34, y: 35, z: 36 }, c: Unpacked { x: 37, y: 38, z: 39 }, d: 40 }, f: PackedInPackedWithDrop { a: 41, b: Packed { x: 42, y: 43, z: 44 }, c: 45, d: Packed { x: 46, y: 47, z: 48 } } } + + #![allow(unused_variable)] #[packed] @@ -216,7 +249,7 @@ fn main() { } }; - zzz(); + zzz(); // #break } fn zzz() {()} diff --git a/src/test/debuginfo/packed-struct.rs b/src/test/debuginfo/packed-struct.rs index bc8156c7385..8201afe3a01 100644 --- a/src/test/debuginfo/packed-struct.rs +++ b/src/test/debuginfo/packed-struct.rs @@ -12,6 +12,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:set print pretty off // gdb-command:rbreak zzz // gdb-command:run @@ -35,6 +38,29 @@ // gdb-command:print sizeof(packedInPacked) // gdb-check:$6 = 40 + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print packed +// lldb-check:[...]$0 = Packed { x: 123, y: 234, z: 345 } + +// lldb-command:print packedInPacked +// lldb-check:[...]$1 = PackedInPacked { a: 1111, b: Packed { x: 2222, y: 3333, z: 4444 }, c: 5555, d: Packed { x: 6666, y: 7777, z: 8888 } } + +// lldb-command:print packedInUnpacked +// lldb-check:[...]$2 = PackedInUnpacked { a: -1111, b: Packed { x: -2222, y: -3333, z: -4444 }, c: -5555, d: Packed { x: -6666, y: -7777, z: -8888 } } + +// lldb-command:print unpackedInPacked +// lldb-check:[...]$3 = UnpackedInPacked { a: 987, b: Unpacked { x: 876, y: 765, z: 654, w: 543 }, c: Unpacked { x: 432, y: 321, z: 210, w: 109 }, d: -98 } + +// lldb-command:print sizeof(packed) +// lldb-check:[...]$4 = 14 + +// lldb-command:print sizeof(packedInPacked) +// lldb-check:[...]$5 = 40 + #![allow(unused_variable)] #[packed] @@ -101,7 +127,7 @@ fn main() { d: -98 }; - zzz(); + zzz(); // #break } fn zzz() {()} diff --git a/src/test/debuginfo/recursive-enum.rs b/src/test/debuginfo/recursive-enum.rs index 68b6764a5a1..4eb251c6084 100644 --- a/src/test/debuginfo/recursive-enum.rs +++ b/src/test/debuginfo/recursive-enum.rs @@ -10,6 +10,8 @@ // ignore-android: FIXME(#10381) +// ignore-lldb + // compile-flags:-g // gdb-command:run diff --git a/src/test/debuginfo/recursive-struct.rs b/src/test/debuginfo/recursive-struct.rs index ea0867903b5..931955ec317 100644 --- a/src/test/debuginfo/recursive-struct.rs +++ b/src/test/debuginfo/recursive-struct.rs @@ -10,6 +10,7 @@ // ignore-tidy-linelength // ignore-android: FIXME(#10381) +// ignore-lldb #![feature(managed_boxes)] diff --git a/src/test/debuginfo/self-in-default-method.rs b/src/test/debuginfo/self-in-default-method.rs index 45cbcf094f4..ddca9bf0792 100644 --- a/src/test/debuginfo/self-in-default-method.rs +++ b/src/test/debuginfo/self-in-default-method.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run @@ -64,23 +67,74 @@ // gdb-check:$15 = -10 // gdb-command:continue + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// STACK BY REF +// lldb-command:print *self +// lldb-check:[...]$0 = Struct { x: 100 } +// lldb-command:print arg1 +// lldb-check:[...]$1 = -1 +// lldb-command:print arg2 +// lldb-check:[...]$2 = -2 +// lldb-command:continue + +// STACK BY VAL +// lldb-command:print self +// lldb-check:[...]$3 = Struct { x: 100 } +// lldb-command:print arg1 +// lldb-check:[...]$4 = -3 +// lldb-command:print arg2 +// lldb-check:[...]$5 = -4 +// lldb-command:continue + +// OWNED BY REF +// lldb-command:print *self +// lldb-check:[...]$6 = Struct { x: 200 } +// lldb-command:print arg1 +// lldb-check:[...]$7 = -5 +// lldb-command:print arg2 +// lldb-check:[...]$8 = -6 +// lldb-command:continue + +// OWNED BY VAL +// lldb-command:print self +// lldb-check:[...]$9 = Struct { x: 200 } +// lldb-command:print arg1 +// lldb-check:[...]$10 = -7 +// lldb-command:print arg2 +// lldb-check:[...]$11 = -8 +// lldb-command:continue + +// OWNED MOVED +// lldb-command:print *self +// lldb-check:[...]$12 = Struct { x: 200 } +// lldb-command:print arg1 +// lldb-check:[...]$13 = -9 +// lldb-command:print arg2 +// lldb-check:[...]$14 = -10 +// lldb-command:continue + + struct Struct { x: int } trait Trait { fn self_by_ref(&self, arg1: int, arg2: int) -> int { - zzz(); + zzz(); // #break arg1 + arg2 } fn self_by_val(self, arg1: int, arg2: int) -> int { - zzz(); + zzz(); // #break arg1 + arg2 } fn self_owned(~self, arg1: int, arg2: int) -> int { - zzz(); + zzz(); // #break arg1 + arg2 } } diff --git a/src/test/debuginfo/self-in-generic-default-method.rs b/src/test/debuginfo/self-in-generic-default-method.rs index 8ab3fd44203..57ffc4a2e19 100644 --- a/src/test/debuginfo/self-in-generic-default-method.rs +++ b/src/test/debuginfo/self-in-generic-default-method.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run @@ -20,8 +23,8 @@ // gdb-check:$1 = {x = 987} // gdb-command:print arg1 // gdb-check:$2 = -1 -// gdb-command:print/d arg2 -// gdb-check:$3 = -2 +// gdb-command:print arg2 +// gdb-check:$3 = 2 // gdb-command:continue // STACK BY VAL @@ -64,6 +67,57 @@ // gdb-check:$15 = -10.5 // gdb-command:continue + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// STACK BY REF +// lldb-command:print *self +// lldb-check:[...]$0 = Struct { x: 987 } +// lldb-command:print arg1 +// lldb-check:[...]$1 = -1 +// lldb-command:print arg2 +// lldb-check:[...]$2 = 2 +// lldb-command:continue + +// STACK BY VAL +// lldb-command:print self +// lldb-check:[...]$3 = Struct { x: 987 } +// lldb-command:print arg1 +// lldb-check:[...]$4 = -3 +// lldb-command:print arg2 +// lldb-check:[...]$5 = -4 +// lldb-command:continue + +// OWNED BY REF +// lldb-command:print *self +// lldb-check:[...]$6 = Struct { x: 879 } +// lldb-command:print arg1 +// lldb-check:[...]$7 = -5 +// lldb-command:print arg2 +// lldb-check:[...]$8 = -6 +// lldb-command:continue + +// OWNED BY VAL +// lldb-command:print self +// lldb-check:[...]$9 = Struct { x: 879 } +// lldb-command:print arg1 +// lldb-check:[...]$10 = -7 +// lldb-command:print arg2 +// lldb-check:[...]$11 = -8 +// lldb-command:continue + +// OWNED MOVED +// lldb-command:print *self +// lldb-check:[...]$12 = Struct { x: 879 } +// lldb-command:print arg1 +// lldb-check:[...]$13 = -9 +// lldb-command:print arg2 +// lldb-check:[...]$14 = -10.5 +// lldb-command:continue + + struct Struct { x: int } @@ -71,17 +125,17 @@ struct Struct { trait Trait { fn self_by_ref(&self, arg1: int, arg2: T) -> int { - zzz(); + zzz(); // #break arg1 } fn self_by_val(self, arg1: int, arg2: T) -> int { - zzz(); + zzz(); // #break arg1 } fn self_owned(~self, arg1: int, arg2: T) -> int { - zzz(); + zzz(); // #break arg1 } } @@ -90,7 +144,7 @@ impl Trait for Struct {} fn main() { let stack = Struct { x: 987 }; - let _ = stack.self_by_ref(-1, -2_i8); + let _ = stack.self_by_ref(-1, 2_u16); let _ = stack.self_by_val(-3, -4_i16); let owned = box Struct { x: 879 }; diff --git a/src/test/debuginfo/shadowed-argument.rs b/src/test/debuginfo/shadowed-argument.rs index c180d6b5bcf..7a9c7c3b372 100644 --- a/src/test/debuginfo/shadowed-argument.rs +++ b/src/test/debuginfo/shadowed-argument.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run @@ -35,19 +38,42 @@ // gdb-check:$6 = 20 // gdb-command:continue + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print x +// lldb-check:[...]$0 = false +// lldb-command:print y +// lldb-check:[...]$1 = true +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$2 = 10 +// lldb-command:print y +// lldb-check:[...]$3 = true +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$4 = 10.5 +// lldb-command:print y +// lldb-check:[...]$5 = 20 +// lldb-command:continue + fn a_function(x: bool, y: bool) { - zzz(); + zzz(); // #break sentinel(); let x = 10i; - zzz(); + zzz(); // #break sentinel(); let x = 10.5f64; let y = 20i; - zzz(); + zzz(); // #break sentinel(); } diff --git a/src/test/debuginfo/shadowed-variable.rs b/src/test/debuginfo/shadowed-variable.rs index 88ef3c4879e..a43bb5e4017 100644 --- a/src/test/debuginfo/shadowed-variable.rs +++ b/src/test/debuginfo/shadowed-variable.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run @@ -35,22 +38,45 @@ // gdb-check:$6 = 20 // gdb-command:continue + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print x +// lldb-check:[...]$0 = false +// lldb-command:print y +// lldb-check:[...]$1 = true +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$2 = 10 +// lldb-command:print y +// lldb-check:[...]$3 = true +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$4 = 10.5 +// lldb-command:print y +// lldb-check:[...]$5 = 20 +// lldb-command:continue + fn main() { let x = false; let y = true; - zzz(); + zzz(); // #break sentinel(); let x = 10i; - zzz(); + zzz(); // #break sentinel(); let x = 10.5f64; let y = 20i; - zzz(); + zzz(); // #break sentinel(); } diff --git a/src/test/debuginfo/simd.rs b/src/test/debuginfo/simd.rs index b84405ee727..eee1d0e70ca 100644 --- a/src/test/debuginfo/simd.rs +++ b/src/test/debuginfo/simd.rs @@ -8,6 +8,9 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// Need a fix for LLDB first... +// ignore-lldb + // ignore-android: FIXME(#10381) // compile-flags:-g diff --git a/src/test/debuginfo/simple-lexical-scope.rs b/src/test/debuginfo/simple-lexical-scope.rs index 107b64131e0..a012ee265d4 100644 --- a/src/test/debuginfo/simple-lexical-scope.rs +++ b/src/test/debuginfo/simple-lexical-scope.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run @@ -50,36 +53,68 @@ // gdb-command:continue +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print x +// lldb-check:[...]$0 = false +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$1 = false +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$2 = 10 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$3 = 10 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$4 = 10.5 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$5 = 10 +// lldb-command:continue + +// lldb-command:print x +// lldb-check:[...]$6 = false +// lldb-command:continue + fn main() { let x = false; - zzz(); + zzz(); // #break sentinel(); { - zzz(); + zzz(); // #break sentinel(); let x = 10i; - zzz(); + zzz(); // #break sentinel(); { - zzz(); + zzz(); // #break sentinel(); let x = 10.5f64; - zzz(); + zzz(); // #break sentinel(); } - zzz(); + zzz(); // #break sentinel(); } - zzz(); + zzz(); // #break sentinel(); } diff --git a/src/test/debuginfo/simple-struct.rs b/src/test/debuginfo/simple-struct.rs index c1f0e2c1f9e..5076673c3a5 100644 --- a/src/test/debuginfo/simple-struct.rs +++ b/src/test/debuginfo/simple-struct.rs @@ -12,6 +12,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:set print pretty off // gdb-command:rbreak zzz @@ -76,6 +79,28 @@ // gdb-check:$19 = {a = 10019, b = -10020, x = -10016, y = -10017.5, z = 10018} +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print no_padding16 +// lldb-check:[...]$0 = NoPadding16 { x: 10000, y: -10001 } + +// lldb-command:print no_padding32 +// lldb-check:[...]$1 = NoPadding32 { x: -10002, y: -10003.5, z: 10004 } + +// lldb-command:print no_padding64 +// lldb-check:[...]$2 = NoPadding64 { x: -10005.5, y: 10006, z: 10007 } + +// lldb-command:print no_padding163264 +// lldb-check:[...]$3 = NoPadding163264 { a: -10008, b: 10009, c: 10010, d: 10011 } + +// lldb-command:print internal_padding +// lldb-check:[...]$4 = InternalPadding { x: 10012, y: -10013 } + +// lldb-command:print padding_at_end +// lldb-check:[...]$5 = PaddingAtEnd { x: -10014, y: 10015 } + #![feature(struct_inherit)]; #![allow(unused_variable)]; #![allow(dead_code)]; @@ -188,7 +213,7 @@ fn main() { PADDING_AT_END.y = 28; } - zzz(); + zzz(); // #break } fn zzz() {()} diff --git a/src/test/debuginfo/simple-tuple.rs b/src/test/debuginfo/simple-tuple.rs index 9486ab2474e..29d739d7f18 100644 --- a/src/test/debuginfo/simple-tuple.rs +++ b/src/test/debuginfo/simple-tuple.rs @@ -12,6 +12,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:set print pretty off // gdb-command:rbreak zzz @@ -69,6 +72,28 @@ // gdb-command:print 'simple-tuple::PADDING_AT_END' // gdb-check:$21 = {116, 117} + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print/d noPadding8 +// lldb-check:[...]$0 = (-100, 100) +// lldb-command:print noPadding16 +// lldb-check:[...]$1 = (0, 1, 2) +// lldb-command:print noPadding32 +// lldb-check:[...]$2 = (3, 4.5, 5) +// lldb-command:print noPadding64 +// lldb-check:[...]$3 = (6, 7.5, 8) + +// lldb-command:print internalPadding1 +// lldb-check:[...]$4 = (9, 10) +// lldb-command:print internalPadding2 +// lldb-check:[...]$5 = (11, 12, 13, 14) + +// lldb-command:print paddingAtEnd +// lldb-check:[...]$6 = (15, 16) + #![allow(unused_variable)] #![allow(dead_code)] @@ -107,7 +132,7 @@ fn main() { PADDING_AT_END = (116, 117); } - zzz(); + zzz(); // #break } fn zzz() {()} diff --git a/src/test/debuginfo/static-method-on-struct-and-enum.rs b/src/test/debuginfo/static-method-on-struct-and-enum.rs index d7d962c07d6..e5f9651bb8b 100644 --- a/src/test/debuginfo/static-method-on-struct-and-enum.rs +++ b/src/test/debuginfo/static-method-on-struct-and-enum.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run @@ -32,6 +35,27 @@ // gdb-check:$5 = 5 // gdb-command:continue + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// STRUCT +// lldb-command:print arg1 +// lldb-check:[...]$0 = 1 +// lldb-command:print arg2 +// lldb-check:[...]$1 = 2 +// lldb-command:continue + +// ENUM +// lldb-command:print arg1 +// lldb-check:[...]$2 = -3 +// lldb-command:print arg2 +// lldb-check:[...]$3 = 4.5 +// lldb-command:print arg3 +// lldb-check:[...]$4 = 5 +// lldb-command:continue + #![feature(struct_variant)] struct Struct { @@ -41,7 +65,7 @@ struct Struct { impl Struct { fn static_method(arg1: int, arg2: int) -> int { - zzz(); + zzz(); // #break arg1 + arg2 } } @@ -55,7 +79,7 @@ enum Enum { impl Enum { fn static_method(arg1: int, arg2: f64, arg3: uint) -> int { - zzz(); + zzz(); // #break arg1 } } diff --git a/src/test/debuginfo/struct-in-enum.rs b/src/test/debuginfo/struct-in-enum.rs index 0cba56ad320..d01119bce05 100644 --- a/src/test/debuginfo/struct-in-enum.rs +++ b/src/test/debuginfo/struct-in-enum.rs @@ -12,6 +12,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:set print union on // gdb-command:rbreak zzz // gdb-command:run @@ -26,6 +29,19 @@ // gdb-command:print univariant // gdb-check:$3 = {{{x = 123, y = 456, z = 789}}} + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print case1 +// lldb-check:[...]$0 = Case1(0, Struct { x: 2088533116, y: 2088533116, z: 31868 }) +// lldb-command:print case2 +// lldb-check:[...]$1 = Case2(0, 1229782938247303441, 4369) + +// lldb-command:print univariant +// lldb-check:[...]$2 = TheOnlyCase(Struct { x: 123, y: 456, z: 789 }) + #![allow(unused_variable)] struct Struct { @@ -66,7 +82,7 @@ fn main() { let univariant = TheOnlyCase(Struct { x: 123, y: 456, z: 789 }); - zzz(); + zzz(); // #break } fn zzz() {()} diff --git a/src/test/debuginfo/struct-in-struct.rs b/src/test/debuginfo/struct-in-struct.rs index e4c3f471880..3822b80e865 100644 --- a/src/test/debuginfo/struct-in-struct.rs +++ b/src/test/debuginfo/struct-in-struct.rs @@ -8,9 +8,13 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +// ignore-tidy-linelength // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:set print pretty off // gdb-command:rbreak zzz // gdb-command:run @@ -25,6 +29,35 @@ // gdb-command:print padding_at_end_parent // gdb-check:$3 = {x = {x = 10, y = 11}, y = {x = 12, y = 13}, z = {x = 14, y = 15}} + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print three_simple_structs +// lldb-check:[...]$0 = ThreeSimpleStructs { x: Simple { x: 1 }, y: Simple { x: 2 }, z: Simple { x: 3 } } + +// lldb-command:print internal_padding_parent +// lldb-check:[...]$1 = InternalPaddingParent { x: InternalPadding { x: 4, y: 5 }, y: InternalPadding { x: 6, y: 7 }, z: InternalPadding { x: 8, y: 9 } } + +// lldb-command:print padding_at_end_parent +// lldb-check:[...]$2 = PaddingAtEndParent { x: PaddingAtEnd { x: 10, y: 11 }, y: PaddingAtEnd { x: 12, y: 13 }, z: PaddingAtEnd { x: 14, y: 15 } } + +// lldb-command:print mixed +// lldb-check:[...]$3 = Mixed { x: PaddingAtEnd { x: 16, y: 17 }, y: InternalPadding { x: 18, y: 19 }, z: Simple { x: 20 }, w: 21 } + +// lldb-command:print bag +// lldb-check:[...]$4 = Bag { x: Simple { x: 22 } } + +// lldb-command:print bag_in_bag +// lldb-check:[...]$5 = BagInBag { x: Bag { x: Simple { x: 23 } } } + +// lldb-command:print tjo +// lldb-check:[...]$6 = ThatsJustOverkill { x: BagInBag { x: Bag { x: Simple { x: 24 } } } } + +// lldb-command:print tree +// lldb-check:[...]$7 = Tree { x: Simple { x: 25 }, y: InternalPaddingParent { x: InternalPadding { x: 26, y: 27 }, y: InternalPadding { x: 28, y: 29 }, z: InternalPadding { x: 30, y: 31 } }, z: BagInBag { x: Bag { x: Simple { x: 32 } } } } + #![allow(unused_variable)] struct Simple { @@ -140,7 +173,7 @@ fn main() { } }; - zzz(); + zzz(); // #break } fn zzz() {()} diff --git a/src/test/debuginfo/struct-style-enum.rs b/src/test/debuginfo/struct-style-enum.rs index 70d4d709d23..c3a5abf2d38 100644 --- a/src/test/debuginfo/struct-style-enum.rs +++ b/src/test/debuginfo/struct-style-enum.rs @@ -12,6 +12,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:set print union on // gdb-command:rbreak zzz // gdb-command:run @@ -29,6 +32,23 @@ // gdb-command:print univariant // gdb-check:$4 = {{a = -1}} + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print case1 +// lldb-check:[...]$0 = Case1 { a: 0, b: 31868, c: 31868, d: 31868, e: 31868 } + +// lldb-command:print case2 +// lldb-check:[...]$1 = Case2 { a: 0, b: 286331153, c: 286331153 } + +// lldb-command:print case3 +// lldb-check:[...]$2 = Case3 { a: 0, b: 6438275382588823897 } + +// lldb-command:print univariant +// lldb-check:[...]$3 = TheOnlyCase { a: -1 } + #![allow(unused_variable)] #![feature(struct_variant)] @@ -71,7 +91,7 @@ fn main() { let univariant = TheOnlyCase { a: -1 }; - zzz(); + zzz(); // #break } fn zzz() {()} diff --git a/src/test/debuginfo/struct-with-destructor.rs b/src/test/debuginfo/struct-with-destructor.rs index 16fbfc49d08..525fcd45cfb 100644 --- a/src/test/debuginfo/struct-with-destructor.rs +++ b/src/test/debuginfo/struct-with-destructor.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run // gdb-command:finish @@ -26,6 +29,22 @@ // gdb-command:print nested // gdb-check:$4 = {a = {a = {x = 7890, y = 9870}}} + +// === LLDB TESTS ================================================================================== + +// lldb-command:run +// lldb-command:print simple +// lldb-check:[...]$0 = WithDestructor { x: 10, y: 20 } + +// lldb-command:print noDestructor +// lldb-check:[...]$1 = NoDestructorGuarded { a: NoDestructor { x: 10, y: 20 }, guard: -1 } + +// lldb-command:print withDestructor +// lldb-check:[...]$2 = WithDestructorGuarded { a: WithDestructor { x: 10, y: 20 }, guard: -1 } + +// lldb-command:print nested +// lldb-check:[...]$3 = NestedOuter { a: NestedInner { a: WithDestructor { x: 7890, y: 9870 } } } + #![allow(unused_variable)] struct NoDestructor { @@ -121,7 +140,7 @@ fn main() { // <-------NestedOuter--------> let nested = NestedOuter { a: NestedInner { a: WithDestructor { x: 7890, y: 9870 } } }; - zzz(); + zzz(); // #break } fn zzz() {()} diff --git a/src/test/debuginfo/text-to-include-1.txt b/src/test/debuginfo/text-to-include-1.txt index 91e2445c4aa..ba055272a3f 100644 --- a/src/test/debuginfo/text-to-include-1.txt +++ b/src/test/debuginfo/text-to-include-1.txt @@ -1 +1 @@ -some text to include in another file as string 1 +some text to include in another file as string 1 \ No newline at end of file diff --git a/src/test/debuginfo/text-to-include-2.txt b/src/test/debuginfo/text-to-include-2.txt index be6022776c5..a59d2057eb4 100644 --- a/src/test/debuginfo/text-to-include-2.txt +++ b/src/test/debuginfo/text-to-include-2.txt @@ -1 +1 @@ -some text to include in another file as string 2 +some text to include in another file as string 2. \ No newline at end of file diff --git a/src/test/debuginfo/text-to-include-3.txt b/src/test/debuginfo/text-to-include-3.txt index 0cff667b47c..6163f7dd48c 100644 --- a/src/test/debuginfo/text-to-include-3.txt +++ b/src/test/debuginfo/text-to-include-3.txt @@ -1 +1 @@ -some text to include in another file as string 3 +some text to include in another file as string 3.. \ No newline at end of file diff --git a/src/test/debuginfo/trait-generic-static-default-method.rs b/src/test/debuginfo/trait-generic-static-default-method.rs index e91cd2f02d4..20747681b6f 100644 --- a/src/test/debuginfo/trait-generic-static-default-method.rs +++ b/src/test/debuginfo/trait-generic-static-default-method.rs @@ -11,6 +11,9 @@ // except according to those terms. // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run @@ -29,13 +32,42 @@ // gdb-command:continue +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print no_padding1 +// lldb-check:[...]$0 = { x = (0, 1) y = 2 z = (3, 4, 5) } +// lldb-command:print no_padding2 +// lldb-check:[...]$1 = { x = (6, 7) y = { = (8, 9) = 10 } } + +// lldb-command:print tuple_internal_padding +// lldb-check:[...]$2 = { x = (11, 12) y = (13, 14) } +// lldb-command:print struct_internal_padding +// lldb-check:[...]$3 = { x = (15, 16) y = (17, 18) } +// lldb-command:print both_internally_padded +// lldb-check:[...]$4 = { x = (19, 20, 21) y = (22, 23) } + +// lldb-command:print single_tuple +// lldb-check:[...]$5 = { x = (24, 25, 26) } + +// lldb-command:print tuple_padded_at_end +// lldb-check:[...]$6 = { x = (27, 28) y = (29, 30) } +// lldb-command:print struct_padded_at_end +// lldb-check:[...]$7 = { x = (31, 32) y = (33, 34) } +// lldb-command:print both_padded_at_end +// lldb-check:[...]$8 = { x = (35, 36, 37) y = (38, 39) } + +// lldb-command:print mixed_padding +// lldb-check:[...]$9 = { x = { = (40, 41, 42) = (43, 44) } y = (45, 46, 47, 48) } + struct Struct { x: int } trait Trait { fn generic_static_default_method(arg1: int, arg2: T) -> int { - zzz(); + zzz(); // #break arg1 } } diff --git a/src/test/debuginfo/trait-pointers.rs b/src/test/debuginfo/trait-pointers.rs index e58ed4cea29..ca407aef1a4 100644 --- a/src/test/debuginfo/trait-pointers.rs +++ b/src/test/debuginfo/trait-pointers.rs @@ -10,6 +10,8 @@ // ignore-android: FIXME(#10381) +// ignore-lldb + // compile-flags:-g // gdb-command:run diff --git a/src/test/debuginfo/tuple-in-tuple.rs b/src/test/debuginfo/tuple-in-tuple.rs index 3cc8b4e6486..4c4ad51c70b 100644 --- a/src/test/debuginfo/tuple-in-tuple.rs +++ b/src/test/debuginfo/tuple-in-tuple.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:set print pretty off // gdb-command:rbreak zzz // gdb-command:run @@ -33,6 +36,28 @@ // gdb-command:print padding_at_end2 // gdb-check:$7 = {{21, 22}, 23} + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print no_padding1 +// lldb-check:[...]$0 = ((0, 1), 2, 3) +// lldb-command:print no_padding2 +// lldb-check:[...]$1 = (4, (5, 6), 7) +// lldb-command:print no_padding3 +// lldb-check:[...]$2 = (8, 9, (10, 11)) + +// lldb-command:print internal_padding1 +// lldb-check:[...]$3 = (12, (13, 14)) +// lldb-command:print internal_padding2 +// lldb-check:[...]$4 = (15, (16, 17)) + +// lldb-command:print padding_at_end1 +// lldb-check:[...]$5 = (18, (19, 20)) +// lldb-command:print padding_at_end2 +// lldb-check:[...]$6 = ((21, 22), 23) + #![allow(unused_variable)] fn main() { @@ -46,7 +71,7 @@ fn main() { let padding_at_end1: (i32, (i32, i16)) = (18, (19, 20)); let padding_at_end2: ((i32, i16), i32) = ((21, 22), 23); - zzz(); + zzz(); // #break } fn zzz() {()} diff --git a/src/test/debuginfo/tuple-struct.rs b/src/test/debuginfo/tuple-struct.rs index cea063820b8..afcacd46e66 100644 --- a/src/test/debuginfo/tuple-struct.rs +++ b/src/test/debuginfo/tuple-struct.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:set print pretty off // gdb-command:rbreak zzz // gdb-command:run @@ -35,6 +38,28 @@ // gdb-check:$6 = {-10014, 10015} +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print no_padding16 +// lldb-check:[...]$0 = NoPadding16(10000, -10001) + +// lldb-command:print no_padding32 +// lldb-check:[...]$1 = NoPadding32(-10002, -10003.5, 10004) + +// lldb-command:print no_padding64 +// lldb-check:[...]$2 = NoPadding64(-10005.5, 10006, 10007) + +// lldb-command:print no_padding163264 +// lldb-check:[...]$3 = NoPadding163264(-10008, 10009, 10010, 10011) + +// lldb-command:print internal_padding +// lldb-check:[...]$4 = InternalPadding(10012, -10013) + +// lldb-command:print padding_at_end +// lldb-check:[...]$5 = PaddingAtEnd(-10014, 10015) + // This test case mainly makes sure that no field names are generated for tuple structs (as opposed // to all fields having the name ""). Otherwise they are handled the same a normal // structs. @@ -55,7 +80,7 @@ fn main() { let internal_padding = InternalPadding(10012, -10013); let padding_at_end = PaddingAtEnd(-10014, 10015); - zzz(); + zzz(); // #break } fn zzz() {()} diff --git a/src/test/debuginfo/tuple-style-enum.rs b/src/test/debuginfo/tuple-style-enum.rs index 81c72d16886..7cd0a8f6164 100644 --- a/src/test/debuginfo/tuple-style-enum.rs +++ b/src/test/debuginfo/tuple-style-enum.rs @@ -12,6 +12,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:set print union on // gdb-command:rbreak zzz // gdb-command:run @@ -29,6 +32,23 @@ // gdb-command:print univariant // gdb-check:$4 = {{-1}} + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print case1 +// lldb-check:[...]$0 = Case1(0, 31868, 31868, 31868, 31868) + +// lldb-command:print case2 +// lldb-check:[...]$1 = Case2(0, 286331153, 286331153) + +// lldb-command:print case3 +// lldb-check:[...]$2 = Case3(0, 6438275382588823897) + +// lldb-command:print univariant +// lldb-check:[...]$3 = TheOnlyCase(-1) + #![allow(unused_variable)] // The first element is to ensure proper alignment, irrespective of the machines word size. Since @@ -70,7 +90,7 @@ fn main() { let univariant = TheOnlyCase(-1); - zzz(); + zzz(); // #break } fn zzz() {()} diff --git a/src/test/debuginfo/unique-enum.rs b/src/test/debuginfo/unique-enum.rs index 3949a315adc..4c945e62abc 100644 --- a/src/test/debuginfo/unique-enum.rs +++ b/src/test/debuginfo/unique-enum.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run // gdb-command:finish @@ -24,6 +27,20 @@ // gdb-command:print *univariant // gdb-check:$3 = {{123234}} + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print *the_a +// lldb-check:[...]$0 = TheA { x: 0, y: 8970181431921507452 } + +// lldb-command:print *the_b +// lldb-check:[...]$1 = TheB(0, 286331153, 286331153) + +// lldb-command:print *univariant +// lldb-check:[...]$2 = TheOnlyCase(123234) + #![allow(unused_variable)] #![feature(struct_variant)] @@ -60,7 +77,7 @@ fn main() { let univariant = box TheOnlyCase(123234); - zzz(); + zzz(); // #break } fn zzz() {()} diff --git a/src/test/debuginfo/var-captured-in-nested-closure.rs b/src/test/debuginfo/var-captured-in-nested-closure.rs index 3328b112284..b538fcd7d76 100644 --- a/src/test/debuginfo/var-captured-in-nested-closure.rs +++ b/src/test/debuginfo/var-captured-in-nested-closure.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run // gdb-command:finish @@ -48,6 +51,43 @@ // gdb-check:$14 = 8 // gdb-command:continue + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print variable +// lldb-check:[...]$0 = 1 +// lldb-command:print constant +// lldb-check:[...]$1 = 2 +// lldb-command:print a_struct +// lldb-check:[...]$2 = Struct { a: -3, b: 4.5, c: 5 } +// lldb-command:print *struct_ref +// lldb-check:[...]$3 = Struct { a: -3, b: 4.5, c: 5 } +// lldb-command:print *owned +// lldb-check:[...]$4 = 6 +// lldb-command:print managed->val +// lldb-check:[...]$5 = 7 +// lldb-command:print closure_local +// lldb-check:[...]$6 = 8 +// lldb-command:continue + +// lldb-command:print variable +// lldb-check:[...]$7 = 1 +// lldb-command:print constant +// lldb-check:[...]$8 = 2 +// lldb-command:print a_struct +// lldb-check:[...]$9 = Struct { a: -3, b: 4.5, c: 5 } +// lldb-command:print *struct_ref +// lldb-check:[...]$10 = Struct { a: -3, b: 4.5, c: 5 } +// lldb-command:print *owned +// lldb-check:[...]$11 = 6 +// lldb-command:print managed->val +// lldb-check:[...]$12 = 7 +// lldb-command:print closure_local +// lldb-check:[...]$13 = 8 +// lldb-command:continue + #![feature(managed_boxes)] #![allow(unused_variable)] @@ -77,11 +117,11 @@ fn main() { let closure_local = 8; let nested_closure = || { - zzz(); + zzz(); // #break variable = constant + a_struct.a + struct_ref.a + *owned + *managed + closure_local; }; - zzz(); + zzz(); // #break nested_closure(); }; diff --git a/src/test/debuginfo/var-captured-in-sendable-closure.rs b/src/test/debuginfo/var-captured-in-sendable-closure.rs index 03525a3a034..cd100415cbe 100644 --- a/src/test/debuginfo/var-captured-in-sendable-closure.rs +++ b/src/test/debuginfo/var-captured-in-sendable-closure.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run // gdb-command:finish @@ -22,6 +25,18 @@ // gdb-command:print *owned // gdb-check:$3 = 5 + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print constant +// lldb-check:[...]$0 = 1 +// lldb-command:print a_struct +// lldb-check:[...]$1 = Struct { a: -2, b: 3.5, c: 4 } +// lldb-command:print *owned +// lldb-check:[...]$2 = 5 + #![allow(unused_variable)] struct Struct { @@ -42,7 +57,7 @@ fn main() { let owned = box 5; let closure: proc() = proc() { - zzz(); + zzz(); // #break do_something(&constant, &a_struct.a, owned); }; diff --git a/src/test/debuginfo/var-captured-in-stack-closure.rs b/src/test/debuginfo/var-captured-in-stack-closure.rs index 453ac354631..3fe17dc83e7 100644 --- a/src/test/debuginfo/var-captured-in-stack-closure.rs +++ b/src/test/debuginfo/var-captured-in-stack-closure.rs @@ -11,6 +11,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:rbreak zzz // gdb-command:run // gdb-command:finish @@ -28,6 +31,24 @@ // gdb-command:print managed->val // gdb-check:$6 = 7 + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print variable +// lldb-check:[...]$0 = 1 +// lldb-command:print constant +// lldb-check:[...]$1 = 2 +// lldb-command:print a_struct +// lldb-check:[...]$2 = Struct { a: -3, b: 4.5, c: 5 } +// lldb-command:print *struct_ref +// lldb-check:[...]$3 = Struct { a: -3, b: 4.5, c: 5 } +// lldb-command:print *owned +// lldb-check:[...]$4 = 6 +// lldb-command:print managed->val +// lldb-check:[...]$5 = 7 + #![feature(managed_boxes)] #![allow(unused_variable)] @@ -54,7 +75,7 @@ fn main() { let managed = box(GC) 7; let closure = || { - zzz(); + zzz(); // #break variable = constant + a_struct.a + struct_ref.a + *owned + *managed; }; diff --git a/src/test/debuginfo/vec-slices.rs b/src/test/debuginfo/vec-slices.rs index 783b1983953..00398fd5c82 100644 --- a/src/test/debuginfo/vec-slices.rs +++ b/src/test/debuginfo/vec-slices.rs @@ -12,6 +12,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:set print pretty off // gdb-command:rbreak zzz // gdb-command:run @@ -53,6 +56,29 @@ // gdb-command:print *((int64_t[2]*)('vec-slices::MUT_VECT_SLICE'.data_ptr)) // gdb-check:$15 = {64, 65} + +// === LLDB TESTS ================================================================================== + +// lldb-command:run + +// lldb-command:print empty +// lldb-check:[...]$0 = &[] + +// lldb-command:print singleton +// lldb-check:[...]$1 = &[1] + +// lldb-command:print multiple +// lldb-check:[...]$2 = &[2, 3, 4, 5] + +// lldb-command:print slice_of_slice +// lldb-check:[...]$3 = &[3, 4] + +// lldb-command:print padded_tuple +// lldb-check:[...]$4 = &[(6, 7), (8, 9)] + +// lldb-command:print padded_struct +// lldb-check:[...]$5 = &[AStruct { x: 10, y: 11, z: 12 }, AStruct { x: 13, y: 14, z: 15 }] + #![allow(unused_variable)] struct AStruct { @@ -81,7 +107,7 @@ fn main() { MUT_VECT_SLICE = VECT_SLICE; } - zzz(); + zzz(); // #break } fn zzz() {()} diff --git a/src/test/debuginfo/vec.rs b/src/test/debuginfo/vec.rs index 155865f415b..7372a6e7ca0 100644 --- a/src/test/debuginfo/vec.rs +++ b/src/test/debuginfo/vec.rs @@ -12,6 +12,9 @@ // ignore-android: FIXME(#10381) // compile-flags:-g + +// === GDB TESTS =================================================================================== + // gdb-command:set print pretty off // gdb-command:rbreak zzz // gdb-command:run @@ -21,6 +24,13 @@ // gdb-command:print vec::VECT // gdb-check:$2 = {4, 5, 6} + +// === LLDB TESTS ================================================================================== + +// lldb-command:run +// lldb-command:print a +// lldb-check:[...]$0 = [1, 2, 3] + #![allow(unused_variable)] static mut VECT: [i32, ..3] = [1, 2, 3]; @@ -34,7 +44,7 @@ fn main() { VECT[2] = 6; } - zzz(); + zzz(); // #break } fn zzz() {()}