@@ -42,7 +42,7 @@ use test::MetricMap;
4242pub  fn  run ( config :  Config ,  testfile :  String )  { 
4343    match  config. target . as_slice ( )  { 
4444
45-         "arm-linux-androideabi"  => { 
45+         "arm-linux-androideabi"  |  "aarch64-linux-android"   => { 
4646            if  !config. adb_device_status  { 
4747                panic ! ( "android device not available" ) ; 
4848            } 
@@ -383,17 +383,23 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
383383
384384    let  debugger_run_result; 
385385    match  config. target . as_slice ( )  { 
386-         "arm-linux-androideabi"  => { 
386+         "arm-linux-androideabi"  |  "aarch64-linux-android"   => { 
387387
388-             cmds = cmds. replace ( "run" ,  "continue" ) . to_string ( ) ; 
388+             cmds = cmds. replace ( "run" ,  "continue" ) ; 
389389
390390            // 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+ 
397403            debug ! ( "script_str = {}" ,  script_str) ; 
398404            dump_output_file ( config, 
399405                             testfile, 
@@ -425,10 +431,14 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
425431                         Some ( "" . to_string ( ) ) ) 
426432                . expect ( format ! ( "failed to exec `{:?}`" ,  config. adb_path) . as_slice ( ) ) ; 
427433
428-             let  adb_arg = format ! ( "export LD_LIBRARY_PATH={}; \  
429- , 
434+             let  adb_arg = format ! ( "export LD_LIBRARY_PATH={}:{}/{} ; \  
435+ {}  :5039 {}/{}", 
430436                                  config. adb_test_dir. clone( ) , 
431437                                  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( ) , 
432442                                  str :: from_utf8( 
433443                                      exe_file. filename( ) 
434444                                      . unwrap( ) ) . unwrap( ) ) ; 
@@ -471,7 +481,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
471481                     format!( "-command={}" ,  debugger_script. as_str( ) . unwrap( ) ) ) ; 
472482
473483            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 ( ) ) ; 
475485            let  procsrv:: Result  { 
476486                out, 
477487                err, 
@@ -485,7 +495,7 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
485495                . expect ( format ! ( "failed to exec `{:?}`" ,  gdb_path) . as_slice ( ) ) ; 
486496            let  cmdline = { 
487497                let  cmdline = make_cmdline ( "" , 
488-                                            "arm-linux-androideabi- gdb", 
498+                                            format ! ( "{}- gdb",  config . target ) . as_slice ( ) , 
489499                                           debugger_opts. as_slice ( ) ) ; 
490500                logv ( config,  format ! ( "executing {}" ,  cmdline) ) ; 
491501                cmdline
@@ -497,7 +507,9 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
497507                stderr :  err, 
498508                cmdline :  cmdline
499509            } ; 
500-             process. signal_kill ( ) . unwrap ( ) ; 
510+             if  process. signal_kill ( ) . is_err ( )  { 
511+                 println ! ( "Adb process is already finished." ) ; 
512+             } 
501513        } 
502514
503515        _=> { 
@@ -1141,7 +1153,7 @@ fn exec_compiled_test(config: &Config, props: &TestProps,
11411153
11421154    match  config. target . as_slice ( )  { 
11431155
1144-         "arm-linux-androideabi"  => { 
1156+         "arm-linux-androideabi"  |  "aarch64-linux-android"   => { 
11451157            _arm_exec_compiled_test ( config,  props,  testfile,  env) 
11461158        } 
11471159
@@ -1206,7 +1218,7 @@ fn compose_and_run_compiler(
12061218        } 
12071219
12081220        match  config. target . as_slice ( )  { 
1209-             "arm-linux-androideabi"  => { 
1221+             "arm-linux-androideabi"   |  "aarch64-linux-android"   => { 
12101222                _arm_push_aux_shared_library ( config,  testfile) ; 
12111223            } 
12121224            _ => { } 
@@ -1508,6 +1520,7 @@ fn _arm_exec_compiled_test(config: &Config,
15081520    } 
15091521    runargs. push ( format ! ( "{}/adb_run_wrapper.sh" ,  config. adb_test_dir) ) ; 
15101522    runargs. push ( format ! ( "{}" ,  config. adb_test_dir) ) ; 
1523+     runargs. push ( format ! ( "{}" ,  config. target) ) ; 
15111524    runargs. push ( format ! ( "{}" ,  prog_short) ) ; 
15121525
15131526    for  tv in  & args. args  { 
@@ -1602,7 +1615,7 @@ fn _arm_push_aux_shared_library(config: &Config, testfile: &Path) {
16021615                                            file. as_str ( ) 
16031616                                                . unwrap ( ) 
16041617                                                . to_string ( ) , 
1605-                                             config. adb_test_dir . to_string ( ) 
1618+                                             config. adb_test_dir . to_string ( ) , 
16061619                                           ] , 
16071620                                           vec ! ( ( "" . to_string( ) , 
16081621                                                 "" . to_string( ) ) ) , 
0 commit comments