Skip to content

Commit 22838f5

Browse files
---
yaml --- r: 157423 b: refs/heads/snap-stage3 c: dbf0167 h: refs/heads/master i: 157421: 4c714fe 157419: cd37fbd 157415: 220b7d6 157407: ab9b619 v: v3
1 parent e6968f7 commit 22838f5

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 065caf34f5ff29e04605f95d9c5d511af219439a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 47e8cf76977d7a46ea2aed512c35b175e44815a9
4+
refs/heads/snap-stage3: dbf0167de924a6f2b579267046fe0a07a124442f
55
refs/heads/try: 0ee4d8b0b112c608646fa75463ab4dc59132efd9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/compiletest/runtest.rs

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,15 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
653653
script_str.push_str("version\n");
654654

655655
// Switch LLDB into "Rust mode"
656-
script_str.push_str("command script import ./src/etc/lldb_rust_formatters.py\n");
656+
let rust_src_root = find_rust_src_root(config)
657+
.expect("Could not find Rust source root");
658+
let rust_pp_module_rel_path = Path::new("./src/etc/lldb_rust_formatters.py");
659+
let rust_pp_module_abs_path = rust_src_root.join(rust_pp_module_rel_path)
660+
.as_str()
661+
.unwrap()
662+
.to_string();
663+
664+
script_str.push_str(format!("command script import {}\n", rust_pp_module_abs_path[])[]);
657665
script_str.push_str("type summary add --no-value ");
658666
script_str.push_str("--python-function lldb_rust_formatters.print_val ");
659667
script_str.push_str("-x \".*\" --category Rust\n");
@@ -683,18 +691,27 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
683691
let debugger_script = make_out_name(config, testfile, "debugger.script");
684692

685693
// Let LLDB execute the script via lldb_batchmode.py
686-
let debugger_run_result = run_lldb(config, &exe_file, &debugger_script);
694+
let debugger_run_result = run_lldb(config,
695+
&exe_file,
696+
&debugger_script,
697+
&rust_src_root);
687698

688699
if !debugger_run_result.status.success() {
689700
fatal_proc_rec("Error while running LLDB", &debugger_run_result);
690701
}
691702

692703
check_debugger_output(&debugger_run_result, check_lines.as_slice());
693704

694-
fn run_lldb(config: &Config, test_executable: &Path, debugger_script: &Path) -> ProcRes {
705+
fn run_lldb(config: &Config,
706+
test_executable: &Path,
707+
debugger_script: &Path,
708+
rust_src_root: &Path)
709+
-> ProcRes {
695710
// Prepare the lldb_batchmode which executes the debugger script
711+
let lldb_script_path = rust_src_root.join(Path::new("./src/etc/lldb_batchmode.py"));
712+
696713
let mut cmd = Command::new("python");
697-
cmd.arg("./src/etc/lldb_batchmode.py")
714+
cmd.arg(lldb_script_path)
698715
.arg(test_executable)
699716
.arg(debugger_script)
700717
.env_set_all([("PYTHONPATH", config.lldb_python_dir.clone().unwrap().as_slice())]);

0 commit comments

Comments
 (0)