diff options
| author | bors <bors@rust-lang.org> | 2022-05-29 00:40:45 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-05-29 00:40:45 +0000 |
| commit | 84288ed6d5307ed44a0f78e2f1ee55fbadf4e978 (patch) | |
| tree | 5e504b24b4dab730b988db1166990259ba328c1e /src | |
| parent | 14f477e78adb9960f760e9bac812673f993d8dc2 (diff) | |
| parent | 774d7ced10b30c480c63a8124f38bcf2f3d66464 (diff) | |
| download | rust-84288ed6d5307ed44a0f78e2f1ee55fbadf4e978.tar.gz rust-84288ed6d5307ed44a0f78e2f1ee55fbadf4e978.zip | |
Auto merge of #97500 - GuillaumeGomez:rollup-ms1bvps, r=GuillaumeGomez
Rollup of 5 pull requests Successful merges: - #96950 (Add regression test for #96395) - #97028 (Add support for embedding pretty printers via `#[debugger_visualizer]` attribute) - #97478 (Remove FIXME on `ExtCtxt::fn_decl()`) - #97479 (Make some tests check-pass) - #97482 (ptr::invalid is not equivalent to a int2ptr cast) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src')
26 files changed, 269 insertions, 95 deletions
diff --git a/src/doc/unstable-book/src/language-features/debugger-visualizer.md b/src/doc/unstable-book/src/language-features/debugger-visualizer.md index 4ab482fffb9..c7a0414b676 100644 --- a/src/doc/unstable-book/src/language-features/debugger-visualizer.md +++ b/src/doc/unstable-book/src/language-features/debugger-visualizer.md @@ -14,6 +14,7 @@ to embed a debugger visualizer file into the PDB/ELF generated by `rustc`. ``` rust,ignore (partial-example) #![feature(debugger_visualizer)] #![debugger_visualizer(natvis_file = "foo.natvis")] +#![debugger_visualizer(gdb_script_file = "foo.py")] struct Foo { } @@ -22,4 +23,5 @@ struct Foo { ## Limitations Currently, this feature only supports embedding Natvis files on `-windows-msvc` -targets when using the MSVC linker via the `natvis_file` meta item. +targets via the `natvis_file` meta item. `-windows-gnu` targets are not currently +supported. 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 00000000000..5900fcc01a6 --- /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 00000000000..2635ed487c8 --- /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 00000000000..327515b10af --- /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/msvc-embedded-natvis.natvis b/src/test/debuginfo/embedded-visualizer-point.natvis index 201d014b520..d7bf6885dd4 100644 --- a/src/test/debuginfo/msvc-embedded-natvis.natvis +++ b/src/test/debuginfo/embedded-visualizer-point.natvis @@ -1,18 +1,10 @@ <?xml version="1.0" encoding="utf-8"?> <AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010"> - <Type Name="msvc_embedded_natvis::Point"> + <Type Name="embedded_visualizer::point::Point"> <DisplayString>({x}, {y})</DisplayString> <Expand> <Item Name="[x]">x</Item> <Item Name="[y]">y</Item> </Expand> </Type> - - <Type Name="msvc_embedded_natvis::Line"> - <DisplayString>({a}, {b})</DisplayString> - <Expand> - <Item Name="[a]">a</Item> - <Item Name="[b]">b</Item> - </Expand> - </Type> </AutoVisualizer> diff --git a/src/test/debuginfo/embedded-visualizer-point.py b/src/test/debuginfo/embedded-visualizer-point.py new file mode 100644 index 00000000000..d6b1af00785 --- /dev/null +++ b/src/test/debuginfo/embedded-visualizer-point.py @@ -0,0 +1,23 @@ +import gdb + +class PointPrinter: + "Print a Point" + + def __init__(self, val): + self.val = val + self.x = int(val["x"]) + self.y = int(val["y"]) + + def to_string(self): + return "({}, {})".format(self.x, self.y) + +def lookup(val): + lookup_tag = val.type.tag + if lookup_tag is None: + return None + if "embedded_visualizer::point::Point" == lookup_tag: + return PointPrinter(val) + + return None + +gdb.current_objfile().pretty_printers.append(lookup) diff --git a/src/test/debuginfo/embedded-visualizer.natvis b/src/test/debuginfo/embedded-visualizer.natvis new file mode 100644 index 00000000000..100437f90e5 --- /dev/null +++ b/src/test/debuginfo/embedded-visualizer.natvis @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010"> + <Type Name="embedded_visualizer::Line"> + <DisplayString>({a}, {b})</DisplayString> + <Expand> + <Item Name="[a]">a</Item> + <Item Name="[b]">b</Item> + </Expand> + </Type> +</AutoVisualizer> diff --git a/src/test/debuginfo/embedded-visualizer.py b/src/test/debuginfo/embedded-visualizer.py new file mode 100644 index 00000000000..8e4fab61614 --- /dev/null +++ b/src/test/debuginfo/embedded-visualizer.py @@ -0,0 +1,23 @@ +import gdb + +class LinePrinter: + "Print a Line" + + def __init__(self, val): + self.val = val + self.a = val["a"] + self.b = val["b"] + + def to_string(self): + return "({}, {})".format(self.a, self.b) + +def lookup(val): + lookup_tag = val.type.tag + if lookup_tag is None: + return None + if "embedded_visualizer::Line" == lookup_tag: + return LinePrinter(val) + + return None + +gdb.current_objfile().pretty_printers.append(lookup) diff --git a/src/test/debuginfo/embedded-visualizer.rs b/src/test/debuginfo/embedded-visualizer.rs new file mode 100644 index 00000000000..0269015b466 --- /dev/null +++ b/src/test/debuginfo/embedded-visualizer.rs @@ -0,0 +1,112 @@ +// compile-flags:-g +// min-gdb-version: 8.1 +// ignore-lldb + +// === CDB TESTS ================================================================================== + +// cdb-command: g + +// The .nvlist command in cdb does not always have a deterministic output +// for the order that NatVis files are displayed. + +// cdb-command: .nvlist +// cdb-check: [...].exe (embedded NatVis "[...]embedded_visualizer-0.natvis") + +// cdb-command: .nvlist +// cdb-check: [...].exe (embedded NatVis "[...]embedded_visualizer-1.natvis") + +// cdb-command: .nvlist +// cdb-check: [...].exe (embedded NatVis "[...]embedded_visualizer-2.natvis") + +// cdb-command: dx point_a +// cdb-check:point_a : (0, 0) [Type: embedded_visualizer::point::Point] +// cdb-check: [<Raw View>] [Type: embedded_visualizer::point::Point] +// cdb-check: [x] : 0 [Type: int] +// cdb-check: [y] : 0 [Type: int] + +// cdb-command: dx point_b +// cdb-check:point_b : (5, 8) [Type: embedded_visualizer::point::Point] +// cdb-check: [<Raw View>] [Type: embedded_visualizer::point::Point] +// cdb-check: [x] : 5 [Type: int] +// cdb-check: [y] : 8 [Type: int] + +// cdb-command: dx line +// cdb-check:line : ((0, 0), (5, 8)) [Type: embedded_visualizer::Line] +// cdb-check: [<Raw View>] [Type: embedded_visualizer::Line] +// cdb-check: [a] : (0, 0) [Type: embedded_visualizer::point::Point] +// cdb-check: [b] : (5, 8) [Type: embedded_visualizer::point::Point] + +// cdb-command: dx person +// cdb-check:person : "Person A" is 10 years old. [Type: dependency_with_embedded_visualizers::Person] +// cdb-check: [<Raw View>] [Type: dependency_with_embedded_visualizers::Person] +// cdb-check: [name] : "Person A" [Type: alloc::string::String] +// cdb-check: [age] : 10 [Type: int] + +// === GDB TESTS =================================================================================== + +// gdb-command: run + +// gdb-command: info auto-load python-scripts +// gdb-check:Yes pretty-printer-embedded_visualizer-0 +// gdb-check:Yes pretty-printer-embedded_visualizer-1 +// gdb-command: print point_a +// gdb-check:$1 = (0, 0) +// gdb-command: print point_b +// gdb-check:$2 = (5, 8) +// gdb-command: print line +// gdb-check:$3 = ((0, 0), (5, 8)) +// gdb-command: print person +// gdb-check:$4 = "Person A" is 10 years old. + +#![allow(unused_variables)] +#![feature(debugger_visualizer)] +#![debugger_visualizer(natvis_file = "embedded-visualizer.natvis")] +#![debugger_visualizer(gdb_script_file = "embedded-visualizer.py")] + +// aux-build: dependency-with-embedded-visualizers.rs +extern crate dependency_with_embedded_visualizers; + +use dependency_with_embedded_visualizers::Person; + +#[debugger_visualizer(natvis_file = "embedded-visualizer-point.natvis")] +#[debugger_visualizer(gdb_script_file = "embedded-visualizer-point.py")] +mod point { + pub struct Point { + x: i32, + y: i32, + } + + impl Point { + pub fn new(x: i32, y: i32) -> Point { + Point { x: x, y: y } + } + } +} + +use point::Point; + +pub struct Line { + a: Point, + b: Point, +} + +impl Line { + pub fn new(a: Point, b: Point) -> Line { + Line { a: a, b: b } + } +} + +fn main() { + let point_a = Point::new(0, 0); + let point_b = Point::new(5, 8); + let line = Line::new(point_a, point_b); + + let name = String::from("Person A"); + let person = Person::new(name, 10); + + zzz(); // #break +} + +fn zzz() { + () +} diff --git a/src/test/debuginfo/msvc-embedded-natvis.rs b/src/test/debuginfo/msvc-embedded-natvis.rs deleted file mode 100644 index f714fb2ad17..00000000000 --- a/src/test/debuginfo/msvc-embedded-natvis.rs +++ /dev/null @@ -1,64 +0,0 @@ -// only-cdb -// compile-flags:-g - -// === CDB TESTS ================================================================================== - -// cdb-command: g - -// cdb-command: .nvlist -// cdb-check: [...].exe (embedded NatVis "[...]msvc_embedded_natvis-0.natvis") - -// cdb-command: dx point_a -// cdb-check:point_a : (0, 0) [Type: msvc_embedded_natvis::Point] -// cdb-check: [<Raw View>] [Type: msvc_embedded_natvis::Point] -// cdb-check: [x] : 0 [Type: int] -// cdb-check: [y] : 0 [Type: int] - -// cdb-command: dx point_b -// cdb-check:point_b : (5, 8) [Type: msvc_embedded_natvis::Point] -// cdb-check: [<Raw View>] [Type: msvc_embedded_natvis::Point] -// cdb-check: [x] : 5 [Type: int] -// cdb-check: [y] : 8 [Type: int] - -// cdb-command: dx line -// cdb-check:line : ((0, 0), (5, 8)) [Type: msvc_embedded_natvis::Line] -// cdb-check: [<Raw View>] [Type: msvc_embedded_natvis::Line] -// cdb-check: [a] : (0, 0) [Type: msvc_embedded_natvis::Point] -// cdb-check: [b] : (5, 8) [Type: msvc_embedded_natvis::Point] - -#![feature(debugger_visualizer)] -#![debugger_visualizer(natvis_file = "msvc-embedded-natvis.natvis")] - -pub struct Point { - x: i32, - y: i32, -} - -impl Point { - pub fn new(x: i32, y: i32) -> Point { - Point { x: x, y: y } - } -} - -pub struct Line { - a: Point, - b: Point, -} - -impl Line { - pub fn new(a: Point, b: Point) -> Line { - Line { a: a, b: b } - } -} - -fn main() { - let point_a = Point::new(0, 0); - let point_b = Point::new(5, 8); - let line = Line::new(point_a, point_b); - - zzz(); // #break -} - -fn zzz() { - () -} diff --git a/src/test/ui/associated-types/issue-82079.rs b/src/test/ui/associated-types/issue-82079.rs index 590c799c2d7..8b3bad707d3 100644 --- a/src/test/ui/associated-types/issue-82079.rs +++ b/src/test/ui/associated-types/issue-82079.rs @@ -1,4 +1,7 @@ +// revisions: default miropt // check-pass +//[miropt]compile-flags: -Z mir-opt-level=3 +// -^ This flag is for #96395 as a regression test. mod convenience_operators { use crate::{Op, Relation}; diff --git a/src/test/ui/feature-gates/auxiliary/debugger-visualizer.natvis b/src/test/ui/feature-gates/auxiliary/debugger-visualizer.natvis new file mode 100644 index 00000000000..6eb47e3d85b --- /dev/null +++ b/src/test/ui/feature-gates/auxiliary/debugger-visualizer.natvis @@ -0,0 +1,3 @@ +<?xml version="1.0" encoding="utf-8"?> +<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010"> +</AutoVisualizer> diff --git a/src/test/ui/feature-gates/feature-gate-debugger-visualizer.rs b/src/test/ui/feature-gates/feature-gate-debugger-visualizer.rs index 3f9eb27a0d6..4c4dc450d18 100644 --- a/src/test/ui/feature-gates/feature-gate-debugger-visualizer.rs +++ b/src/test/ui/feature-gates/feature-gate-debugger-visualizer.rs @@ -1,3 +1,3 @@ -#![debugger_visualizer(natvis_file = "../foo.natvis")] //~ ERROR the `#[debugger_visualizer]` attribute is an experimental feature +#![debugger_visualizer(natvis_file = "auxiliary/debugger-visualizer.natvis")] //~ ERROR the `#[debugger_visualizer]` attribute is an experimental feature fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-debugger-visualizer.stderr b/src/test/ui/feature-gates/feature-gate-debugger-visualizer.stderr index 721b2b185da..e9367fbc6c9 100644 --- a/src/test/ui/feature-gates/feature-gate-debugger-visualizer.stderr +++ b/src/test/ui/feature-gates/feature-gate-debugger-visualizer.stderr @@ -1,8 +1,8 @@ error[E0658]: the `#[debugger_visualizer]` attribute is an experimental feature --> $DIR/feature-gate-debugger-visualizer.rs:1:1 | -LL | #![debugger_visualizer(natvis_file = "../foo.natvis")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #![debugger_visualizer(natvis_file = "auxiliary/debugger-visualizer.natvis")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: see issue #95939 <https://github.com/rust-lang/rust/issues/95939> for more information = help: add `#![feature(debugger_visualizer)]` to the crate attributes to enable diff --git a/src/test/ui/invalid/invalid-debugger-visualizer-option.rs b/src/test/ui/invalid/invalid-debugger-visualizer-option.rs index 5332298f0ef..5645a30ccee 100644 --- a/src/test/ui/invalid/invalid-debugger-visualizer-option.rs +++ b/src/test/ui/invalid/invalid-debugger-visualizer-option.rs @@ -1,4 +1,7 @@ +// normalize-stderr-test: "foo.random:.*\(" -> "foo.random: $$FILE_NOT_FOUND_MSG (" +// normalize-stderr-test: "os error \d+" -> "os error $$FILE_NOT_FOUND_CODE" + #![feature(debugger_visualizer)] #![debugger_visualizer(random_file = "../foo.random")] //~ ERROR invalid argument - +#![debugger_visualizer(natvis_file = "../foo.random")] //~ ERROR fn main() {} diff --git a/src/test/ui/invalid/invalid-debugger-visualizer-option.stderr b/src/test/ui/invalid/invalid-debugger-visualizer-option.stderr index 24ad9361fe3..afb8d16ee96 100644 --- a/src/test/ui/invalid/invalid-debugger-visualizer-option.stderr +++ b/src/test/ui/invalid/invalid-debugger-visualizer-option.stderr @@ -1,10 +1,18 @@ error: invalid argument - --> $DIR/invalid-debugger-visualizer-option.rs:2:1 + --> $DIR/invalid-debugger-visualizer-option.rs:5:24 | LL | #![debugger_visualizer(random_file = "../foo.random")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: expected: `natvis_file = "..."` + = note: OR + = note: expected: `gdb_script_file = "..."` -error: aborting due to previous error +error: couldn't read $DIR/../foo.random: $FILE_NOT_FOUND_MSG (os error $FILE_NOT_FOUND_CODE) + --> $DIR/invalid-debugger-visualizer-option.rs:6:24 + | +LL | #![debugger_visualizer(natvis_file = "../foo.random")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors diff --git a/src/test/ui/invalid/invalid-debugger-visualizer-target.rs b/src/test/ui/invalid/invalid-debugger-visualizer-target.rs index 7668d092e61..f0aba6a75c4 100644 --- a/src/test/ui/invalid/invalid-debugger-visualizer-target.rs +++ b/src/test/ui/invalid/invalid-debugger-visualizer-target.rs @@ -1,5 +1,4 @@ #![feature(debugger_visualizer)] #[debugger_visualizer(natvis_file = "../foo.natvis")] //~ ERROR attribute should be applied to a module - fn main() {} diff --git a/src/test/ui/lint/lint-unknown-feature-default.rs b/src/test/ui/lint/lint-unknown-feature-default.rs index aebc4f18085..84a2e5a4b35 100644 --- a/src/test/ui/lint/lint-unknown-feature-default.rs +++ b/src/test/ui/lint/lint-unknown-feature-default.rs @@ -1,10 +1,9 @@ +// check-pass + // Tests the default for the unused_features lint #![allow(stable_features)] // FIXME(#44232) we should warn that this isn't used. #![feature(rust1)] -// build-pass (FIXME(62277): could be check-pass?) - - -fn main() { } +fn main() {} diff --git a/src/test/ui/lint/lint-unknown-feature.rs b/src/test/ui/lint/lint-unknown-feature.rs index 93fa7a6e96e..1af8d4ff842 100644 --- a/src/test/ui/lint/lint-unknown-feature.rs +++ b/src/test/ui/lint/lint-unknown-feature.rs @@ -1,10 +1,9 @@ +// check-pass + #![warn(unused_features)] #![allow(stable_features)] // FIXME(#44232) we should warn that this isn't used. #![feature(rust1)] -// build-pass (FIXME(62277): could be check-pass?) - - fn main() {} diff --git a/src/test/ui/parser/bounds-obj-parens.rs b/src/test/ui/parser/bounds-obj-parens.rs index ae8112b61c6..8c446d27d0a 100644 --- a/src/test/ui/parser/bounds-obj-parens.rs +++ b/src/test/ui/parser/bounds-obj-parens.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(bare_trait_objects)] diff --git a/src/test/ui/parser/impl-qpath.rs b/src/test/ui/parser/impl-qpath.rs index ab45649f4de..d1f0a02041b 100644 --- a/src/test/ui/parser/impl-qpath.rs +++ b/src/test/ui/parser/impl-qpath.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // compile-flags: -Z parse-only impl <*const u8>::AssocTy {} // OK diff --git a/src/test/ui/parser/trailing-plus-in-bounds.rs b/src/test/ui/parser/trailing-plus-in-bounds.rs index 61819cabdf1..400649bcf75 100644 --- a/src/test/ui/parser/trailing-plus-in-bounds.rs +++ b/src/test/ui/parser/trailing-plus-in-bounds.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(bare_trait_objects)] diff --git a/src/test/ui/parser/trait-plusequal-splitting.rs b/src/test/ui/parser/trait-plusequal-splitting.rs index 26ac3ead6a5..6ca6774507b 100644 --- a/src/test/ui/parser/trait-plusequal-splitting.rs +++ b/src/test/ui/parser/trait-plusequal-splitting.rs @@ -1,6 +1,6 @@ // Fixes issue where `+` in generics weren't parsed if they were part of a `+=`. -// build-pass (FIXME(62277): could be check-pass?) +// check-pass struct Whitespace<T: Clone + = ()> { t: T } struct TokenSplit<T: Clone += ()> { t: T } diff --git a/src/test/ui/underscore-imports/duplicate.rs b/src/test/ui/underscore-imports/duplicate.rs index 3662a466ded..20bc7848acd 100644 --- a/src/test/ui/underscore-imports/duplicate.rs +++ b/src/test/ui/underscore-imports/duplicate.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // aux-build:duplicate.rs extern crate duplicate; diff --git a/src/test/ui/underscore-imports/intercrate.rs b/src/test/ui/underscore-imports/intercrate.rs index 1cccc67e9ab..144f95bace1 100644 --- a/src/test/ui/underscore-imports/intercrate.rs +++ b/src/test/ui/underscore-imports/intercrate.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // aux-build:underscore-imports.rs extern crate underscore_imports; diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 64b6df3567a..494c8d771b0 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -929,6 +929,16 @@ impl<'test> TestCx<'test> { "add-auto-load-safe-path {}\n", rust_pp_module_abs_path.replace(r"\", r"\\") )); + + let output_base_dir = self.output_base_dir().to_str().unwrap().to_owned(); + + // Add the directory containing the output binary to + // include embedded pretty printers to GDB's script + // auto loading safe path + script_str.push_str(&format!( + "add-auto-load-safe-path {}\n", + output_base_dir.replace(r"\", r"\\") + )); } } _ => { |
