OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /openrisc/tags/gdb/gdb-6.8/gdb-6.8.openrisc-2.1/gdb/testsuite/config
    from Rev 24 to Rev 33
    Reverse comparison

Rev 24 → Rev 33

/default.exp
0,0 → 1,16
# Copyright (C) 2007, 2008 Free Software Foundation, Inc.
 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
 
load_lib gdb.exp
/rom68k.exp
0,0 → 1,19
# Copyright 1997, 2007, 2008 Free Software Foundation, Inc.
 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
 
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
 
load_lib ../config/monitor.exp
/mips-idt.exp
0,0 → 1,16
# Copyright (C) 1993, 1997, 2007, 2008 Free Software Foundation, Inc.
 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
 
load_lib ../config/monitor.exp
/proelf.exp
0,0 → 1,19
# Copyright 1997, 2007, 2008 Free Software Foundation, Inc.
 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
 
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
 
load_lib ../config/monitor.exp
/monitor.exp
0,0 → 1,259
# Test Framework Driver for GDB driving a ROM monitor (via monitor.c).
# Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2007, 2008
# Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
 
load_lib gdb.exp
# puts "***** DID USE MONITOR ******"
 
#
# gdb_target_cmd
# Send gdb the "target" command
#
proc gdb_target_cmd { targetname serialport } {
global gdb_prompt
 
for {set i 1} {$i <= 3} {incr i} {
send_gdb "target $targetname $serialport\n"
gdb_expect 60 {
-re "A program is being debugged already.*ill it.*y or n. $" {
send_gdb "y\n";
exp_continue;
}
-re "Couldn't establish connection to remote.*$gdb_prompt" {
verbose "Connection failed";
}
-re "Remote MIPS debugging.*$gdb_prompt" {
verbose "Set target to $targetname";
return 0;
}
-re "Remote debugging using .*$serialport.*$gdb_prompt" {
verbose "Set target to $targetname";
return 0;
}
-re "Remote target $targetname connected to.*$gdb_prompt" {
verbose "Set target to $targetname";
return 0;
}
-re "Connected to.*$gdb_prompt" {
verbose "Set target to $targetname";
return 0;
}
-re "Ending remote.*$gdb_prompt" { }
-re "Connection refused.*$gdb_prompt" {
verbose "Connection refused by remote target. Pausing, and trying again."
sleep 30
continue
}
-re "Timeout reading from remote system.*$gdb_prompt" {
verbose "Got timeout error from gdb.";
}
timeout {
send_gdb "";
break
}
}
}
return 1
}
 
 
 
#
# gdb_target_monitor
# Set gdb to target the monitor
#
proc gdb_target_monitor { exec_file } {
global gdb_prompt
global exit_status
global timeout
 
if [target_info exists gdb_protocol] {
set targetname "[target_info gdb_protocol]"
} else {
perror "No protocol specified for [target_info name].";
return -1;
}
if [target_info exists baud] {
gdb_test "set remotebaud [target_info baud]" "" ""
}
if [target_info exists binarydownload] {
gdb_test "set remotebinarydownload [target_info binarydownload]" "" ""
}
if { [ target_info exists disable_x_packet ] } {
gdb_test "set remote X-packet disable" ""
}
if { [ target_info exists disable_z_packet ] } {
gdb_test "set remote Z-packet disable" ""
}
if [target_info exists gdb_serial] {
set serialport "[target_info gdb_serial]";
} elseif [target_info exists netport] {
set serialport "[target_info netport]"
} else {
set serialport "[target_info serial]"
}
 
for {set j 1} {$j <= 2} {incr j} {
if [gdb_file_cmd $exec_file] { return -1; }
 
if ![gdb_target_cmd $targetname $serialport] { return 0; }
 
gdb_target_exec;
 
if { $j == 1 && ![reboot_target] } {
break;
}
}
 
perror "Couldn't set target for $targetname, port is $serialport.";
return -1;
}
 
