@@ -42,7 +42,7 @@ use test::MetricMap;
42
42
pub fn run ( config : Config , testfile : String ) {
43
43
match & * config. target {
44
44
45
- "arm-linux-androideabi" => {
45
+ "arm-linux-androideabi" | "aarch64-linux-android" => {
46
46
if !config. adb_device_status {
47
47
panic ! ( "android device not available" ) ;
48
48
}
@@ -382,17 +382,26 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
382
382
383
383
let debugger_run_result;
384
384
match & * config. target {
385
- "arm-linux-androideabi" => {
385
+ "arm-linux-androideabi" | "aarch64-linux-android" => {
386
386
387
- cmds = cmds. replace ( "run" , "continue" ) . to_string ( ) ;
387
+ cmds = cmds. replace ( "run" , "continue" ) ;
388
388
389
389
// write debugger script
390
- let script_str = [ "set charset UTF-8" . to_string ( ) ,
391
- format ! ( "file {}" , exe_file. as_str( ) . unwrap( )
392
- . to_string( ) ) ,
393
- "target remote :5039" . to_string ( ) ,
394
- cmds,
395
- "quit" . to_string ( ) ] . connect ( "\n " ) ;
390
+ let mut script_str = String :: with_capacity ( 2048 ) ;
391
+ script_str. push_str ( "set charset UTF-8\n " ) ;
392
+ script_str. push_str ( & format ! ( "file {}\n " , exe_file. as_str( ) . unwrap( ) ) ) ;
393
+ script_str. push_str ( "target remote :5039\n " ) ;
394
+ script_str. push_str ( & format ! ( "set solib-search-path \
395
+ ./{}/stage2/lib/rustlib/{}/lib/\n ",
396
+ config. host, config. target) ) ;
397
+ for line in breakpoint_lines. iter ( ) {
398
+ script_str. push_str ( & format ! ( "break {:?}:{}\n " ,
399
+ testfile. filename_display( ) ,
400
+ * line) [ ] ) ;
401
+ }
402
+ script_str. push_str ( & cmds) ;
403
+ script_str. push_str ( "quit\n " ) ;
404
+
396
405
debug ! ( "script_str = {}" , script_str) ;
397
406
dump_output_file ( config,
398
407
testfile,
@@ -425,8 +434,10 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
425
434
. expect ( & format ! ( "failed to exec `{:?}`" , config. adb_path) ) ;
426
435
427
436
let adb_arg = format ! ( "export LD_LIBRARY_PATH={}; \
428
- gdbserver :5039 {}/{}",
437
+ gdbserver{} :5039 {}/{}",
429
438
config. adb_test_dir. clone( ) ,
439
+ if config. target. contains( "aarch64" )
440
+ { "64" } else { "" } ,
430
441
config. adb_test_dir. clone( ) ,
431
442
str :: from_utf8(
432
443
exe_file. filename( )
@@ -470,7 +481,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
470
481
format!( "-command={}" , debugger_script. as_str( ) . unwrap( ) ) ) ;
471
482
472
483
let mut gdb_path = tool_path;
473
- gdb_path. push_str ( "/bin/arm-linux-androideabi- gdb" ) ;
484
+ gdb_path. push_str ( & format ! ( "/bin/{}- gdb" , config . target ) ) ;
474
485
let procsrv:: Result {
475
486
out,
476
487
err,
@@ -484,7 +495,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
484
495
. expect ( & format ! ( "failed to exec `{:?}`" , gdb_path) ) ;
485
496
let cmdline = {
486
497
let cmdline = make_cmdline ( "" ,
487
- "arm-linux-androideabi- gdb",
498
+ & format ! ( "{}- gdb", config . target ) ,
488
499
& debugger_opts) ;
489
500
logv ( config, format ! ( "executing {}" , cmdline) ) ;
490
501
cmdline
@@ -496,7 +507,9 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
496
507
stderr : err,
497
508
cmdline : cmdline
498
509
} ;
499
- process. signal_kill ( ) . unwrap ( ) ;
510
+ if process. signal_kill ( ) . is_err ( ) {
511
+ println ! ( "Adb process is already finished." ) ;
512
+ }
500
513
}
501
514
502
515
_=> {
@@ -1135,7 +1148,7 @@ fn exec_compiled_test(config: &Config, props: &TestProps,
1135
1148
1136
1149
match & * config. target {
1137
1150
1138
- "arm-linux-androideabi" => {
1151
+ "arm-linux-androideabi" | "aarch64-linux-android" => {
1139
1152
_arm_exec_compiled_test ( config, props, testfile, env)
1140
1153
}
1141
1154
@@ -1200,7 +1213,7 @@ fn compose_and_run_compiler(
1200
1213
}
1201
1214
1202
1215
match & * config. target {
1203
- "arm-linux-androideabi" => {
1216
+ "arm-linux-androideabi" | "aarch64-linux-android" => {
1204
1217
_arm_push_aux_shared_library ( config, testfile) ;
1205
1218
}
1206
1219
_ => { }
@@ -1499,7 +1512,7 @@ fn _arm_exec_compiled_test(config: &Config,
1499
1512
for ( key, val) in env {
1500
1513
runargs. push ( format ! ( "{}={}" , key, val) ) ;
1501
1514
}
1502
- runargs. push ( format ! ( "{}/adb_run_wrapper.sh" , config. adb_test_dir) ) ;
1515
+ runargs. push ( format ! ( "{}/../ adb_run_wrapper.sh" , config. adb_test_dir) ) ;
1503
1516
runargs. push ( format ! ( "{}" , config. adb_test_dir) ) ;
1504
1517
runargs. push ( format ! ( "{}" , prog_short) ) ;
1505
1518
@@ -1595,7 +1608,7 @@ fn _arm_push_aux_shared_library(config: &Config, testfile: &Path) {
1595
1608
file. as_str ( )
1596
1609
. unwrap ( )
1597
1610
. to_string ( ) ,
1598
- config. adb_test_dir . to_string ( )
1611
+ config. adb_test_dir . to_string ( ) ,
1599
1612
] ,
1600
1613
vec ! ( ( "" . to_string( ) ,
1601
1614
"" . to_string( ) ) ) ,
0 commit comments