~ubuntu-branches/ubuntu/warty/dejagnu/warty

« back to all changes in this revision

Viewing changes to config/tic80.exp

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Jacobowitz
  • Date: 2004-02-09 15:07:58 UTC
  • Revision ID: james.westby@ubuntu.com-20040209150758-oaj7r5zrop60v8sb
Tags: upstream-1.4.4
ImportĀ upstreamĀ versionĀ 1.4.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software
 
2
# Foundation, Inc.
 
3
#
 
4
# This file is part of DejaGnu.
 
5
#
 
6
# DejaGnu is free software; you can redistribute it and/or modify it
 
7
# under the terms of the GNU General Public License as published by
 
8
# the Free Software Foundation; either version 2 of the License, or
 
9
# (at your option) any later version.
 
10
#
 
11
# DejaGnu is distributed in the hope that it will be useful, but
 
12
# WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
14
# General Public License for more details.
 
15
#
 
16
# You should have received a copy of the GNU General Public License
 
17
# along with DejaGnu; if not, write to the Free Software Foundation,
 
18
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
19
 
 
20
#
 
21
# Nasty ugly stuff.
 
22
#
 
23
# We have to maintain two connections to the DOS box where the board
 
24
# is being held. One of them runs an I/O monitor process, while the other
 
25
# is used to actually start the program under test running on the board.
 
26
#
 
27
 
 
28
proc tic80_load { dest prog args } {
 
29
    set dos_box [board_info $dest dos_host]
 
30
 
 
31
    remote_spawn $dos_box [board_info $dest io_program]
 
32
 
 
33
    set status [remote_ld $dest $prog]
 
34
 
 
35
    if { $status != "pass" } {
 
36
        return $status
 
37
    }
 
38
 
 
39
    set result [remote_wait $dos_box 300]
 
40
    set output [lindex $result 1]
 
41
    if { [lindex $result 0] < 0 } {
 
42
        if [board_info $dos_box exists fileid] {
 
43
            dos_interrupt_job $dos_box
 
44
        } else {
 
45
            remote_close $dos_box
 
46
        }
 
47
    }
 
48
 
 
49
    set status "fail"
 
50
    regsub "(\\*\\*\\* EXIT code \[0-9\]+\[\r\n]+).*$" "$output" "\\1" output
 
51
    verbose "board out is $output"
 
52
    set bstatus [check_for_board_status output]
 
53
    if { [lindex $result 0] >= 0 } {
 
54
        if { $bstatus == 0 } {
 
55
            set status "pass"
 
56
        }
 
57
    }
 
58
    remote_file build delete "a.fix"
 
59
    return [list $status $output]
 
60
}
 
61
 
 
62
proc tic80_ld { dest prog } {
 
63
    set dos_box [board_info $dest dos_host]
 
64
    set dopush 0
 
65
 
 
66
    if { [remote_swap_conn $dos_box] == "fail" } {
 
67
        if { [remote_push_conn $dos_box] == "fail" } {
 
68
            set dopush 1
 
69
        }
 
70
        remote_open $dos_box
 
71
    }
 
72
    set prog [remote_download $dos_box $prog "a.fix"]
 
73
 
 
74
    remote_spawn $dos_box "[board_info $dest start_program] $prog"
 
75
    remote_expect $dos_box 10 {
 
76
        -re "file\[(\]s\[)\] copied" {}
 
77
    }
 
78
    sleep 3
 
79
    dos_interrupt_job $dos_box
 
80
    if { $dopush } {
 
81
        remote_push_conn $dos_box
 
82
    } else {
 
83
        remote_swap_conn $dos_box
 
84
    }
 
85
    return "pass"
 
86
}
 
87
#
 
88
# Close the connection to the DOS box.
 
89
#
 
90
proc tic80_close { host } {
 
91
    set dos_box [board_info $host dos_host]
 
92
 
 
93
    return [remote_close $dos_box]
 
94
}
 
95
 
 
96
set_board_info protocol "tic80"
 
97
set_board_info gdb,use_standard_load 1
 
98
set_board_info gdb,no_push_conn 1
 
99
set_board_info gdb,do_reload_on_run 1
 
100
set_board_info gdb,use_breakpoint_for_stub 1