proc gdb_target_exec { } {
gdb_test "target exec" "No executable file now." "" ".*Kill it.*y or n.*" "y"
}
#
# gdb_load -- load a file into the debugger.
# return a -1 if anything goes wrong.
#
proc gdb_load { arg } {
global verbose
global loadpath
global loadfile
global GDB
global gdb_prompt
global timeout
global last_gdb_file;
 
if { $arg == "" } {
if [info exists last_gdb_file] {
set arg $last_gdb_file;
} else {
send_gdb "info files\n";
gdb_expect 30 {
-re "Symbols from \"(\[^\"\]+)\"" {
set arg $expect_out(1,string);
exp_continue;
}
-re "Local exec file:\[\r\n\]+\[ \t\]*`(\[^'\]+)'," {
set arg $expect_out(1,string);
exp_continue;
}
-re "$gdb_prompt $" { }
}
}
}
 
set last_gdb_file $arg;
 
for { set j 1; } { $j <= 2 } {incr j; } {
if [target_info exists gdb,use_standard_load] {
gdb_target_exec;
if ![target_info exists gdb,no_push_conn] {
remote_push_conn host;
}
set state [remote_ld target $arg];
if ![target_info exists gdb,no_push_conn] {
remote_close target;
remote_pop_conn host;
}
if { $state == "pass" } {
if [gdb_target_monitor $arg] { return -1; }
gdb_test "list main" ".*" ""
verbose "Loaded $arg into $GDB\n";
return 0;
}
} else {
 
if [gdb_target_monitor $arg] { return -1 }
 
if [is_remote host] {
# FIXME: Multiple downloads. bleah.
set farg [remote_download host $arg];
} else {
set farg $arg;
}
 
if { $arg != "" && [target_info exists gdb_sect_offset] } {
set textoff [target_info gdb_sect_offset];
send_gdb "sect .text $textoff\n";
gdb_expect 30 {
-re "(0x\[0-9a-z]+) - 0x\[0-9a-z\]+ is \\.data" {
set dataoff $expect_out(1,string);
exp_continue;
}
-re "(0x\[0-9a-z\]+) - 0x\[0-9a-z\]+ is \\.bss" {
set bssoff $expect_out(1,string);
exp_continue;
}
-re "$gdb_prompt" { }
}
set dataoff [format 0x%x [expr $dataoff + $textoff]];
set bssoff [format 0x%x [expr $bssoff + $textoff]];
send_gdb "sect .data $dataoff\n";
gdb_expect 30 {
-re "$gdb_prompt" { }
}
send_gdb "sect .bss $bssoff\n";
gdb_expect 30 {
-re "$gdb_prompt" { }
}
}
 
verbose "Loading $farg"
if [target_info exists gdb_load_offset] {
set command "load $farg [target_info gdb_load_offset]\n";
} else {
set command "load $farg\n";
}
if [target_info exists gdb_load_timeout] {
set loadtimeout [target_info gdb_load_timeout]
} else {
set loadtimeout 1600
}
 
send_gdb $command;
gdb_expect $loadtimeout {
-re "\[Ff\]ailed.*$gdb_prompt $" {
verbose "load failed";
}
-re "Timeout reading from remote.*$gdb_prompt" {
}
-re "$gdb_prompt $" {
verbose "Loaded $farg into $GDB\n"
return 0;
}
timeout {
if { $verbose > 1 } {
perror "Timed out trying to load $farg."
}
}
}
}
 
# Make sure we don't have an open connection to the target.
gdb_target_exec;
 
if { $j == 1 } {
if { ![reboot_target] } {
break;
}
}
}
perror "Couldn't load file into GDB.";
return -1;
}
/i960.exp
0,0 → 1,19
# Copyright 1997, 2007, 2008 Free Software Foundation, Inc.
 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
 
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
 
load_lib ../config/monitor.exp
/m68k-emc.exp
0,0 → 1,17
load_lib gdb.exp
load_lib "../config/monitor.exp"
 
proc gdb_emclaptop_command { command } {
global board_info;
set tname [board_info target name];
 
if ![info exists board_info($tname,m68k_connected)] {
m68k_emc_board_connect target;
}
# This is about all we can do for now. *sigh*
set dos_host [board_info target dos_host];
 
remote_send $dos_host "${command}\n";
#remote_expect $dos_host {
#}
}
/sim.exp
0,0 → 1,88
# Test Framework Driver for GDB driving a builtin simulator
# Copyright 1994, 1997, 1998, 2004, 2007, 2008
# Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
 
