Home | History | Annotate | Line # | Download | only in boards
remote-gdbserver-on-localhost.exp revision 1.1
      1  1.1  christos # Copyright 2015 Free Software Foundation, Inc.
      2  1.1  christos 
      3  1.1  christos # This program is free software; you can redistribute it and/or modify
      4  1.1  christos # it under the terms of the GNU General Public License as published by
      5  1.1  christos # the Free Software Foundation; either version 3 of the License, or
      6  1.1  christos # (at your option) any later version.
      7  1.1  christos #
      8  1.1  christos # This program is distributed in the hope that it will be useful,
      9  1.1  christos # but WITHOUT ANY WARRANTY; without even the implied warranty of
     10  1.1  christos # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     11  1.1  christos # GNU General Public License for more details.
     12  1.1  christos #
     13  1.1  christos # You should have received a copy of the GNU General Public License
     14  1.1  christos # along with this program.  If not, see <http://www.gnu.org/licenses/>.
     15  1.1  christos 
     16  1.1  christos # This file is a dejagnu "board file" and is used to run the testsuite
     17  1.1  christos # with remote gdbserver on localhost.
     18  1.1  christos #
     19  1.1  christos # To use this file:
     20  1.1  christos # bash$ cd ${build_dir}/gdb
     21  1.1  christos # bash$ make check RUNTESTFLAGS="--target_board=remote-gdbserver-on-localhost"
     22  1.1  christos 
     23  1.1  christos load_generic_config "gdbserver"
     24  1.1  christos 
     25  1.1  christos # The default compiler for this target.
     26  1.1  christos set_board_info compiler  "[find_gcc]"
     27  1.1  christos 
     28  1.1  christos process_multilib_options ""
     29  1.1  christos 
     30  1.1  christos # The sshd should be running on localhost and ssh key should be
     31  1.1  christos # correctly set up that you ssh to localhost without having to type
     32  1.1  christos # password.
     33  1.1  christos set_board_info rcp_prog "/usr/bin/scp"
     34  1.1  christos set_board_info rsh_prog "/usr/bin/ssh"
     35  1.1  christos set_board_info protocol standard
     36  1.1  christos set_board_info username $env(USER)
     37  1.1  christos set_board_info hostname localhost
     38  1.1  christos 
     39  1.1  christos # We will be using the standard GDB remote protocol
     40  1.1  christos set_board_info gdb_protocol "remote"
     41  1.1  christos 
     42  1.1  christos # Test the copy of gdbserver in the build directory, of an absolute path.
     43  1.1  christos set_board_info gdb_server_prog "[pwd]/../gdbserver/gdbserver"
     44  1.1  christos 
     45  1.1  christos # Use techniques appropriate to a stub
     46  1.1  christos set_board_info use_gdb_stub 1
     47  1.1  christos 
     48  1.1  christos # This gdbserver can only run a process once per session.
     49  1.1  christos set_board_info gdb,do_reload_on_run 1
     50  1.1  christos 
     51  1.1  christos # gdbserver does not intercept target file operations and perform them
     52  1.1  christos # on the host.
     53  1.1  christos set_board_info gdb,nofileio 1
     54  1.1  christos 
     55  1.1  christos # There's no support for argument-passing (yet).
     56  1.1  christos set_board_info noargs 1
     57  1.1  christos 
     58  1.1  christos set_board_info exit_is_reliable 1
     59  1.1  christos 
     60  1.1  christos # The predefined TSVs in GDBserver.
     61  1.1  christos set_board_info gdb,predefined_tsv "\\\$trace_timestamp"
     62  1.1  christos 
     63  1.1  christos set GDBFLAGS "${GDBFLAGS} -ex \"set auto-connect-native-target off\""
     64  1.1  christos 
     65  1.1  christos proc ${board}_download { board src dest } {
     66  1.1  christos     if { [file pathtype $src] == "relative" } {
     67  1.1  christos 	return [file join [pwd] $src]
     68  1.1  christos     } else {
     69  1.1  christos 	return $src
     70  1.1  christos     }
     71  1.1  christos }
     72  1.1  christos 
     73  1.1  christos proc ${board}_upload {dest srcfile args} {
     74  1.1  christos     return $srcfile
     75  1.1  christos }
     76  1.1  christos 
     77  1.1  christos proc ${board}_file { dest op args } {
     78  1.1  christos     if { $op == "delete" } {
     79  1.1  christos 	return 0
     80  1.1  christos     }
     81  1.1  christos     return [eval [list standard_file $dest $op] $args]
     82  1.1  christos }
     83