@@ -42,7 +42,7 @@ use test::MetricMap;
42
42
pub fn run ( config : Config , testfile : String ) {
43
43
match config. target . as_slice ( ) {
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
}
@@ -383,17 +383,23 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
383
383
384
384
let debugger_run_result;
385
385
match config. target . as_slice ( ) {
386
- "arm-linux-androideabi" => {
386
+ "arm-linux-androideabi" | "aarch64-linux-android" => {
387
387
388
- cmds = cmds. replace ( "run" , "continue" ) . to_string ( ) ;
388
+ cmds = cmds. replace ( "run" , "continue" ) ;
389
389
390
390
// write debugger script
391
- let script_str = [ "set charset UTF-8" . to_string ( ) ,
392
- format ! ( "file {}" , exe_file. as_str( ) . unwrap( )
393
- . to_string( ) ) ,
394
- "target remote :5039" . to_string ( ) ,
395
- cmds,
396
- "quit" . to_string ( ) ] . connect ( "\n " ) ;
391
+ let mut script_str = String :: with_capacity ( 2048 ) ;
392
+ script_str. push_str ( "set charset UTF-8\n " ) ;
393
+ script_str. push_str ( format ! ( "file {}\n " , exe_file. as_str( ) . unwrap( ) ) . as_slice ( ) ) ;
394
+ script_str. push_str ( "target remote :5039\n " ) ;
395
+ for line in breakpoint_lines. iter ( ) {
396
+ script_str. push_str ( & format ! ( "break {:?}:{}\n " ,
397
+ testfile. filename_display( ) ,
398
+ * line) [ ] ) ;
399
+ }
400
+ script_str. push_str ( cmds. as_slice ( ) ) ;
401
+ script_str. push_str ( "quit\n " ) ;
402
+
397
403
debug ! ( "script_str = {}" , script_str) ;
398
404
dump_output_file ( config,
399
405
testfile,
@@ -425,10 +431,14 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
425
431
Some ( "" . to_string ( ) ) )
426
432
. expect ( format ! ( "failed to exec `{:?}`" , config. adb_path) . as_slice ( ) ) ;
427
433
428
- let adb_arg = format ! ( "export LD_LIBRARY_PATH={}; \
429
- gdbserver :5039 {}/{}",
434
+ let adb_arg = format ! ( "export LD_LIBRARY_PATH={}:{}/{} ; \
435
+ gdbserver{} :5039 {}/{}",
430
436
config. adb_test_dir. clone( ) ,
431
437
config. adb_test_dir. clone( ) ,
438
+ config. target. clone( ) ,
439
+ if config. target. as_slice( ) == "aarch64-linux-android"
440
+ { "64" } else { "" } ,
441
+ config. adb_test_dir. clone( ) ,
432
442
str :: from_utf8(
433
443
exe_file. filename( )
434
444
. unwrap( ) ) . unwrap( ) ) ;
@@ -471,7 +481,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
471
481
format!( "-command={}" , debugger_script. as_str( ) . unwrap( ) ) ) ;
472
482
473
483
let mut gdb_path = tool_path;
474
- gdb_path. push_str ( "/bin/arm-linux-androideabi- gdb" ) ;
484
+ gdb_path. push_str ( format ! ( "/bin/{}- gdb" , config . target ) . as_slice ( ) ) ;
475
485
let procsrv:: Result {
476
486
out,
477
487
err,
@@ -485,7 +495,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
485
495
. expect ( format ! ( "failed to exec `{:?}`" , gdb_path) . as_slice ( ) ) ;
486
496
let cmdline = {
487
497
let cmdline = make_cmdline ( "" ,
488
- "arm-linux-androideabi- gdb",
498
+ format ! ( "{}- gdb", config . target ) . as_slice ( ) ,
489
499
debugger_opts. as_slice ( ) ) ;
490
500
logv ( config, format ! ( "executing {}" , cmdline) ) ;
491
501
cmdline
@@ -497,7 +507,9 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
497
507
stderr : err,
498
508
cmdline : cmdline
499
509
} ;
500
- process. signal_kill ( ) . unwrap ( ) ;
510
+ if process. signal_kill ( ) . is_err ( ) {
511
+ println ! ( "Adb process is already finished." ) ;
512
+ }
501
513
}
502
514
503
515
_=> {
@@ -1141,7 +1153,7 @@ fn exec_compiled_test(config: &Config, props: &TestProps,
1141
1153
1142
1154
match config. target . as_slice ( ) {
1143
1155
1144
- "arm-linux-androideabi" => {
1156
+ "arm-linux-androideabi" | "aarch64-linux-android" => {
1145
1157
_arm_exec_compiled_test ( config, props, testfile, env)
1146
1158
}
1147
1159
@@ -1206,7 +1218,7 @@ fn compose_and_run_compiler(
1206
1218
}
1207
1219
1208
1220
match config. target . as_slice ( ) {
1209
- "arm-linux-androideabi" => {
1221
+ "arm-linux-androideabi" | "aarch64-linux-android" => {
1210
1222
_arm_push_aux_shared_library ( config, testfile) ;
1211
1223
}
1212
1224
_ => { }
@@ -1508,6 +1520,7 @@ fn _arm_exec_compiled_test(config: &Config,
1508
1520
}
1509
1521
runargs. push ( format ! ( "{}/adb_run_wrapper.sh" , config. adb_test_dir) ) ;
1510
1522
runargs. push ( format ! ( "{}" , config. adb_test_dir) ) ;
1523
+ runargs. push ( format ! ( "{}" , config. target) ) ;
1511
1524
runargs. push ( format ! ( "{}" , prog_short) ) ;
1512
1525
1513
1526
for tv in & args. args {
@@ -1602,7 +1615,7 @@ fn _arm_push_aux_shared_library(config: &Config, testfile: &Path) {
1602
1615
file. as_str ( )
1603
1616
. unwrap ( )
1604
1617
. to_string ( ) ,
1605
- config. adb_test_dir . to_string ( )
1618
+ config. adb_test_dir . to_string ( ) ,
1606
1619
] ,
1607
1620
vec ! ( ( "" . to_string( ) ,
1608
1621
"" . to_string( ) ) ) ,
0 commit comments