load_lib gdb.exp
 
#
# gdb_target_sim
# Set gdb to target the simulator
#
proc gdb_target_sim { } {
global gdb_prompt
set target_sim_options "[board_info target gdb,target_sim_options]";
 
send_gdb "target sim $target_sim_options\n"
set timeout 60
verbose "Timeout is now $timeout seconds" 2
gdb_expect {
-re "Connected to the simulator.*$gdb_prompt $" {
verbose "Set target to sim"
}
timeout {
perror "Couldn't set target for simulator."
cleanup
return -1
}
}
set timeout 10
verbose "Timeout is now $timeout seconds" 2
return 0
}
 
#
# gdb_load -- load a file into the debugger.
# return a -1 if anything goes wrong.
#
proc gdb_load { arg } {
global verbose
global loadpath
global loadfile
global GDB
global gdb_prompt
 
if { $arg != "" } {
if [gdb_file_cmd $arg] then { return -1 }
}
 
if [gdb_target_sim] then { return -1 }
 
send_gdb "load\n"
set timeout 2400
verbose "Timeout is now $timeout seconds" 2
gdb_expect {
-re ".*$gdb_prompt $" {
if $verbose>1 then {
send_user "Loaded $arg into $GDB\n"
}
set timeout 30
verbose "Timeout is now $timeout seconds" 2
return 0
}
-re "$gdb_prompt $" {
if $verbose>1 then {
perror "GDB couldn't load."
}
}
timeout {
if $verbose>1 then {
perror "Timed out trying to load $arg."
}
}
}
return -1
}
/cfdbug.exp
0,0 → 1,19
# Copyright 1997, 1999, 2007, 2008 Free Software Foundation, Inc.
 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
 
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
 
load_lib "../config/monitor.exp"
/vr5000.exp
0,0 → 1,19
# Copyright 1997, 2007, 2008 Free Software Foundation, Inc.
 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
 
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
 
load_lib ../config/monitor.exp
/cygmon.exp
0,0 → 1,19
load_lib "../config/monitor.exp";
/vx.exp
0,0 → 1,127
# Copyright 1988, 1990, 1991, 1992, 1995, 1997, 2007, 2008
# Free Software Foundation, Inc.
 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
 
# This file was written by Rob Savoye. (rob@cygnus.com)
 
#
# load support libraries
#
load_lib remote.exp
load_lib gdb.exp
 
set shell_prompt "->"
set gdb_prompt "\\(vxgdb\\)"
 
#
# gdb_version -- extract and print the version number of gcc
#
proc gdb_version {} {
default_gdb_version
}
 
#
# gdb_load -- load a file into the debugger.
# We have to stop and start gdb each time we do this, because when
# vxgdb loads two files in a row, the symbols in the first file loaded
# take precedence. Returns -1 on error, else 0.
#
proc gdb_load { arg } {
set result 0
 
if { [remote_ld target $arg] != 0 } {
perror "Couldn't load $arg"
return -1
}
 
return [gdb_file_cmd $arg]
}
 
#
# gdb_start -- start gdb running
#
proc gdb_start { } {
global gdb_prompt
global verbose
global connectmode
global reboot
 
# get a connection to the board
for { set x 0; } { $x < 3 } { incr x } {
set shell_id [remote_open target]
if { $shell_id > 0 } {
verbose "Spawn id for remote shell is $shell_id"
 
set timeout 10
verbose "Timeout is now $timeout seconds" 2
 
set state [spawn_vxgdb];
if { $state == "pass" } {
return 0;
}
if { $state == "fail" } {
return -1;
}
}
remote_reboot target;
}
}
 
