OSDN Git Service

Initial revision
[pf3gnuchains/sourceware.git] / dejagnu / config / tic80.exp
1 #
2 # Nasty ugly stuff.
3 #
4 # We have to maintain two connections to the DOS box where the board
5 # is being held. One of them runs an I/O monitor process, while the other
6 # is used to actually start the program under test running on the board.
7 #
8
9 proc tic80_load { dest prog args } {
10     set dos_box [board_info $dest dos_host];
11
12     remote_spawn $dos_box [board_info $dest io_program];
13
14     set status [remote_ld $dest $prog];
15
16     if { $status != "pass" } {
17         return $status;
18     }
19
20     set result [remote_wait $dos_box 300];
21     set output [lindex $result 1];
22     if { [lindex $result 0] < 0 } {
23         if [board_info $dos_box exists fileid] {
24             dos_interrupt_job $dos_box;
25         } else {
26             remote_close $dos_box;
27         }
28     }
29
30     set status "fail";
31     regsub "(\\*\\*\\* EXIT code \[0-9\]+\[\r\n]+).*$" "$output" "\\1" output;
32     verbose "board out is $output";
33     set bstatus [check_for_board_status output];
34     if { [lindex $result 0] >= 0 } {
35         if { $bstatus == 0 } {
36             set status "pass";
37         }
38     }
39     remote_file build delete "a.fix";
40     return [list $status $output];
41 }
42
43 proc tic80_ld { dest prog } {
44     set dos_box [board_info $dest dos_host];
45     set dopush 0;
46
47     if { [remote_swap_conn $dos_box] == "fail" } {
48         if { [remote_push_conn $dos_box] == "fail" } {
49             set dopush 1;
50         }
51         remote_open $dos_box;
52     }
53     set prog [remote_download $dos_box $prog "a.fix"];
54
55     remote_spawn $dos_box "[board_info $dest start_program] $prog";
56     remote_expect $dos_box 10 {
57         -re "file\[(\]s\[)\] copied" {}
58     }
59     sleep 3;
60     dos_interrupt_job $dos_box;
61     if { $dopush } {
62         remote_push_conn $dos_box;
63     } else {
64         remote_swap_conn $dos_box;
65     }
66     return "pass";
67 }
68 #
69 # Close the connection to the DOS box.
70 #
71 proc tic80_close { host } {
72     set dos_box [board_info $host dos_host];
73
74     return [remote_close $dos_box];
75 }
76
77 set_board_info protocol "tic80";
78 set_board_info gdb,use_standard_load 1;
79 set_board_info gdb,no_push_conn 1;
80 set_board_info gdb,do_reload_on_run 1;
81 set_board_info gdb,use_breakpoint_for_stub 1