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-tidy-linelength
17 // ignore-android: FIXME(#10381)
19 // gdb-use-pretty-printer
21 // The following line actually doesn't have to do anything with pretty printing,
22 // it just tells GDB to print values on one line:
23 // gdb-command: set print pretty off
25 // gdb-command: rbreak zzz
27 // gdb-command: finish
29 // gdb-command: print regular_struct
30 // gdb-check:$1 = RegularStruct = {the_first_field = 101, the_second_field = 102.5, the_third_field = false}
32 // gdb-command: print empty_struct
33 // gdb-check:$2 = EmptyStruct
35 // gdb-command: print c_style_enum1
36 // gdb-check:$3 = CStyleEnumVar1
38 // gdb-command: print c_style_enum2
39 // gdb-check:$4 = CStyleEnumVar2
41 // gdb-command: print c_style_enum3
42 // gdb-check:$5 = CStyleEnumVar3
44 struct RegularStruct {
46 the_second_field: f64,
47 the_third_field: bool,
60 let regular_struct = RegularStruct {
62 the_second_field: 102.5,
63 the_third_field: false
66 let empty_struct = EmptyStruct;
68 let c_style_enum1 = CStyleEnumVar1;
69 let c_style_enum2 = CStyleEnumVar2;
70 let c_style_enum3 = CStyleEnumVar3;