proc spawn_vxgdb { } {
global gdb_prompt
 
default_gdb_start
 
# set the default arguments to "main", so that "run" with no
# arguments will work correctly.
send_gdb "set args main\n"
gdb_expect -re ".*$gdb_prompt $" {}
 
verbose "Setting up target, Please wait..."
# set targets hostname
send_gdb "target vxworks [target_info hostname]\n"
set timeout 60
verbose "Timeout is now $timeout seconds" 2
gdb_expect {
-re "Done\..*$gdb_prompt $" {
verbose "Set target to [target_info hostname]" 1
set timeout 10;
return "pass";
}
-re "net_connect: RPC: (Program not registered|.*Timed out).*$" {
warning "Couldn't set GDB to target [target_info netport]."
}
timeout {
warning "Couldn't set target for vxworks."
}
}
return "retry";
}
 
proc gdb_exit { } {
remote_close target;
catch default_gdb_exit
}
 
#expect_after {
# "<return>" { send "\n"; perror "Window too small." }
# -re "\(y or n\) " { send "n\n"; perror "Got interactive prompt." }
# buffer_full { perror "internal buffer is full." }
# eof { perror "eof -- pty is hosed." }
# timeout { perror "timeout." }
# "virtual memory exhausted" { perror "virtual memory exhausted." }
# "Undefined command" { perror "send string probably wrong." }
#}
 
/vr4300.exp
0,0 → 1,19
# Copyright 1997, 2007, 2008 Free Software Foundation, Inc.
 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
 
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
 
load_lib ../config/monitor.exp
/m32r-stub.exp
0,0 → 1,19
load_lib "../../testsuite/config/sparclet.exp"
/i386-bozo.exp
0,0 → 1,19
load_lib "../config/monitor.exp"
/h8300.exp
0,0 → 1,19
load_lib "../config/monitor.exp";
/mips.exp
0,0 → 1,16
# Copyright (C) 1993, 1997, 2007, 2008 Free Software Foundation, Inc.
 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
 
load_lib ../config/monitor.exp
/vxworks29k.exp
0,0 → 1,23
# Copyright 1995, 1997, 2007, 2008 Free Software Foundation, Inc.
 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
 
# This file was written by Brendan Kehoe (brendan@cygnus.com).
 
# We need this file here because the targetname for the 29k board
# is `vxworks29k', not `vxworks'. That way other tools (e.g., gcc)
# can differentiate between the stuff run on that board and others.
 
verbose "Loading ${srcdir}/config/vx.exp"
source ${srcdir}/config/vx.exp
/d10v.exp
0,0 → 1,19
# Copyright (C) 1997, 2007, 2008 Free Software Foundation, Inc.
 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
 
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
 
load_lib "../config/monitor.exp"
/sh.exp
0,0 → 1,19
# Copyright 1997, 2007, 2008 Free Software Foundation, Inc.
 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
 
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
 
load_lib ../config/monitor.exp
/arm-ice.exp
0,0 → 1,19
load_lib "../config/monitor.exp";
/dve.exp
0,0 → 1,22
# Copyright 1998, 2007, 2008 Free Software Foundation, Inc.
 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
 
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
 
load_lib ../config/monitor.exp
set timeout 1000
verbose "Timeout is now $timeout seconds" 2
 
/sid.exp
0,0 → 1,217
# Test Framework Driver for GDB driving an external simulator
# Copyright 1999, 2001, 2007, 2008 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
 
load_lib gdb.exp
 
