1 // Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // This test uses only GDB Python API features which should be available in
12 // older versions of GDB too. A more extensive test can be found in
13 // gdb-pretty-struct-and-enums.rs
15 // ignore-test FIXME(#16919)
16 // ignore-tidy-linelength
18 // ignore-android: FIXME(#10381)
20 // gdb-use-pretty-printer
22 // The following line actually doesn't have to do anything with pretty printing,
23 // it just tells GDB to print values on one line:
24 // gdb-command: set print pretty off
26 // gdb-command: rbreak zzz
28 // gdb-command: finish
30 // gdb-command: print regular_struct
31 // gdb-check:$1 = RegularStruct = {the_first_field = 101, the_second_field = 102.5, the_third_field = false}
33 // gdb-command: print empty_struct
34 // gdb-check:$2 = EmptyStruct
36 // gdb-command: print c_style_enum1
37 // gdb-check:$3 = CStyleEnumVar1
39 // gdb-command: print c_style_enum2
40 // gdb-check:$4 = CStyleEnumVar2
42 // gdb-command: print c_style_enum3
43 // gdb-check:$5 = CStyleEnumVar3
45 struct RegularStruct {
47 the_second_field: f64,
48 the_third_field: bool,
61 let regular_struct = RegularStruct {
63 the_second_field: 102.5,
64 the_third_field: false
67 let empty_struct = EmptyStruct;
69 let c_style_enum1 = CStyleEnumVar1;
70 let c_style_enum2 = CStyleEnumVar2;
71 let c_style_enum3 = CStyleEnumVar3;