diff options
Diffstat (limited to 'src/test/debuginfo/auxiliary')
7 files changed, 116 insertions, 0 deletions
diff --git a/src/test/debuginfo/auxiliary/cross_crate_debuginfo_type_uniquing.rs b/src/test/debuginfo/auxiliary/cross_crate_debuginfo_type_uniquing.rs new file mode 100644 index 000000000..b9bb3ba72 --- /dev/null +++ b/src/test/debuginfo/auxiliary/cross_crate_debuginfo_type_uniquing.rs @@ -0,0 +1,16 @@ +// no-prefer-dynamic +#![crate_type = "rlib"] +// compile-flags:-g + +struct S1; + +impl S1 { + fn f(&mut self) { } +} + + +struct S2; + +impl S2 { + fn f(&mut self) { } +} diff --git a/src/test/debuginfo/auxiliary/cross_crate_spans.rs b/src/test/debuginfo/auxiliary/cross_crate_spans.rs new file mode 100644 index 000000000..efe5e4195 --- /dev/null +++ b/src/test/debuginfo/auxiliary/cross_crate_spans.rs @@ -0,0 +1,19 @@ +#![crate_type = "rlib"] + +#![allow(unused_variables)] +#![feature(omit_gdb_pretty_printer_section)] +#![omit_gdb_pretty_printer_section] + +// no-prefer-dynamic +// compile-flags:-g + +pub fn generic_function<T: Clone>(val: T) -> (T, T) { + let result = (val.clone(), val.clone()); + let a_variable: u32 = 123456789; + let another_variable: f64 = 123456789.5; + zzz(); + result +} + +#[inline(never)] +fn zzz() {()} diff --git a/src/test/debuginfo/auxiliary/dependency-with-embedded-visualizers.natvis b/src/test/debuginfo/auxiliary/dependency-with-embedded-visualizers.natvis new file mode 100644 index 000000000..5900fcc01 --- /dev/null +++ b/src/test/debuginfo/auxiliary/dependency-with-embedded-visualizers.natvis @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010"> + <Type Name="dependency_with_embedded_visualizers::Person"> + <DisplayString>{name} is {age} years old.</DisplayString> + <Expand> + <Item Name="[name]">name</Item> + <Item Name="[age]">age</Item> + </Expand> + </Type> +</AutoVisualizer> diff --git a/src/test/debuginfo/auxiliary/dependency-with-embedded-visualizers.py b/src/test/debuginfo/auxiliary/dependency-with-embedded-visualizers.py new file mode 100644 index 000000000..2635ed487 --- /dev/null +++ b/src/test/debuginfo/auxiliary/dependency-with-embedded-visualizers.py @@ -0,0 +1,23 @@ +import gdb + +class PersonPrinter: + "Print a Person" + + def __init__(self, val): + self.val = val + self.name = val["name"] + self.age = int(val["age"]) + + def to_string(self): + return "{} is {} years old.".format(self.name, self.age) + +def lookup(val): + lookup_tag = val.type.tag + if lookup_tag is None: + return None + if "dependency_with_embedded_visualizers::Person" == lookup_tag: + return PersonPrinter(val) + + return None + +gdb.current_objfile().pretty_printers.append(lookup) diff --git a/src/test/debuginfo/auxiliary/dependency-with-embedded-visualizers.rs b/src/test/debuginfo/auxiliary/dependency-with-embedded-visualizers.rs new file mode 100644 index 000000000..327515b10 --- /dev/null +++ b/src/test/debuginfo/auxiliary/dependency-with-embedded-visualizers.rs @@ -0,0 +1,19 @@ +// compile-flags:-g +// ignore-lldb +// no-prefer-dynamic + +#![feature(debugger_visualizer)] +#![debugger_visualizer(natvis_file = "dependency-with-embedded-visualizers.natvis")] +#![debugger_visualizer(gdb_script_file = "dependency-with-embedded-visualizers.py")] +#![crate_type = "rlib"] + +pub struct Person { + name: String, + age: i32, +} + +impl Person { + pub fn new(name: String, age: i32) -> Person { + Person { name: name, age: age } + } +} diff --git a/src/test/debuginfo/auxiliary/issue-13213-aux.rs b/src/test/debuginfo/auxiliary/issue-13213-aux.rs new file mode 100644 index 000000000..bde98b445 --- /dev/null +++ b/src/test/debuginfo/auxiliary/issue-13213-aux.rs @@ -0,0 +1,19 @@ +#![crate_type = "lib"] +// compile-flags:-g + +pub use private::P; + +#[derive(Copy, Clone)] +pub struct S { + p: P, +} + +mod private { + #[derive(Copy, Clone)] + pub struct P { + p: i32, + } + pub const THREE: P = P { p: 3 }; +} + +pub static A: S = S { p: private::THREE }; diff --git a/src/test/debuginfo/auxiliary/macro-stepping.rs b/src/test/debuginfo/auxiliary/macro-stepping.rs new file mode 100644 index 000000000..4447dd22d --- /dev/null +++ b/src/test/debuginfo/auxiliary/macro-stepping.rs @@ -0,0 +1,10 @@ +// compile-flags:-g + +#![crate_type = "rlib"] + +#[macro_export] +macro_rules! new_scope { + () => { + let x = 1; + } +} |