proc sid_start {} {
global verbose
 
set port [lindex [split [target_info netport] ":"] 1]
 
# Set a default endianness
case [target_info multilib_flags] in {
{ *big-endian* *-EB* *-meb* } { set sidendian "-EB" }
{ *little-endian* *-EL* *-mel* } { set sidendian "-EL" }
default {
if {[target_info exists sim,defaultendian]} then {
set sidendian [target_info sim,defaultendian]
} else {
# rely on endianness settings in sid configuration defaults
set sidendian ""
}
}
}
case $sidendian in {
{ -EB } { set sidendian2 {-e "set cpu endian big"} }
{ -EL } { set sidendian2 {-e "set cpu endian little"} }
default { set sidendian2 {} }
}
 
# test to see whether to use use sid in build or install tree
set use_build_tree [file exists ../../sid]
 
if {$use_build_tree} then {
set pre_spawn {
global env
set env(SID_LIBRARY_PATH) [join [glob "../../sid/component/*"] ":"]
set env(SID) "../../sid/main/dynamic/sid"
if {! [file exists $env(SID)]} then { error "Cannot find sid in build tree" }
}
if { [board_info target sim,protocol] == "sid" } {
set spawncmd "[target_info sim] [target_info sim,options] $sidendian2 -e \"set cpu-gdb-socket sockaddr-local 0.0.0.0:$port\""
} elseif { [board_info target sim,protocol] == "rawsid" } {
set spawncmd "[target_info sim] [target_info sim,options] -$sidendian --gdb=$port"
} else {
set spawncmd "../../sid/bsp/[target_info sim] $sidendian --gdb=$port [target_info sim,options]"
}
set post_spawn {
global env
unset env(SID_LIBRARY_PATH)
unset env(SID)
}
} else {
set pre_spawn {}
if { [board_info target sim,protocol] == "sid" } {
# FIXME: sim,options may be from the build tree, should find
# it in the install tree.
set spawncmd "sid [target_info sim,options] $sidendian2 -e \"set cpu-gdb-socket sockaddr-local 0.0.0.0:$port\""
} elseif { [board_info target sim,protocol] == "rawsid" } {
set spawncmd "[target_info sim] [target_info sim,options] -$sidendian --gdb=$port"
} else {
set spawncmd "[target_info sim] $sidendian --gdb=$port [target_info sim,options]"
}
set post_spawn {}
}
 
eval $pre_spawn
if {[catch [list remote_spawn host $spawncmd] msg]} {
perror $msg
exit 1
}
eval $post_spawn
 
# Don't do the following any more; it breaks with "runtest ... < /dev/null"
# expect_background {
# -re \[^\n\]*\n {
# regsub "\n" $expect_out(buffer) {} msg
# verbose "SID: $msg" 2
# }
# }
 
# There should be no need to sleep to give SID time to start;
# GDB would wait for a fair while for the stub to respond.
sleep 4
 
if ![target_info exists gdb,no_push_conn] {
remote_push_conn host;
}
}
 
#
# Handle GDB talking to SID
#
 
proc gdb_start {} {
sid_start
return [default_gdb_start]
}
 
proc sid_exit {} {
if ![target_info exists gdb,no_push_conn] {
remote_close host;
remote_pop_conn host;
}
}
 
proc gdb_exit {} {
set result [default_gdb_exit]
sid_exit
return $result
}
 
#
# gdb_target_sid
# Set gdb to target the simulator
#
proc send_target_sid { } {
# wait a little while, giving sid time to shut down & restart its
# gdb socket
sleep 4
send_gdb "target [target_info gdb_protocol] [target_info netport]\n"
}
 
proc gdb_target_sid { } {
global gdb_prompt
global exit_status
 
send_target_sid
 
global timeout
set prev_timeout $timeout
set timeout 60
verbose "Timeout is now $timeout seconds" 2
gdb_expect {
-re ".*\[Ee\]rror.*$gdb_prompt $" {
perror "Couldn't set target for remote simulator."
cleanup
gdb_exit
}
-re "Remote debugging using.*$gdb_prompt" {
verbose "Set target to sid"
}
timeout {
perror "Couldn't set target for remote simulator."
cleanup
gdb_exit
}
}
set timeout $prev_timeout
verbose "Timeout is now $timeout seconds" 2
}
 
#
# gdb_load -- load a file into the debugger.
# return a -1 if anything goes wrong.
#
proc gdb_load { arg } {
global verbose
global loadpath
global loadfile
global GDB
global gdb_prompt
global retval
 
if { $arg != "" } {
if [gdb_file_cmd $arg] then { return -1 }
}
 
gdb_target_sid
 
send_gdb "load\n"
global timeout
set prev_timeout $timeout
set timeout 2400
verbose "Timeout is now $timeout seconds" 2
gdb_expect {
-re ".*\[Ee\]rror.*$gdb_prompt $" {
if $verbose>1 then {
perror "Error during download."
}
set retval -1;
}
-re ".*$gdb_prompt $" {
if $verbose>1 then {
send_user "Loaded $arg into $GDB\n"
}
set retval 0;
}
-re "$gdb_prompt $" {
if $verbose>1 then {
perror "GDB couldn't load."
}
set retval -1;
}
timeout {
if $verbose>1 then {
perror "Timed out trying to load $arg."
}
set retval -1;
}
}
set timeout $prev_timeout
verbose "Timeout is now $timeout seconds" 2
return $retval;
}
/slite.exp
0,0 → 1,179
# Copyright 1993, 1997, 1998, 2007, 2008 Free Software Foundation, Inc.
 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
 
