2 // min-gdb-version: 8.1
5 // === CDB TESTS ==================================================================================
9 // The .nvlist command in cdb does not always have a deterministic output
10 // for the order that NatVis files are displayed.
12 // cdb-command: .nvlist
13 // cdb-check: [...].exe (embedded NatVis "[...]embedded_visualizer-0.natvis")
15 // cdb-command: .nvlist
16 // cdb-check: [...].exe (embedded NatVis "[...]embedded_visualizer-1.natvis")
18 // cdb-command: .nvlist
19 // cdb-check: [...].exe (embedded NatVis "[...]embedded_visualizer-2.natvis")
21 // cdb-command: dx point_a
22 // cdb-check:point_a : (0, 0) [Type: embedded_visualizer::point::Point]
23 // cdb-check: [<Raw View>] [Type: embedded_visualizer::point::Point]
24 // cdb-check: [x] : 0 [Type: int]
25 // cdb-check: [y] : 0 [Type: int]
27 // cdb-command: dx point_b
28 // cdb-check:point_b : (5, 8) [Type: embedded_visualizer::point::Point]
29 // cdb-check: [<Raw View>] [Type: embedded_visualizer::point::Point]
30 // cdb-check: [x] : 5 [Type: int]
31 // cdb-check: [y] : 8 [Type: int]
33 // cdb-command: dx line
34 // cdb-check:line : ((0, 0), (5, 8)) [Type: embedded_visualizer::Line]
35 // cdb-check: [<Raw View>] [Type: embedded_visualizer::Line]
36 // cdb-check: [a] : (0, 0) [Type: embedded_visualizer::point::Point]
37 // cdb-check: [b] : (5, 8) [Type: embedded_visualizer::point::Point]
39 // cdb-command: dx person
40 // cdb-check:person : "Person A" is 10 years old. [Type: dependency_with_embedded_visualizers::Person]
41 // cdb-check: [<Raw View>] [Type: dependency_with_embedded_visualizers::Person]
42 // cdb-check: [name] : "Person A" [Type: alloc::string::String]
43 // cdb-check: [age] : 10 [Type: int]
45 // === GDB TESTS ===================================================================================
49 // gdb-command: info auto-load python-scripts
50 // gdb-check:Yes pretty-printer-embedded_visualizer-0
51 // gdb-check:Yes pretty-printer-embedded_visualizer-1
52 // gdb-command: print point_a
53 // gdb-check:$1 = (0, 0)
54 // gdb-command: print point_b
55 // gdb-check:$2 = (5, 8)
56 // gdb-command: print line
57 // gdb-check:$3 = ((0, 0), (5, 8))
58 // gdb-command: print person
59 // gdb-check:$4 = "Person A" is 10 years old.
61 #![allow(unused_variables)]
62 #![feature(debugger_visualizer)]
63 #![debugger_visualizer(natvis_file = "embedded-visualizer.natvis")]
64 #![debugger_visualizer(gdb_script_file = "embedded-visualizer.py")]
66 // aux-build: dependency-with-embedded-visualizers.rs
67 extern crate dependency_with_embedded_visualizers;
69 use dependency_with_embedded_visualizers::Person;
71 #[debugger_visualizer(natvis_file = "embedded-visualizer-point.natvis")]
72 #[debugger_visualizer(gdb_script_file = "embedded-visualizer-point.py")]
80 pub fn new(x: i32, y: i32) -> Point {
94 pub fn new(a: Point, b: Point) -> Line {
100 let point_a = Point::new(0, 0);
101 let point_b = Point::new(5, 8);
102 let line = Line::new(point_a, point_b);
104 let name = String::from("Person A");
105 let person = Person::new(name, 10);