old-cross-binutils/gdb/testsuite/gdb.mi/mi-regs.exp
Tom Tromey 1b05df007b gdb
* mi/mi-symbol-cmds.c (mi_cmd_symbol_list_lines): Fix error
	messages.
	* mi/mi-main.c (mi_cmd_thread_select): Fix error messages.
	(mi_cmd_thread_list_ids): Likewise.
	(mi_cmd_data_list_changed_registers): Likewise.
	(mi_cmd_data_list_register_values): Likewise.
	(mi_cmd_data_write_register_values): Likewise.
	(mi_cmd_data_evaluate_expression): Likewise.
	(mi_cmd_data_read_memory): Likewise.
	(mi_cmd_data_read_memory_bytes): Likewise.
	(mi_cmd_data_write_memory): Likewise.
	(mi_cmd_enable_timings): Likewise.
	* mi/mi-interp.c (mi_cmd_interpreter_exec): Fix error messages.
	* mi/mi-cmd-var.c (mi_cmd_var_create): Fix error messages.
	(mi_cmd_var_delete): Likewise.
	(mi_cmd_var_set_format): Likewise.
	(mi_cmd_var_show_format): Likewise.
	(mi_cmd_var_info_num_children): Likewise.
	(mi_cmd_var_list_children): Likewise.
	(mi_cmd_var_info_type): Likewise.
	(mi_cmd_var_info_expression): Likewise.
	(mi_cmd_var_show_attributes): Likewise.
	(mi_cmd_var_assign): Likewise.
	(mi_cmd_var_update): Likewise.
	(mi_cmd_enable_pretty_printing): Likewise.
	(mi_cmd_var_set_update_range): Likewise.
	* mi/mi-cmd-target.c (mi_cmd_target_file_get): Fix error
	messages.
	(mi_cmd_target_file_put): Likewise.
	(mi_cmd_target_file_delete): Likewise.
	* mi/mi-cmd-stack.c (mi_cmd_stack_list_frames): Fix error
	messages.
	(mi_cmd_stack_info_depth): Likewise.
	(mi_cmd_stack_list_locals): Likewise.
	(mi_cmd_stack_list_args): Likewise.
	(mi_cmd_stack_select_frame): Likewise.
	(mi_cmd_stack_select_frame): Likewise.
	(mi_cmd_stack_info_frame): Likewise.
	* mi/mi-cmd-file.c (mi_cmd_file_list_exec_source_file): Fix error
	messages.
	(mi_cmd_file_list_exec_source_files): Likewise.
	* mi/mi-cmd-env.c (mi_cmd_env_pwd): Fix error messages.
	(mi_cmd_env_cd): Likewise.
	(mi_cmd_env_path): Likewise.
	(mi_cmd_env_dir): Likewise.
	(mi_cmd_inferior_tty_show): Likewise.
	* mi/mi-cmd-disas.c (mi_cmd_disassemble): Fix error messages.
	* mi/mi-cmd-break.c (mi_cmd_break_insert): Fix error messages.
	(mi_cmd_break_watch): Likewise.
gdb/testsuite
	* gdb.mi/gdb2549.exp: Update for error message changes.
	* gdb.mi/mi-cli.exp: Likewise.
	* gdb.mi/mi-disassemble.exp: Likewise.
	* gdb.mi/mi-pthreads.exp: Likewise.
	* gdb.mi/mi-regs.exp: Likewise.
	* gdb.mi/mi-stack.exp: Likewise.
	* gdb.mi/mi-var-block.exp: Likewise.
	* gdb.mi/mi-var-cmd.exp: Likewise.
	* gdb.mi/mi2-cli.exp: Likewise.
	* gdb.mi/mi2-disassemble.exp: Likewise.
	* gdb.mi/mi2-pthreads.exp: Likewise.
	* gdb.mi/mi2-regs.exp: Likewise.
	* gdb.mi/mi2-stack.exp: Likewise.
	* gdb.mi/mi2-var-block.exp: Likewise.
	* gdb.mi/mi2-var-cmd.exp: Likewise.
2011-01-12 21:09:39 +00:00

123 lines
5.3 KiB
Text