# This file was written by Ian Lance Taylor <ian@cygnus.com>.
 
# GDB support routines for a board using the MIPS remote debugging
# protocol. These are actually pretty generic.
 
# DejaGnu currently assumes that debugging is being done over the main
# console port. It would probably be more convenient for people using
# IDT boards to permit the debugging port and the connected port to be
# different, since an IDT board has two ports. This would require
# extending some of the tests in a fashion similar to that done for
# VxWorks, because the test output would appear on the other port,
# rather than being displayed by gdb.
 
load_lib remote.exp
load_lib gdb.exp
set gdb_prompt "\\(gdb\\)"
 
#
# gdb_load -- load a file into the GDB.
# Returns a 0 if there was an error,
# 1 if it load successfully.
#
proc gdb_load { arg } {
global verbose
global loadpath
global loadfile
global gdb_prompt
global GDB
global expect_out
 
set loadfile [file tail $arg]
set loadpath [file dirname $arg]
 
gdb_file_cmd $arg
 
if [target_info exists gdb_protocol] {
set protocol [target_info gdb_protocol];
} else {
set protocol "sparclite"
}
 
if [target_info exists serial] {
set targetname [target_info serial];
set command "target $protocol [target_info serial]\n";
} else {
if ![target_info exists netport] {
perror "Need either netport or gdb_serial entry for [target_info name].";
return -1;
}
set targetname [target_info netport];
set command "target $protocol udp [target_info netport]\n";
}
set timeout 60
verbose "Timeout is now $timeout seconds" 2
set try_count 0;
send_gdb $command;
gdb_expect {
-re "Unknown response.*resetting the board.|remote timeout" {
incr try_count;
if { $try_count > 3 } {
set try_count 0;
reboot_target;
sleep 5;
}
sleep 1;
send_gdb $command;
exp_continue;
}
-re "Remote target.*$gdb_prompt $" { }
-re ".*SPARClite appears to be alive.*$gdb_prompt $" {
if $verbose>1 then {
send_user "Set target to $targetname\n"
}
}
timeout {
perror "Couldn't set SLITE target."
set timeout 10
verbose "Timeout is now $timeout seconds" 2
return -1
}
}
if [target_info exists gdb_load_offset] {
set offset "[target_info gdb_load_offset]";
} else {
set offset "";
}
if { 1 } {
if [is_remote host] {
set arg [remote_download host $arg];
if { $arg == "" } {
error "download failed"
return -1;
}
}
send_gdb "load $arg $offset\n"
verbose "Loading $arg into $GDB" 2
set timeout 2400
verbose "Timeout is now $timeout seconds" 2
gdb_expect {
-re "Loading.*$gdb_prompt $" {
verbose "Loaded $arg into $GDB" 1
set timeout 30
verbose "Timeout is now $timeout seconds" 2
}
-re "$gdb_prompt $" {
if $verbose>1 then {
perror "GDB couldn't load."
}
}
timeout {
if $verbose>1 then {
perror "Timed out trying to load $arg."
}
}
}
}
# Some SPARClite boards automagically do a run after the program is
# loaded.
if [target_info exists need_monitor_run] {
set timeout 10
verbose "Timeout is now $timeout seconds, doing monitor run" 2
send_gdb "monitor run\n";
sleep 2;
send_gdb "";
gdb_expect {
-re ".*$gdb_prompt $" { verbose "Run command succeded" }
default {
perror "error sending monitor run command";
}
}
} else {
sleep 2;
}
 
if [target_info exists gdb_serial] {
set serial [target_info gdb_serial];
} else {
set serial [target_info serial];
}
send_gdb "target remote $serial\n"
set timeout 60
verbose "Timeout is now $timeout seconds" 2
gdb_expect {
-re ".*Kill it?.*y or n.*" {
send_gdb "y\n";
exp_continue
}
-re ".*$gdb_prompt $" {
verbose "Set remote target to [target_info serial]" 2
}
timeout {
perror "Couldn't set remote target."
set timeout 10
verbose "Timeout is now $timeout seconds" 2
return -1
}
}
 
if [info exists expect_out(buffer)] then {
send_log $expect_out(buffer)
}
return 0
}
/mn10300-eval.exp
0,0 → 1,22
# Copyright 1998, 2007, 2008 Free Software Foundation, Inc.
 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
 
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
 
