2009-01-03 05:58:08 +00:00
|
|
|
# Copyright 2000, 2002, 2003, 2004, 2005, 2007, 2008, 2009
|
2008-01-01 22:53:26 +00:00
|
|
|
# Free Software Foundation, Inc.
|
2000-10-19 21:46:42 +00:00
|
|
|
|
1999-04-16 01:35:26 +00:00
|
|
|
# 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
|
2007-08-23 18:14:19 +00:00
|
|
|
# the Free Software Foundation; either version 3 of the License, or
|
1999-04-16 01:35:26 +00:00
|
|
|
# (at your option) any later version.
|
2007-08-23 18:14:19 +00:00
|
|
|
#
|
1999-04-16 01:35:26 +00:00
|
|
|
# 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.
|
2007-08-23 18:14:19 +00:00
|
|
|
#
|
1999-04-16 01:35:26 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
2007-08-23 18:14:19 +00:00
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2000-10-19 21:46:42 +00:00
|
|
|
|
2005-04-08 12:57:00 +00:00
|
|
|
# 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.
|
2000-10-19 21:46:42 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# 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:
|
1999-04-16 01:35:26 +00:00
|
|
|
#
|
2000-10-19 21:46:42 +00:00
|
|
|
# set_board_info gdb_protocol "remote"
|
|
|
|
# Unles you have a gdbserver that uses a different protocol...
|
1999-04-16 01:35:26 +00:00
|
|
|
#
|
2000-10-19 21:46:42 +00:00
|
|
|
# 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.
|
1999-04-16 01:35:26 +00:00
|
|
|
#
|
2000-10-19 21:46:42 +00:00
|
|
|
# set_board_info gdb,do_reload_on_run 1
|
|
|
|
# Unles you have a gdbserver that can handle multiple sessions.
|
1999-04-16 01:35:26 +00:00
|
|
|
#
|
2000-10-19 21:46:42 +00:00
|
|
|
# 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.
|
|
|
|
#
|
2005-04-08 12:57:00 +00:00
|
|
|
# set_board_info gdb,socketport
|
2000-10-19 21:46:42 +00:00
|
|
|
# Port id to use for socket connection. If not set explicitly,
|
|
|
|
# it will start at "2345" and increment for each use.
|
|
|
|
#
|
|
|
|
|
2005-04-08 12:57:00 +00:00
|
|
|
# The guts live in gdbserver-support.exp now.
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2005-04-08 12:57:00 +00:00
|
|
|
load_lib gdbserver-support.exp
|
1999-04-16 01:35:26 +00:00
|
|
|
|
2007-03-27 17:59:38 +00:00
|
|
|
proc gdbserver_gdb_load { } {
|
|
|
|
return [gdbserver_spawn ""]
|
2004-01-18 15:23:30 +00:00
|
|
|
}
|
|
|
|
|
2007-03-27 17:59:38 +00:00
|
|
|
proc gdb_reload { } {
|
|
|
|
return [gdbserver_run ""]
|
1999-04-16 01:35:26 +00:00
|
|
|
}
|
2007-07-02 21:29:28 +00:00
|
|
|
|
|
|
|
proc gdb_reconnect { } {
|
|
|
|
return [gdbserver_reconnect]
|
|
|
|
}
|