From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16401 invoked by alias); 28 Sep 2012 00:05:17 -0000 Received: (qmail 15117 invoked by uid 22791); 28 Sep 2012 00:04:53 -0000 X-SWARE-Spam-Status: No, hits=-4.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 28 Sep 2012 00:04:38 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1THO4L-0003uA-Qg from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Thu, 27 Sep 2012 17:04:37 -0700 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 27 Sep 2012 17:04:38 -0700 Received: from qiyao.dyndns.org.dyndns.org (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.1.289.1; Thu, 27 Sep 2012 17:04:34 -0700 From: Yao Qi To: Subject: [PATCH 01/11] Remove mi-FOO.exp which are identical to mi2-FOO.exp Date: Fri, 28 Sep 2012 00:05:00 -0000 Message-ID: <1348790666-2544-2-git-send-email-yao@codesourcery.com> In-Reply-To: <1348790666-2544-1-git-send-email-yao@codesourcery.com> References: <1346419770-5718-1-git-send-email-yao@codesourcery.com> <1348790666-2544-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-09/txt/msg00655.txt.bz2 gdb/testsuite: 2012-09-27 Yao Qi * gdb.mi/mi-disassemble.exp: Remove. * gdb.mi/mi-eval.exp, gdb.mi/mi-hack-cli.exp: Remove. * gdb.mi/mi-read-memory.exp: Remove. * gdb.mi/mi-regs.exp, gdb.mi/mi-return.exp: Remove. * gdb.mi/mi-simplerun.exp: Remove. * gdb.mi/mi-stepi.exp, gdb.mi/mi-until.exp: Remove. * gdb.mi/mi-watch.exp: Remove. --- gdb/testsuite/gdb.mi/mi-disassemble.exp | 239 ------------------------------- gdb/testsuite/gdb.mi/mi-eval.exp | 61 -------- gdb/testsuite/gdb.mi/mi-hack-cli.exp | 36 ----- gdb/testsuite/gdb.mi/mi-read-memory.exp | 82 ----------- gdb/testsuite/gdb.mi/mi-regs.exp | 121 ---------------- gdb/testsuite/gdb.mi/mi-return.exp | 67 --------- gdb/testsuite/gdb.mi/mi-simplerun.exp | 189 ------------------------ gdb/testsuite/gdb.mi/mi-stepi.exp | 78 ---------- gdb/testsuite/gdb.mi/mi-until.exp | 83 ----------- gdb/testsuite/gdb.mi/mi-watch.exp | 187 ------------------------ 10 files changed, 0 insertions(+), 1143 deletions(-) delete mode 100644 gdb/testsuite/gdb.mi/mi-disassemble.exp delete mode 100644 gdb/testsuite/gdb.mi/mi-eval.exp delete mode 100644 gdb/testsuite/gdb.mi/mi-hack-cli.exp delete mode 100644 gdb/testsuite/gdb.mi/mi-read-memory.exp delete mode 100644 gdb/testsuite/gdb.mi/mi-regs.exp delete mode 100644 gdb/testsuite/gdb.mi/mi-return.exp delete mode 100644 gdb/testsuite/gdb.mi/mi-simplerun.exp delete mode 100644 gdb/testsuite/gdb.mi/mi-stepi.exp delete mode 100644 gdb/testsuite/gdb.mi/mi-until.exp delete mode 100644 gdb/testsuite/gdb.mi/mi-watch.exp diff --git a/gdb/testsuite/gdb.mi/mi-disassemble.exp b/gdb/testsuite/gdb.mi/mi-disassemble.exp deleted file mode 100644 index 377ffde..0000000 --- a/gdb/testsuite/gdb.mi/mi-disassemble.exp +++ /dev/null @@ -1,239 +0,0 @@ -# Copyright 1999-2002, 2004-2005, 2007-2012 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 . - -# -# Test Machine interface (MI) operations for disassembly. -# -# 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 -} - -standard_testfile basics.c - -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { - untested mi-disassemble.exp - return -1 -} - -proc test_disassembly_only {} { - global mi_gdb_prompt - global hex - global decimal - - set line_main_head [gdb_get_line_number "main ("] - set line_main_body [expr $line_main_head + 2] - - # Test disassembly more only for the current function. - # Tests: - # -data-disassemble -s $pc -e "$pc+8" -- 0 - # -data-disassembly -f basics.c -l $line_main_body -- 0 - - mi_gdb_test "print/x \$pc" "" "" - mi_gdb_test "111-data-disassemble -s \$pc -e \"\$pc + 12\" -- 0" \ - "111\\^done,asm_insns=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\},\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}.*\]" \ - "data-disassemble from pc to pc+12 assembly only" - - mi_gdb_test "222-data-disassemble -f basics.c -l $line_main_body -- 0" \ - "222\\^done,asm_insns=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]" \ - "data-disassemble file & line, assembly only" -} - -proc test_disassembly_with_opcodes {} { - global mi_gdb_prompt - global hex - global decimal - - set line_main_head [gdb_get_line_number "main ("] - set line_main_body [expr $line_main_head + 2] - - # Test disassembly with opcodes for the current function. - # Tests: - # -data-disassemble -s $pc -e "$pc+8" -- 2 - # -data-disassembly -f basics.c -l $line_main_body -- 2 - - mi_gdb_test "print/x \$pc" "" "" - mi_gdb_test "111-data-disassemble -s \$pc -e \"\$pc + 12\" -- 2" \ - "111\\^done,asm_insns=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",opcodes=\".*\",inst=\".*\"\},\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",opcodes=\".*\",inst=\".*\"\}.*\]" \ - "data-disassemble from pc to pc+12 assembly with opcodes" - - mi_gdb_test "222-data-disassemble -f basics.c -l $line_main_body -- 2" \ - "222\\^done,asm_insns=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"0\",opcodes=\".*\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",opcodes=\".*\",inst=\".*\"\}\\\]" \ - "data-disassemble file & line, assembly with opcodes" -} - -proc test_disassembly_lines_limit {} { - global mi_gdb_prompt - global hex - global decimal - - set line_main_head [gdb_get_line_number "main ("] - set line_main_body [expr $line_main_head + 2] - - # Test disassembly more only for the current function. - # Tests: - # -data-disassembly -f basics.c -l $line_main_body -n 20 -- 0 - # -data-disassembly -f basics.c -l $line_main_body -n 0 -- 0 - # -data-disassembly -f basics.c -l $line_main_body -n 50 -- 0 - - mi_gdb_test "print/x \$pc" "" "" - mi_gdb_test "222-data-disassemble -f basics.c -l $line_main_body -n 20 -- 0" \ - "222\\^done,asm_insns=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]" \ - "data-disassemble file, line, number assembly only" - - mi_gdb_test "222-data-disassemble -f basics.c -l $line_main_body -n 0 -- 0" \ - "222\\^done,asm_insns=\\\[\\\]" \ - "data-disassemble file, line, number (zero lines) assembly only" - - mi_gdb_test "222-data-disassemble -f basics.c -l $line_main_body -n 50 -- 0" \ - "222\\^done,asm_insns=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]" \ - "data-disassemble file, line, number (more than main lines) assembly only" -} - - -proc test_disassembly_mixed {} { - global mi_gdb_prompt - global hex - global decimal - - set line_callee2_head [gdb_get_line_number "callee2 ("] - set line_callee2_open_brace [expr $line_callee2_head + 1] - - # Test disassembly more only for the current function. - # Tests: - # -data-disassembly -f basics.c -l $line_callee2_open_brace -- 1 - # -data-disassembly -s $pc -e "$pc+8" -- 1 - - mi_gdb_test "002-data-disassemble -f basics.c -l $line_callee2_open_brace -- 1" \ - "002\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"$line_callee2_open_brace\",file=\".*basics.c\",line_asm_insn=\\\[\{address=\"$hex\",func-name=\"callee2\",offset=\"0\",inst=\".*\"\}.*\\\]\}.*,src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\\\[.*\{address=\"$hex\",func-name=\"callee2\",offset=\"$decimal\",inst=\".*\"\}\\\]\}\\\]" \ - "data-disassemble file, line assembly mixed" - - # - # In mixed mode, the lowest level of granularity is the source line. - # So we are going to get the disassembly for the source line at - # which we are now, even if we have specified that the range is only 2 insns. - # - mi_gdb_test "003-data-disassemble -s \$pc -e \"\$pc+4\" -- 1" \ - "003\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}.*\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]\}\\\]" \ - "data-disassemble range assembly mixed" -} - -proc test_disassembly_mixed_with_opcodes {} { - global mi_gdb_prompt - global hex - global decimal - - set line_callee2_head [gdb_get_line_number "callee2 ("] - set line_callee2_open_brace [expr $line_callee2_head + 1] - - # Test disassembly mixed with opcodes for the current function. - # Tests: - # -data-disassembly -f basics.c -l $line_callee2_open_brace -- 3 - # -data-disassembly -s $pc -e "$pc+8" -- 3 - - mi_gdb_test "002-data-disassemble -f basics.c -l $line_callee2_open_brace -- 3" \ - "002\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"$line_callee2_open_brace\",file=\".*basics.c\",line_asm_insn=\\\[\{address=\"$hex\",func-name=\"callee2\",offset=\"0\",opcodes=\".*\",inst=\".*\"\}.*\\\]\}.*,src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\\\[.*\{address=\"$hex\",func-name=\"callee2\",offset=\"$decimal\",opcodes=\".*\",inst=\".*\"\}\\\]\}\\\]" \ - "data-disassemble file, line assembly mixed with opcodes" - - # - # In mixed mode, the lowest level of granularity is the source line. - # So we are going to get the disassembly for the source line at - # which we are now, even if we have specified that the range is only 2 insns. - # - mi_gdb_test "003-data-disassemble -s \$pc -e \"\$pc+4\" -- 3" \ - "003\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",opcodes=\".*\",inst=\".*\"\}.*\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",opcodes=\".*\",inst=\".*\"\}\\\]\}\\\]" \ - "data-disassemble range assembly mixed with opcodes" -} - -proc test_disassembly_mixed_lines_limit {} { - global mi_gdb_prompt - global hex - global decimal - - set line_main_head [gdb_get_line_number "main ("] - set line_main_open_brace [expr $line_main_head + 1] - set line_main_body [expr $line_main_head + 2] - - # Test disassembly more only for the current function. - # Tests: - # -data-disassembly -f basics.c -l $line_main_body -n 20 -- 1 - # -data-disassembly -f basics.c -l $line_main_body -n 0 -- 1 - # -data-disassembly -f basics.c -l $line_main_body -n 50 -- 1 - - mi_gdb_test "print/x \$pc" "" "" - mi_gdb_test "222-data-disassemble -f basics.c -l $line_main_body -n 20 -- 1" \ - "222\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\},.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]\}\]" \ - "data-disassemble file, line, number assembly mixed" - - mi_gdb_test "222-data-disassemble -f basics.c -l $line_main_body -n 0 -- 1" \ - "222\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"$line_main_open_brace\",file=\".*basics.c\",line_asm_insn=\\\[\\\]\}\\\]" \ - "data-disassemble file, line, number (zero lines) assembly mixed" - - mi_gdb_test "222-data-disassemble -f basics.c -l $line_main_body -n 50 -- 1" \ - "222\\^done,asm_insns=\\\[src_and_asm_line=\{line=\"$decimal\",file=\".*basics.c\",line_asm_insn=\\\[\{address=\"$hex\",func-name=\"main\",offset=\"0\",inst=\".*\"\}.*,\{address=\"$hex\",func-name=\"main\",offset=\"$decimal\",inst=\".*\"\}\\\]\}\]" \ - "data-disassemble file, line, number (more than main lines) assembly mixed" -} - -proc test_disassembly_bogus_args {} { - global mi_gdb_prompt - global hex - - set line_main_head [gdb_get_line_number "main ("] - set line_main_body [expr $line_main_head + 2] - - # Test that bogus input to disassembly command is rejected. - # Tests: - # -data-disassembly -f foo -l abc -n 0 -- 0 - # -data-disassembly -s foo -e bar -- 0 - # -data-disassembly -s $pc -f basics.c -- 0 - # -data-disassembly -f basics.c -l 32 -- 9 - - mi_gdb_test "123-data-disassemble -f foo -l abc -n 0 -- 0" \ - "123\\^error,msg=\"-data-disassemble: Invalid filename.\"" \ - "data-disassemble bogus filename" - - mi_gdb_test "321-data-disassemble -s foo -e bar -- 0" \ - "321\\^error,msg=\"No symbol \\\\\"foo\\\\\" in current context.\"" \ - "data-disassemble bogus address" - - mi_gdb_test "456-data-disassemble -s \$pc -f basics.c -- 0" \ - "456\\^error,msg=\"-data-disassemble: Usage: \\( .-f filename -l linenum .-n howmany.. \\| .-s startaddr -e endaddr.\\) .--. mode.\"" \ - "data-disassemble mix different args" - - mi_gdb_test "789-data-disassemble -f basics.c -l $line_main_body -- 9" \ - "789\\^error,msg=\"-data-disassemble: Mode argument must be 0, 1, 2, or 3.\"" \ - "data-disassemble wrong mode arg" - -} - -mi_run_to_main -test_disassembly_only -test_disassembly_with_opcodes -test_disassembly_mixed -test_disassembly_mixed_with_opcodes -test_disassembly_bogus_args -test_disassembly_lines_limit -test_disassembly_mixed_lines_limit - -mi_gdb_exit -return 0 diff --git a/gdb/testsuite/gdb.mi/mi-eval.exp b/gdb/testsuite/gdb.mi/mi-eval.exp deleted file mode 100644 index ea20369..0000000 --- a/gdb/testsuite/gdb.mi/mi-eval.exp +++ /dev/null @@ -1,61 +0,0 @@ -# Copyright 1999-2002, 2004, 2007-2012 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 . - -# -# Test essential Machine interface (MI) operations -# -# Verify -data-evaluate-expression. There are really minimal tests. - -# 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 -} - -standard_testfile basics.c - -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { - untested mi-eval.exp - return -1 -} - -mi_delete_breakpoints -mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_load ${binfile} - -set line_callee4_head [gdb_get_line_number "callee4 ("] -set line_callee4_body [expr $line_callee4_head + 2] - -mi_runto callee4 -mi_next_to "callee4" "" "basics.c" [expr $line_callee4_body + 1] "next at callee4" - -mi_gdb_test "211-data-evaluate-expression A" "211\\^done,value=\"1\"" "eval A" - -mi_gdb_test "311-data-evaluate-expression &A" "311\\^done,value=\"$hex\"" "eval &A" - -mi_gdb_test "411-data-evaluate-expression A+3" "411\\^done,value=\"4\"" "eval A+3" - -mi_gdb_test "511-data-evaluate-expression \"A + 3\"" "511\\^done,value=\"4\"" "eval A + 3" - - -mi_gdb_exit -return 0 diff --git a/gdb/testsuite/gdb.mi/mi-hack-cli.exp b/gdb/testsuite/gdb.mi/mi-hack-cli.exp deleted file mode 100644 index 6e35f14..0000000 --- a/gdb/testsuite/gdb.mi/mi-hack-cli.exp +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright 1999, 2001, 2007-2012 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 . - - -# Some basic checks for the CLI. - -load_lib mi-support.exp -set MIFLAGS "-i=mi" - -gdb_exit -if [mi_gdb_start] { - continue -} - -mi_gdb_test "show architecture" \ - "&\"show architecture\\\\n\"\r\n~\"The target architecture.*\"\r\n\\^done" \ - "show architecture" - -mi_gdb_test "47show architecture" \ - "&\"show architecture\\\\n\"\r\n~\"The target architecture.*\"\r\n47\\^done" \ - "47show architecture" - -mi_gdb_exit -return 0 diff --git a/gdb/testsuite/gdb.mi/mi-read-memory.exp b/gdb/testsuite/gdb.mi/mi-read-memory.exp deleted file mode 100644 index 5d154ba..0000000 --- a/gdb/testsuite/gdb.mi/mi-read-memory.exp +++ /dev/null @@ -1,82 +0,0 @@ -# Copyright 1999-2002, 2007-2012 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 . - -# -# test basic Machine interface (MI) operations -# -# Verify that, using the MI, we can load a program and do -# other basic things that are used by all test files through mi_gdb_exit, -# mi_gdb_start, mi_delete_breakpoints, mi_gdb_reinitialize_dir and -# mi_gdb_load, so we can safely use those. -# -# The goal is not to test gdb functionality, which is done by other tests, -# but the command syntax and correct output response to MI operations. -# - -load_lib mi-support.exp -set MIFLAGS "-i=mi" - -gdb_exit -if [mi_gdb_start] { - continue -} - -standard_testfile - -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { - untested mi-read-memory.exp - return -1 -} - - -mi_run_to_main -mi_next_to "main" "" "mi-read-memory.c" "20" "next at main" - -mi_gdb_test "1-data-read-memory" \ - "1\\^error,msg=\".*\"" \ - "no arguments" - - -mi_gdb_test "2-data-read-memory bytes x 1 3 2" \ - "2\\^done,addr=\"$hex\",nr-bytes=\"6\",total-bytes=\"6\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory=\\\[{addr=\"$hex\",data=\\\[\"0x00\",\"0x01\"\\\]},{addr=\"$hex\",data=\\\[\"0x02\",\"0x03\"\\\]},{addr=\"$hex\",data=\\\[\"0x04\",\"0x05\"\\\]}\\\]" \ - "3x2, one byte" - - -mi_gdb_test "9-data-read-memory -o -6 -- -0+bytes+6 x 1 3 2" \ - "9\\^done,addr=\"$hex\",nr-bytes=\"6\",total-bytes=\"6\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory=\\\[{addr=\"$hex\",data=\\\[\"0x00\",\"0x01\"\\\]},{addr=\"$hex\",data=\\\[\"0x02\",\"0x03\"\\\]},{addr=\"$hex\",data=\\\[\"0x04\",\"0x05\"\\\]}\\\]" \ - "3x2, one byte offset by -6" - - -mi_gdb_test "3-data-read-memory \"(shorts + 128)\" x 2 1 2" \ - "3\\^done,addr=\"$hex\",nr-bytes=\"4\",total-bytes=\"4\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory=\\\[{addr=\"$hex\",data=\\\[\"0x0100\",\"0x0102\"\\\]}\\\]" \ - "expression in quotes" - - -mi_gdb_test "4-data-read-memory bytes+16 x 1 8 4 x" \ - "4\\^done,addr=\"$hex\",nr-bytes=\"32\",total-bytes=\"32\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory=\\\[{addr=\"$hex\",data=\\\[\"0x10\",\"0x11\",\"0x12\",\"0x13\"\\\],ascii=\"xxxx\"},{addr=\"$hex\",data=\\\[\"0x14\",\"0x15\",\"0x16\",\"0x17\"\\\],ascii=\"xxxx\"},{addr=\"$hex\",data=\\\[\"0x18\",\"0x19\",\"0x1a\",\"0x1b\"\\\],ascii=\"xxxx\"},{addr=\"$hex\",data=\\\[\"0x1c\",\"0x1d\",\"0x1e\",\"0x1f\"\\\],ascii=\"xxxx\"},{addr=\"$hex\",data=\\\[\"0x20\",\"0x21\",\"0x22\",\"0x23\"\\\],ascii=\" !\\\\\"#\"},{addr=\"$hex\",data=\\\[\"0x24\",\"0x25\",\"0x26\",\"0x27\"\\\],ascii=\"\\$%&'\"},{addr=\"$hex\",data=\\\[\"0x28\",\"0x29\",\"0x2a\",\"0x2b\"\\\],ascii=\"().+\"},{addr=\"$hex\",data=\\\[\"0x2c\",\"0x2d\",\"0x2e\",\"0x2f\"\\\],ascii=\",-\./\"}\\\]" \ - "ascii and data" - - -mi_gdb_test "5-data-read-memory shorts+64 d 2 1 1" \ - "5\\^done,addr=\"$hex\",nr-bytes=\"2\",total-bytes=\"2\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory=\\\[{addr=\"$hex\",data=\\\[\"128\"\\\]}\\\]" \ - "decimal" - -mi_gdb_test "6-data-read-memory shorts+64 o 2 1 1" \ - "6\\^done,addr=\"$hex\",nr-bytes=\"2\",total-bytes=\"2\",next-row=\"$hex\",prev-row=\"$hex\",next-page=\"$hex\",prev-page=\"$hex\",memory=\\\[{addr=\"$hex\",data=\\\[\"0200\"\\\]}\\\]" \ - "octal" - - -mi_gdb_exit -return 0 diff --git a/gdb/testsuite/gdb.mi/mi-regs.exp b/gdb/testsuite/gdb.mi/mi-regs.exp deleted file mode 100644 index 988f0c5..0000000 --- a/gdb/testsuite/gdb.mi/mi-regs.exp +++ /dev/null @@ -1,121 +0,0 @@ -# Copyright 1999-2002, 2007-2012 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 . - -# 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 -} - -standard_testfile basics.c - -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { - 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 \\\[...\\\]\"" \ - "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 diff --git a/gdb/testsuite/gdb.mi/mi-return.exp b/gdb/testsuite/gdb.mi/mi-return.exp deleted file mode 100644 index e6b4e61..0000000 --- a/gdb/testsuite/gdb.mi/mi-return.exp +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright 1999-2002, 2004-2005, 2007-2012 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 . - -# Test Machine interface (MI) operations -# Verify that, using the MI, we can run a simple program and perform -# exec-return. - -# 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 -} - -standard_testfile basics.c - -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { - untested mi-return.exp - return -1 -} - -mi_delete_breakpoints -mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_load ${binfile} - - -proc test_return_simple {} { - global mi_gdb_prompt - global hex fullname_syntax srcfile - - set line_callee3_head [gdb_get_line_number "callee3 ("] - set line_callee3_call [expr $line_callee3_head + 2] - set line_callee3_close_brace [expr $line_callee3_head + 3] - - mi_gdb_test "111-exec-return" "111\\^done,frame=\{level=\"0\",addr=\"$hex\",func=\"callee3\",args=\\\[.*\\\],file=\".*basics.c\",fullname=\"${fullname_syntax}${srcfile}\",line=\"($line_callee3_call|$line_callee3_close_brace)\"\}" "return from callee4 now" -} - -mi_runto callee4 - -mi_gdb_test "205-break-delete" \ - "205\\^done.*" \ - "delete all breakpoints" - -test_return_simple - -mi_gdb_exit -return 0 diff --git a/gdb/testsuite/gdb.mi/mi-simplerun.exp b/gdb/testsuite/gdb.mi/mi-simplerun.exp deleted file mode 100644 index a20d088..0000000 --- a/gdb/testsuite/gdb.mi/mi-simplerun.exp +++ /dev/null @@ -1,189 +0,0 @@ -# Copyright 1999-2002, 2004, 2007-2012 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 . - -# -# Test essential Machine interface (MI) operations -# -# Verify that, using the MI, we can run a simple program and perform basic -# debugging activities like: insert breakpoints, run the program, -# step, next, continue until it ends and, last but not least, quit. -# -# 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 -} - -standard_testfile basics.c - -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { - untested mi-simplerun.exp - return -1 -} - -mi_delete_breakpoints -mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_load ${binfile} - -proc test_breakpoints_creation_and_listing {} { - global mi_gdb_prompt - global srcfile - global hex - - set line_callee4_head [gdb_get_line_number "callee4 ("] - set line_callee4_body [expr $line_callee4_head + 2] - set line_callee3_head [gdb_get_line_number "callee3 ("] - set line_callee3_body [expr $line_callee3_head + 2] - set line_callee2_head [gdb_get_line_number "callee2 ("] - set line_callee2_body [expr $line_callee2_head + 2] - set line_main_head [gdb_get_line_number "main ("] - set line_main_body [expr $line_main_head + 2] - - # Insert some breakpoints and list them - # Also, disable some so they do not interfere with other tests - # Tests: - # -break-insert - # -break-list - # -break-disable - # -break-info - - mi_create_breakpoint "main" 1 keep main ".*basics.c" $line_main_body $hex \ - "break-insert operation" - - mi_create_breakpoint "basics.c:callee2" 2 keep callee2 ".*basics.c" $line_callee2_body $hex \ - "insert breakpoint at basics.c:callee2" - - mi_create_breakpoint "basics.c:$line_callee3_head" 3 keep callee3 ".*basics.c" $line_callee3_head $hex \ - "insert breakpoint at basics.c:\$line_callee3_head" - - mi_create_breakpoint "\"\\\"${srcfile}\\\":$line_callee4_head\"" 4 keep callee4 ".*basics.c" $line_callee4_head $hex \ - "insert breakpoint at \"\":\$line_callee4_head" - - mi_gdb_test "204-break-list" \ - "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\",original-location=\".*\"\},.*\}\\\]\}" \ - "list of breakpoints" - - mi_gdb_test "205-break-disable 2 3 4" \ - "205\\^done.*" \ - "disabling of breakpoints" - - mi_gdb_test "206-break-info 2" \ - "206\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"2\",.*,enabled=\"n\",.*\}\\\]\}" \ - "list of breakpoints, 16 disabled" -} - -proc test_running_the_program {} { - global mi_gdb_prompt - global hex - - set line_main_head [gdb_get_line_number "main ("] - set line_main_body [expr $line_main_head + 2] - - # Run the program without args, then specify srgs and rerun the program - # Tests: - # -exec-run - # -gdb-set - - # mi_gdb_test cannot be used for asynchronous commands because there are - # two prompts involved and this can lead to a race condition. - # The following is equivalent to a send_gdb "000-exec-run\n" - mi_run_cmd - mi_expect_stop "breakpoint-hit" "main" "" ".*basics.c" "$line_main_body" \ - { "" "disp=\"keep\"" } "run to main" -} - -proc test_controlled_execution {} { - global mi_gdb_prompt - global hex - - set line_callee4_head [gdb_get_line_number "callee4 ("] - set line_callee4_body [expr $line_callee4_head + 2] - set line_callee3_head [gdb_get_line_number "callee3 ("] - set line_callee3_call [expr $line_callee3_head + 2] - set line_callee3_close_brace [expr $line_callee3_head + 3] - set line_callee1_head [gdb_get_line_number "callee1 ("] - set line_callee1_body [expr $line_callee1_head + 2] - set line_main_head [gdb_get_line_number "main ("] - set line_main_body [expr $line_main_head + 2] - - # Continue execution until a breakpoint is reached, step into calls, verifying - # if the arguments are correctly shown, continue to the end of a called - # function, step over a call (next). - # Tests: - # -exec-continue - # -exec-next - # -exec-step - # -exec-finish - - mi_next_to "main" "" "basics.c" [expr $line_main_body + 1] "next at main" - - # FIXME: A string argument is not printed right; should be fixed and - # we should look for the right thing here. - # NOTE: The ``\\\\\"'' is for \". - mi_step_to "callee1" \ - "\{name=\"intarg\",value=\"2\"\},\{name=\"strarg\",value=\"$hex \\\\\"A string argument\.\\\\\"\"\},\{name=\"fltarg\",value=\"3.5\"\}" \ - "basics.c" "$line_callee1_body" "step at main" - - # FIXME: A string argument is not printed right; should be fixed and - # we should look for the right thing here. - mi_execute_to "exec-step 3" "end-stepping-range" "callee4" "" \ - "basics.c" $line_callee4_body "" "step to callee4" - - # FIXME: A string argument is not printed right; should be fixed and - # we should look for the right thing here. - # NOTE: The ``.'' is part of ``gdb-result-var="$1"'' - mi_finish_to "callee3" ".*" "basics.c" \ - "($line_callee3_call|$line_callee3_close_brace)" ".1" "0" "exec-finish" -} - -proc test_controlling_breakpoints {} { - global mi_gdb_prompt - - # Enable, delete, set ignore counts in breakpoints - # (disable was already tested above) - # Tests: - # -break-delete - # -break-enable - # -break-after - # -break-condition - -} - -proc test_program_termination {} { - global mi_gdb_prompt - - # Run to completion: normal and forced - # Tests: - # -exec-abort - # (normal termination of inferior) - - mi_execute_to "exec-continue" "exited-normally" "" "" "" "" "" "continue to end" -} - -test_breakpoints_creation_and_listing -test_running_the_program -test_controlled_execution -test_controlling_breakpoints -test_program_termination - -mi_gdb_exit -return 0 diff --git a/gdb/testsuite/gdb.mi/mi-stepi.exp b/gdb/testsuite/gdb.mi/mi-stepi.exp deleted file mode 100644 index 245dc1c..0000000 --- a/gdb/testsuite/gdb.mi/mi-stepi.exp +++ /dev/null @@ -1,78 +0,0 @@ -# Copyright 1999-2002, 2004-2005, 2007-2012 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 . - -# Test Machine interface (MI) operations -# Verify that, using the MI, we can run a simple program and perform -# exec-step-instruction and exec-next-instruction. - -# 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 -} - -standard_testfile basics.c - -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { - untested mi-stepi.exp - return -1 -} - -proc test_stepi_nexti {} { - global mi_gdb_prompt - global hex fullname_syntax srcfile - - set line_main_head [gdb_get_line_number "main ("] - set line_main_body [expr $line_main_head + 2] - set line_main_hello [gdb_get_line_number "Hello, World!"] - - set line [mi_execute_to "exec-step-instruction" "end-stepping-range" "main" "" \ - ".*basics.c" "\[0-9\]+" "" "step-instruction at main"] - if { $line >= $line_main_body && $line <= $line_main_hello } { - pass "step-instruction at main (line check)" - } else { - fail "step-instruction at main (line check)" - } - - set line [mi_execute_to "exec-next-instruction" "end-stepping-range" "main" "" \ - ".*basics.c" "\[0-9\]+" "" "next-instruction at main"] - if { $line >= $line_main_body && $line <= $line_main_hello } { - pass "next-instruction at main (line check)" - } else { - fail "next-instruction at main (line check)" - } - - set line [mi_execute_to "exec-next-instruction" "end-stepping-range" "main" "" \ - ".*basics.c" "\[0-9\]+" "" "next-instruction at main 2"] - if { $line >= $line_main_body && $line <= $line_main_hello } { - pass "next-instruction at main 2 (line check)" - } else { - fail "next-instruction at main 2 (line check)" - } -} - -mi_run_to_main -test_stepi_nexti - -mi_gdb_exit -return 0 diff --git a/gdb/testsuite/gdb.mi/mi-until.exp b/gdb/testsuite/gdb.mi/mi-until.exp deleted file mode 100644 index a1c97b1..0000000 --- a/gdb/testsuite/gdb.mi/mi-until.exp +++ /dev/null @@ -1,83 +0,0 @@ -# Copyright 1999-2001, 2005, 2007-2012 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 . - -# Test Machine interface (MI) operations -# Verify that, using the MI, we can run a simple program and perform -# exec-until. - -# 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 -} - -standard_testfile until.c - -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { - untested mi-until.exp - return -1 -} - -mi_delete_breakpoints -mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_reinitialize_dir $srcdir/$subdir -mi_gdb_load ${binfile} - -proc test_running_to_foo {} { - global mi_gdb_prompt - global hex - - mi_create_breakpoint "10" 1 "keep" foo ".*until.c" 10 ".*" \ - "break-insert operation" - - mi_run_cmd - mi_expect_stop "breakpoint-hit" "foo" "" ".*until.c" 10 \ - { "" "disp=\"keep\"" } "run to main" - - mi_gdb_test "100-break-delete 1" "100\\^done" "break-delete 1" - -} - -proc test_until {} { - global mi_gdb_prompt - global hex fullname_syntax srcfile - - setup_kfail gdb/2104 "*-*-*" - mi_execute_to "exec-until" "end-stepping-range" "foo" "" ".*until.c" "12" "" \ - "until after while loop" - - mi_execute_to "exec-until 15" "location-reached" "foo" "" ".*until.c" "15" ""\ - "until line number" - - mi_execute_to "exec-until until.c:17" "location-reached" "foo" "" ".*until.c" "17" ""\ - "until line number:file" - - # This is supposed to NOT stop at line 25. It stops right after foo is over. - mi_execute_to "exec-until until.c:25" "location-reached" "main" "" ".*until.c" "(23|24)" ""\ - "until after current function" -} - -test_running_to_foo -test_until - -mi_gdb_exit -return 0 diff --git a/gdb/testsuite/gdb.mi/mi-watch.exp b/gdb/testsuite/gdb.mi/mi-watch.exp deleted file mode 100644 index 5ccff51..0000000 --- a/gdb/testsuite/gdb.mi/mi-watch.exp +++ /dev/null @@ -1,187 +0,0 @@ -# Copyright 1999-2002, 2004-2005, 2007-2012 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 . - -# -# Test essential Machine interface (MI) operations -# -# Verify that, using the MI, we can run a simple program and perform basic -# debugging activities like: insert breakpoints, run the program, -# step, next, continue until it ends and, last but not least, quit. -# -# 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 -} - -standard_testfile basics.c - -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { - untested mi-watch.exp - return -1 -} - -proc test_watchpoint_creation_and_listing {type} { - global mi_gdb_prompt - global srcfile - global hex - - set line_callee4_head [gdb_get_line_number "callee4 ("] - set line_callee4_body [expr $line_callee4_head + 2] - - # Insert a watchpoint and list - # Tests: - # -break-watch C - # -break-list - - mi_gdb_test "111-break-watch C" \ - "111\\^done,wpt=\{number=\"2\",exp=\"C\"\}" \ - "break-watch operation" - - mi_gdb_test "222-break-list" \ - "222\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"2\",type=\".*watchpoint\",disp=\"keep\",enabled=\"y\",what=\"C\",times=\"0\",original-location=\"C\"\}\\\]\}" \ - "list of watchpoints" - -} - -# UNUSED at the time -proc test_awatch_creation_and_listing {type} { - global mi_gdb_prompt - global srcfile - global hex - - set line_main_head [gdb_get_line_number "main ("] - set line_main_body [expr $line_main_head + 2] - - # Insert an access watchpoint and list it - # Tests: - # -break-watch -a A - # -break-list - - mi_gdb_test "333-break-watch -a A" \ - "333\\^done,bkpt=\{number=\"1\",addr=\"$hex\",file=\".*basics.c\",line=\"$line_main_body\"\}" \ - "break-watch -a operation" - - mi_gdb_test "444-break-list" \ - "444\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"3\",type=\"watchpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\"\},.*\}\\\]\}" \ - "list of watchpoints awatch" - - mi_gdb_test "777-break-delete 3" \ - "777\\^done" \ - "delete access watchpoint" -} - -# UNUSED at the time -proc test_rwatch_creation_and_listing {type} { - global mi_gdb_prompt - global srcfile - global hex - - set line_main_head [gdb_get_line_number "main ("] - set line_main_body [expr $line_main_head + 2] - - # Insert a read watchpoint and list it. - # Tests: - # -break-insert -r B - # -break-list - - mi_gdb_test "200-break-watch -r C" \ - "200\\^done,bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee4\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\"\}" \ - "break-insert -r operation" - - mi_gdb_test "300-break-list" \ - "300\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",times=\"0\"\},.*\}\\\}\}" \ - "list of breakpoints" - - mi_gdb_test "177-break-delete 4" \ - "177\\^done" \ - "delete read watchpoint" -} - -proc test_watchpoint_triggering {type} { - global mi_gdb_prompt - global hex fullname_syntax srcfile - - set line_callee4_return_0 [gdb_get_line_number "return 0;"] - set line_callee3_head [gdb_get_line_number "callee3 ("] - set line_callee3_close_brace [expr $line_callee3_head + 3] - - # Continue execution until the watchpoint is reached, continue again, - # to see the watchpoint go out of scope. - # Does: - # -exec-continue (Here wp triggers) - # -exec-continue (Here wp goes out of scope) - - mi_execute_to "exec-continue" "watchpoint-trigger" "callee4" "" \ - ".*basics.c" $line_callee4_return_0 \ - {"" "wpt=\{number=\"2\",exp=\"C\"\},value=\{old=\".*\",new=\"3\"\}"} \ - "watchpoint trigger" - - if { $type == "sw" } { - setup_xfail *-*-* - } - mi_execute_to "exec-continue" "watchpoint-scope" "callee3" ".*" \ - ".*basics.c" $line_callee3_close_brace \ - {"" "wpnum=\"2\""} \ - "watchpoint trigger" - clear_xfail *-*-* -} - -proc test_watchpoint_all {type} { with_test_prefix "$type" { - upvar srcdir srcdir - upvar subdir subdir - upvar binfile binfile - - mi_delete_breakpoints - mi_gdb_reinitialize_dir $srcdir/$subdir - mi_gdb_load ${binfile} - - mi_runto callee4 - test_watchpoint_creation_and_listing $type - #test_rwatch_creation_and_listing $type - #test_awatch_creation_and_listing $type - test_watchpoint_triggering $type -}} - -# Run the tests twice, once using software watchpoints... -mi_gdb_test "567-gdb-set can-use-hw-watchpoints 0" \ - "567\\^done" \ - "hw watchpoints toggle (1)" -test_watchpoint_all sw - -mi_gdb_exit - -# ... and unless requested otherwise... -if [target_info exists gdb,no_hardware_watchpoints] { - return 0 -} - -mi_gdb_start - -# ... once using hardware watchpoints (if available). -mi_gdb_test "890-gdb-set can-use-hw-watchpoints 1" \ - "890\\^done" \ - "hw watchpoints toggle (2)" -test_watchpoint_all hw - -mi_gdb_exit -return 0 -- 1.7.7.6