@@ -653,7 +653,15 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
653
653
script_str. push_str ( "version\n " ) ;
654
654
655
655
// 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[ ] ) [ ] ) ;
657
665
script_str. push_str ( "type summary add --no-value " ) ;
658
666
script_str. push_str ( "--python-function lldb_rust_formatters.print_val " ) ;
659
667
script_str. push_str ( "-x \" .*\" --category Rust\n " ) ;
@@ -683,18 +691,27 @@ fn run_debuginfo_lldb_test(config: &Config, props: &TestProps, testfile: &Path)
683
691
let debugger_script = make_out_name ( config, testfile, "debugger.script" ) ;
684
692
685
693
// 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) ;
687
698
688
699
if !debugger_run_result. status . success ( ) {
689
700
fatal_proc_rec ( "Error while running LLDB" , & debugger_run_result) ;
690
701
}
691
702
692
703
check_debugger_output ( & debugger_run_result, check_lines. as_slice ( ) ) ;
693
704
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 {
695
710
// 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
+
696
713
let mut cmd = Command :: new ( "python" ) ;
697
- cmd. arg ( "./src/etc/lldb_batchmode.py" )
714
+ cmd. arg ( lldb_script_path )
698
715
. arg ( test_executable)
699
716
. arg ( debugger_script)
700
717
. env_set_all ( [ ( "PYTHONPATH" , config. lldb_python_dir . clone ( ) . unwrap ( ) . as_slice ( ) ) ] ) ;
0 commit comments