Skip to content

Commit ba287f6

Browse files
debuginfo: Inject 'Rust-mode' LLDB prelude into debuginfo test scripts.
1 parent 83fe455 commit ba287f6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/compiletest/runtest.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,16 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
536536
// We don't want to hang when calling `quit` while the process is still running
537537
let mut script_str = String::from_str("settings set auto-confirm true\n");
538538

539+
// Make LLDB emit its version, so we have it documented in the test output
540+
script_str.push_str("version\n");
541+
542+
// Switch LLDB into "Rust mode"
543+
script_str.push_str("command script import ./src/etc/lldb_rust_formatters.py\n");
544+
script_str.push_str("type summary add --no-value ");
545+
script_str.push_str("--python-function lldb_rust_formatters.print_val ");
546+
script_str.push_str("-x \".*\" --category Rust\n");
547+
script_str.push_str("type category enable Rust\n");
548+
539549
// Set breakpoints on every line that contains the string "#break"
540550
for line in breakpoint_lines.iter() {
541551
script_str.push_str(format!("breakpoint set --line {}\n",

0 commit comments

Comments
 (0)