Skip to content

Commit 397cfae

Browse files
committed
Auto merge of #33848 - alexcrichton:android-gdb-sysroot, r=michaelwoerister
test: Use `set sysroot` for more NDK compatibility Recent versions of the Android NDK no longer ship debuggers like `arm-linux-androideabi-gdb`, but instead one prebuilt binary `gdb`. We can symlink this into place at least to get our detection still working, but it now needs to be told what the sysroot is so it can correctly do... something. Long story short, tests didn't pass with this change and after this change they pass.
2 parents 7746a33 + 0f3e865 commit 397cfae

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/tools/compiletest/src/runtest.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,15 @@ actual:\n\
440440

441441
cmds = cmds.replace("run", "continue");
442442

443+
let tool_path = match self.config.android_cross_path.to_str() {
444+
Some(x) => x.to_owned(),
445+
None => self.fatal("cannot find android cross path")
446+
};
447+
443448
// write debugger script
444449
let mut script_str = String::with_capacity(2048);
445450
script_str.push_str(&format!("set charset {}\n", Self::charset()));
451+
script_str.push_str(&format!("set sysroot {}\n", tool_path));
446452
script_str.push_str(&format!("file {}\n", exe_file.to_str().unwrap()));
447453
script_str.push_str("target remote :5039\n");
448454
script_str.push_str(&format!("set solib-search-path \
@@ -515,11 +521,6 @@ actual:\n\
515521
}
516522
}
517523

518-
let tool_path = match self.config.android_cross_path.to_str() {
519-
Some(x) => x.to_owned(),
520-
None => self.fatal("cannot find android cross path")
521-
};
522-
523524
let debugger_script = self.make_out_name("debugger.script");
524525
// FIXME (#9639): This needs to handle non-utf8 paths
525526
let debugger_opts =

0 commit comments

Comments
 (0)