load_lib ../config/monitor.exp
set timeout 1000
verbose "Timeout is now $timeout seconds" 2
 
/m32r.exp
0,0 → 1,22
# Copyright 1997, 2007, 2008 Free Software Foundation, Inc.
 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
 
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
 
load_lib ../config/monitor.exp
set timeout 120
verbose "Timeout is now $timeout seconds" 2
 
/gdbserver.exp
0,0 → 1,87
# Copyright 2000, 2002, 2003, 2004, 2005, 2007, 2008
# Free Software Foundation, Inc.
 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
 
# Test framework for GDB (remote protocol) using a "gdbserver",
# ie. a debug agent running as a native process on the same or
# a different host.
 
#
# This module to be used for testing gdb with a "gdbserver"
# built either from libremote or from gdb/gdbserver.
#
 
#
# To be addressed or set in your baseboard config file:
#
# set_board_info gdb_protocol "remote"
# Unles you have a gdbserver that uses a different protocol...
#
# set_board_info use_gdb_stub 1
# This tells the rest of the test suite not to do things
# like "run" which don't work well on remote targets.
#
# set_board_info gdb,do_reload_on_run 1
# Unles you have a gdbserver that can handle multiple sessions.
#
# set_board_info noargs 1
# At present there is no provision in the remote protocol
# for passing arguments. This test framework does not
# address the issue, so it's best to set this variable
# in your baseboard configuration file.
# FIXME: there's no reason why the test harness couldn't
# pass commandline args when it spawns gdbserver.
#
# set_board_info gdb,noinferiorio 1
# Neither the traditional gdbserver nor the one in libremote
# can presently capture stdout and relay it to GDB via the
# 'O' packet. This means that tests involving printf will
# fail unles you set this varibale in your baseboard
# configuration file.
#
# set_board_info gdb,no_hardware_watchpoints 1
# Unles you have a gdbserver that supports hardware watchpoints.
# FIXME: gdb should detect if the target doesn't support them,
# and fall back to using software watchpoints.
#
# set_board_info gdb_server_prog
# This will be the path to the gdbserver program you want to test.
# Defaults to "gdbserver".
#
# set_board_info sockethost
# The name of the host computer whose socket is being used.
# Defaults to "localhost". Note: old gdbserver requires
# that you define this, but libremote/gdbserver does not.
#
# set_board_info gdb,socketport
# Port id to use for socket connection. If not set explicitly,
# it will start at "2345" and increment for each use.
#
 
# The guts live in gdbserver-support.exp now.
 
load_lib gdbserver-support.exp
 
proc gdbserver_gdb_load { } {
return [gdbserver_spawn ""]
}
 
proc gdb_reload { } {
return [gdbserver_run ""]
}
 
proc gdb_reconnect { } {
return [gdbserver_reconnect]
}
/unix.exp
0,0 → 1,29
# Copyright (C) 1988, 1990, 1991, 1992, 1994, 1997, 2007, 2008
# Free Software Foundation, Inc.
 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
 
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
 
# This file was written by Rob Savoye. (rob@cygnus.com)
 
# Set a default timeout to be used for the tests under UNIX, rather than
# accepting whatever default dejagnu gives us (apparently 10 seconds).
# When running the tests over NFS, under somewhat heavy load, 10 seconds
# does not seem to be enough. Try starting with 60.
set timeout 60
verbose "Timeout is now $timeout seconds" 2
 
load_lib gdb.exp
/vxworks.exp
0,0 → 1,19
# Copyright 1997, 2007, 2008 Free Software Foundation, Inc.
 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
 
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
 
load_lib ../config/vx.exp

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.