# Copyright 1999, 2000, 2001, 2002, 2007, 2008, 2009, 2010, 2011
# 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 essential Machine interface (MI) operations
#
# Verify that, using the MI, we can run a simple program and look at registers.
#
# The goal is not to test gdb functionality, which is done by other tests,
# but to verify the correct output response to MI operations.
#
load_lib mi-support.exp
set MIFLAGS "-i=mi"
gdb_exit
if [mi_gdb_start] {
continue
}
set testfile "basics"
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/mi-regs
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DFAKEARGV}] != "" } {
untested mi-regs.exp
return -1
}
proc sparc_register_tests_no_exec { } {
# Test the generic IDT chip.
mi_gdb_test "111-data-list-register-values" \
".*111\\^error,msg=\"-data-list-register-values: Usage: -data-list-register-values <format> \\\[<regnum1>...<regnumN>\\\]\"" \
"wrong arguments"
mi_gdb_test "111-data-list-register-values x" \
".*111\\^error,msg=\"No registers\.\"" \
"no executable"
}
# These tests exercise IDT-specific MIPS registers for several
# different processor models.
# This should detect the actual processor in use and change
# the expected results appropriately. FIXME
proc sparc_register_tests { } {
global hex
global decimal
set octal "\[0-7\]+"
set binary "\[0-1\]+"
set float "\\-?((\[0-9\]+(\\.\[0-9\]+)?(e\[-+\]\[0-9\]+)?)|(nan\\($hex\\)))"
set float2 "\\-?\[0-9\]+"
mi_gdb_test "111-data-list-register-names" \
"111\\^done,register-names=\\\[\"g0\",\"g1\",\"g2\",\"g3\",\"g4\",\"g5\",\"g6\",\"g7\",\"o0\",\"o1\",\"o2\",\"o3\",\"o4\",\"o5\",\"sp\",\"o7\",\"l0\",\"l1\",\"l2\",\"l3\",\"l4\",\"l5\",\"l6\",\"l7\",\"i0\",\"i1\",\"i2\",\"i3\",\"i4\",\"i5\",\"fp\",\"i7\",\"f0\",\"f1\",\"f2\",\"f3\",\"f4\",\"f5\",\"f6\",\"f7\",\"f8\",\"f9\",\"f10\",\"f11\",\"f12\",\"f13\",\"f14\",\"f15\",\"f16\",\"f17\",\"f18\",\"f19\",\"f20\",\"f21\",\"f22\",\"f23\",\"f24\",\"f25\",\"f26\",\"f27\",\"f28\",\"f29\",\"f30\",\"f31\",\"y\",\"psr\",\"wim\",\"tbr\",\"pc\",\"npc\",\"fsr\",\"csr\",\"d0\",\"d2\",\"d4\",\"d6\",\"d8\",\"d10\",\"d12\",\"d14\",\"d16\",\"d18\",\"d20\",\"d22\",\"d24\",\"d26\",\"d28\",\"d30\"\\\]" \
"list register names"
mi_gdb_test "222-data-list-register-values x" \
"222\\^done,register-values=\\\[\{number=\"0\",value=\"$hex\"\}.*\{number=\"87\",value=\"$hex\"\}\\\]" \
"register values x"
mi_gdb_test "333-data-list-register-values f" \
"333\\^done,register-values=\\\[\{number=\"0\",value=\"$float\"\},\{number=\"1\",value=\"$float\"\},.*\{number=\"87\",value=\"$float\"\}\\\]" \
"register values f"
mi_gdb_test "444-data-list-register-values d" \
"444\\^done,register-values=\\\[\{number=\"0\",value=\"-?$decimal\"\}.*\{number=\"87\",value=\"-?$decimal\"\}\\\]" \
"register values d"
mi_gdb_test "555-data-list-register-values o" \
"555\\^done,register-values=\\\[\{number=\"0\",value=\"$octal\"\}.*\{number=\"87\",value=\"$octal\"\}\\\]" \
"register values o"
mi_gdb_test "666-data-list-register-values t" \
"666\\^done,register-values=\\\[\{number=\"0\",value=\"$binary\"\}.*\{number=\"87\",value=\"$binary\"\}\\\]" \
"register values t"
# On the sparc, registers 0-31 are int, 32-63 float, 64-71 int, 72-87 float
mi_gdb_test "777-data-list-register-values N" \
"777\\^done,register-values=\\\[\{number=\"0\",value=\"-?$decimal\"\}.*\{number=\"31\",value=\"-?$decimal\"\},\{number=\"32\",value=\"$float\"\}.*\{number=\"63\",value=\"$float\"\},\{number=\"64\",value=\"-?$decimal\"\}.*\{number=\"71\",value=\"-?$decimal\"\},\{number=\"72\",value=\"$float\"\}.*\{number=\"87\",value=\"$float\"\}\\\]" \
"register values N"
mi_gdb_test "888-data-list-register-values r" \
"888\\^done,register-values=\\\[\{number=\"0\",value=\"$hex\"\}.*\{number=\"87\",value=\"$hex\"\}\\\]" \
"register values r"
mi_gdb_test "999-data-list-register-names 68 69 70 71" \
"999\\^done,register-names=\\\[\"pc\",\"npc\",\"fsr\",\"csr\"\\\]" \
"list names of some regs"
mi_gdb_test "001-data-list-register-values x 68 69 70 71" \
"001\\^done,register-values=\\\[\{number=\"68\",value=\"$hex\"\},\{number=\"69\",value=\"$hex\"\},\{number=\"70\",value=\"$hex\"\},\{number=\"71\",value=\"$hex\"\}\\\]" \
"list values of some regs"
mi_gdb_test "002-data-list-changed-registers" \
"002\\^done,changed-registers=\\\[(\"${decimal}\"(,\"${decimal}\")*)?\\\]" \
"list changed registers"
}
if [istarget "sparc-*-*"] then {
sparc_register_tests_no_exec
mi_run_to_main
sparc_register_tests
} else {
verbose "mi-regs.exp tests ignored for this target"
}
mi_gdb_exit
return 0