summaryrefslogtreecommitdiffstats
path: root/tests/debuginfo/auxiliary
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
commit64d98f8ee037282c35007b64c2649055c56af1db (patch)
tree5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /tests/debuginfo/auxiliary
parentAdding debian version 1.67.1+dfsg1-1. (diff)
downloadrustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz
rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/debuginfo/auxiliary')
-rw-r--r--tests/debuginfo/auxiliary/cross_crate_debuginfo_type_uniquing.rs16
-rw-r--r--tests/debuginfo/auxiliary/cross_crate_spans.rs19
-rw-r--r--tests/debuginfo/auxiliary/dependency-with-embedded-visualizers.natvis10
-rw-r--r--tests/debuginfo/auxiliary/dependency-with-embedded-visualizers.py23
-rw-r--r--tests/debuginfo/auxiliary/dependency-with-embedded-visualizers.rs19
-rw-r--r--tests/debuginfo/auxiliary/issue-13213-aux.rs19
-rw-r--r--tests/debuginfo/auxiliary/macro-stepping.rs10
7 files changed, 116 insertions, 0 deletions
diff --git a/tests/debuginfo/auxiliary/cross_crate_debuginfo_type_uniquing.rs b/tests/debuginfo/auxiliary/cross_crate_debuginfo_type_uniquing.rs
new file mode 100644
index 000000000..b9bb3ba72
--- /dev/null
+++ b/tests/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/tests/debuginfo/auxiliary/cross_crate_spans.rs b/tests/debuginfo/auxiliary/cross_crate_spans.rs
new file mode 100644
index 000000000..efe5e4195
--- /dev/null
+++ b/tests/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/tests/debuginfo/auxiliary/dependency-with-embedded-visualizers.natvis b/tests/debuginfo/auxiliary/dependency-with-embedded-visualizers.natvis
new file mode 100644
index 000000000..5900fcc01
--- /dev/null
+++ b/tests/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/tests/debuginfo/auxiliary/dependency-with-embedded-visualizers.py b/tests/debuginfo/auxiliary/dependency-with-embedded-visualizers.py
new file mode 100644
index 000000000..2635ed487
--- /dev/null
+++ b/tests/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/tests/debuginfo/auxiliary/dependency-with-embedded-visualizers.rs b/tests/debuginfo/auxiliary/dependency-with-embedded-visualizers.rs
new file mode 100644
index 000000000..327515b10
--- /dev/null
+++ b/tests/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/tests/debuginfo/auxiliary/issue-13213-aux.rs b/tests/debuginfo/auxiliary/issue-13213-aux.rs
new file mode 100644
index 000000000..bde98b445
--- /dev/null
+++ b/tests/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/tests/debuginfo/auxiliary/macro-stepping.rs b/tests/debuginfo/auxiliary/macro-stepping.rs
new file mode 100644
index 000000000..4447dd22d
--- /dev/null
+++ b/tests/debuginfo/auxiliary/macro-stepping.rs
@@ -0,0 +1,10 @@
+// compile-flags:-g
+
+#![crate_type = "rlib"]
+
+#[macro_export]
+macro_rules! new_scope {
+ () => {
+ let x = 1;
+ }
+}