2018-01-01 05:43:02 +01:00
|
|
|
# Copyright 2002-2018 Free Software Foundation, Inc.
|
2002-09-25 22:30:38 +02: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 20:14:19 +02:00
|
|
|
# the Free Software Foundation; either version 3 of the License, or
|
2002-09-25 22:30:38 +02:00
|
|
|
# (at your option) any later version.
|
2007-08-23 20:14:19 +02:00
|
|
|
#
|
2002-09-25 22:30:38 +02: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 20:14:19 +02:00
|
|
|
#
|
2002-09-25 22:30:38 +02:00
|
|
|
# You should have received a copy of the GNU General Public License
|
2007-08-23 20:14:19 +02:00
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2002-09-25 22:30:38 +02:00
|
|
|
|
|
|
|
# The doco makes reference to built-in registers -- $pc and $fp. If
|
|
|
|
# the ISA contains registers by that name then they should be
|
|
|
|
# displayed. If the ISA contains registers identified as being
|
|
|
|
# equivalent, but have different names, then GDB will provide these as
|
|
|
|
# aliases. If the ISA doesn't provide any equivalent registers, then
|
|
|
|
# GDB will provide registers that map onto the frame's PC and FP.
|
|
|
|
|
|
|
|
#
|
|
|
|
# test running programs
|
|
|
|
#
|
|
|
|
|
test suite update - gdb.base/[n-r]
Convert files gdb.base/[n-r]*.exp to use standard_output_file et al.
* gdb.base/nextoverexit.exp, gdb.base/nextoverexit.exp,
gdb.base/nodebug.exp, gdb.base/nofield.exp, gdb.base/nostdlib.exp,
gdb.base/opaque.exp, gdb.base/overlays.exp, gdb.base/pc-fp.exp,
gdb.base/pending.exp, gdb.base/permissions.exp,
gdb.base/pie-execl.exp, gdb.base/pointers.exp,
gdb.base/pr11022.exp, gdb.base/print-file-var.exp,
gdb.base/printcmds.exp, gdb.base/prologue.exp,
gdb.base/psymtab.exp, gdb.base/ptr-typedef.exp,
gdb.base/ptype.exp, gdb.base/randomize.exp,
gdb.base/readline-ask.exp, gdb.base/recpar.exp,
gdb.base/recurse.exp, gdb.base/relativedebug.exp,
gdb.base/relocate.exp, gdb.base/remote.exp, gdb.base/reread.exp,
gdb.base/return-nodebug.exp, gdb.base/return2.exp: Use
standard_testfile, standard_output_file, prepare_for_testing,
clean_restart.
2013-06-27 20:53:49 +02:00
|
|
|
standard_testfile
|
2002-09-25 22:30:38 +02:00
|
|
|
|
test suite update - gdb.base/[n-r]
Convert files gdb.base/[n-r]*.exp to use standard_output_file et al.
* gdb.base/nextoverexit.exp, gdb.base/nextoverexit.exp,
gdb.base/nodebug.exp, gdb.base/nofield.exp, gdb.base/nostdlib.exp,
gdb.base/opaque.exp, gdb.base/overlays.exp, gdb.base/pc-fp.exp,
gdb.base/pending.exp, gdb.base/permissions.exp,
gdb.base/pie-execl.exp, gdb.base/pointers.exp,
gdb.base/pr11022.exp, gdb.base/print-file-var.exp,
gdb.base/printcmds.exp, gdb.base/prologue.exp,
gdb.base/psymtab.exp, gdb.base/ptr-typedef.exp,
gdb.base/ptype.exp, gdb.base/randomize.exp,
gdb.base/readline-ask.exp, gdb.base/recpar.exp,
gdb.base/recurse.exp, gdb.base/relativedebug.exp,
gdb.base/relocate.exp, gdb.base/remote.exp, gdb.base/reread.exp,
gdb.base/return-nodebug.exp, gdb.base/return2.exp: Use
standard_testfile, standard_output_file, prepare_for_testing,
clean_restart.
2013-06-27 20:53:49 +02:00
|
|
|
if [get_compiler_info] {
|
2006-08-10 07:27:22 +02:00
|
|
|
return -1
|
2002-09-25 22:30:38 +02:00
|
|
|
}
|
|
|
|
|
2016-12-23 17:52:18 +01:00
|
|
|
if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug nowarnings}]} {
|
2002-09-25 22:30:38 +02:00
|
|
|
return -1
|
|
|
|
}
|
|
|
|
|
|
|
|
if ![runto_main] then {
|
|
|
|
perror "couldn't run to breakpoint"
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# Get the value of PC and FP
|
|
|
|
|
2009-02-14 01:27:56 +01:00
|
|
|
set valueof_pc [get_hexadecimal_valueof "\$pc" "0"]
|
|
|
|
set valueof_fp [get_hexadecimal_valueof "\$fp" "0"]
|
2002-09-25 22:30:38 +02:00
|
|
|
|
|
|
|
# Check that the sequence $REGNAME -> REGNUM -> $REGNAME works. Use
|
|
|
|
# display since that encodes and then decodes the expression parameter
|
|
|
|
# (and hence uses the mechanisms we're trying to test).
|
|
|
|
|
2009-10-21 20:02:27 +02:00
|
|
|
gdb_test "display/i \$pc" "1: x/i +\\\$pc( +|\r\n)=> ${valueof_pc}.*"
|
2002-09-25 22:30:38 +02:00
|
|
|
gdb_test "display/w \$fp" "2: x/xw +\\\$fp +${valueof_fp}.*"
|
|
|
|
|
2012-02-15 20:13:14 +01:00
|
|
|
gdb_test "info register \$pc" "${valueof_pc}.*"
|
|
|
|
gdb_test "info register \$fp" "${valueof_fp}.*"
|
2002-09-25 22:30:38 +02:00
|
|
|
|
2012-02-15 20:13:14 +01:00
|
|
|
# Regression test for
|
|
|
|
# http://sourceware.org/bugzilla/show_bug.cgi?id=12659
|
|
|
|
gdb_test "info register pc fp" \
|
2012-08-28 11:05:35 +02:00
|
|
|
"pc +${valueof_pc}\t${valueof_pc} <.*>\[\r\n\]+fp +${valueof_fp}\t${valueof_fp}\[\r\n\]+"
|