-# Copyright (C) 1992, 1997, 1999, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1997, 1999, 2003, 2004, 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 2 of the License, or
+# 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, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
# This file was written by Fred Fish. (fnf@cygnus.com)
global gdb_prompt
global current_demangling_style
- send_gdb "set demangle-style $style\n"
- gdb_expect {
- -re "set demangle-style $style\[\r\n\]+$gdb_prompt $" {
- pass "$style: set demangle-style"
- }
- -re ".*$gdb_prompt $" {
- fail "$style: set demangle-style"
- error "set_demangling_style: set style"
+ gdb_test_multiple "set demangle-style $style" \
+ "$style: set demangle-style" {
+ -re "set demangle-style $style\[\r\n\]+$gdb_prompt $" {
+ pass "$style: set demangle-style"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "$style: set demangle-style"
+ error "set_demangling_style: set style"
+ }
+ timeout {
+ fail "$style: set demangle-style (timeout)"
+ error "set_demangling_style: set style"
+ }
}
- timeout {
- fail "$style: set demangle-style (timeout)"
- error "set_demangling_style: set style"
- }
- }
- send_gdb "show demangle-style\n"
- gdb_expect {
- -re "The current C\[+\]+ demangling style is \"$style\".\r\n$gdb_prompt $" {
- pass "$style: check demangling style"
- }
- -re ".*$gdb_prompt $" {
- fail "$style: check demangling style"
- error "set_demangling_style: check style"
+ gdb_test_multiple "show demangle-style" \
+ "$style: check demangling style" {
+ -re "The current C\[+\]+ demangling style is \"$style\".\r\n$gdb_prompt $" {
+ pass "$style: check demangling style"
+ }
+ -re ".*$gdb_prompt $" {
+ fail "$style: check demangling style"
+ error "set_demangling_style: check style"
+ }
+ timeout {
+ fail "$style: check demangling style (timeout)"
+ error "set_demangling_style: check style"
+ }
}
- timeout {
- fail "$style: check demangling style (timeout)"
- error "set_demangling_style: check style"
- }
- }
set current_demangling_style $style
}
## 1999-04-19: "Fix from Dale Hawkins". Shouldn't segfault.
# Accept even a dubious demangling; the string is ambiguous.
- send_gdb "maintenance demangle __thunk_64__0RL__list__Q29CosNaming20_proxy_NamingContextUlRPt25_CORBA_Unbounded_Sequence1ZQ29CosNaming7BindingRPQ29CosNaming15BindingIterator\n"
- gdb_expect {
+
+ gdb_test_multiple "maintenance demangle __thunk_64__0RL__list__Q29CosNaming20_proxy_NamingContextUlRPt25_CORBA_Unbounded_Sequence1ZQ29CosNaming7BindingRPQ29CosNaming15BindingIterator" "gnu: __thunk_64__0RL__list__Q29CosNaming20_proxy_NamingContextUlRPt25_CORBA_Unbounded_Sequence1ZQ29CosNaming7BindingRPQ29CosNaming15BindingIterator" {
-re "virtual function thunk \\(delta:-64\\) for CosNaming::_proxy_NamingContext::_0RL__list\\(unsigned long, _CORBA_Unbounded_Sequence<CosNaming::Binding> \\*\\&, CosNaming::BindingIterator \\*\\&\\)\r\n$gdb_prompt $" {
- pass "gnu: __thunk_64__0RL__list__Q29CosNaming20_proxy_NamingContextUlRPt25_CORBA_Unbounded_Sequence1ZQ29CosNaming7BindingRPQ29CosNaming15BindingIterator"
+ pass "gnu: __thunk_64__0RL__list__Q29CosNaming20_proxy_NamingContextUlRPt25_CORBA_Unbounded_Sequence1ZQ29CosNaming7BindingRPQ29CosNaming15BindingIterator"
}
-re ".*Can't demangle \"__thunk_64__0RL__list__Q29CosNaming20_proxy_NamingContextUlRPt25_CORBA_Unbounded_Sequence1ZQ29CosNaming7BindingRPQ29CosNaming15BindingIterator\"\r\n$gdb_prompt $" {
- pass "gnu: __thunk_64__0RL__list__Q29CosNaming20_proxy_NamingContextUlRPt25_CORBA_Unbounded_Sequence1ZQ29CosNaming7BindingRPQ29CosNaming15BindingIterator"
- }
- -re ".*$gdb_prompt $" {
- fail "gnu: __thunk_64__0RL__list__Q29CosNaming20_proxy_NamingContextUlRPt25_CORBA_Unbounded_Sequence1ZQ29CosNaming7BindingRPQ29CosNaming15BindingIterator"
- }
- timeout {
- fail "gnu: __thunk_64__0RL__list__Q29CosNaming20_proxy_NamingContextUlRPt25_CORBA_Unbounded_Sequence1ZQ29CosNaming7BindingRPQ29CosNaming15BindingIterator (timeout)"
+ pass "gnu: __thunk_64__0RL__list__Q29CosNaming20_proxy_NamingContextUlRPt25_CORBA_Unbounded_Sequence1ZQ29CosNaming7BindingRPQ29CosNaming15BindingIterator"
}
}
}
# internal demangler with synthesized strings and tests the results.
proc do_tests {} {
- global prms_id
- global bug_id
global subdir
global gdb_prompt
- set prms_id 0
- set bug_id 0
# Start with a fresh gdb.
gdb_exit
gdb_start
- send_gdb "set language c++\n"
- gdb_expect -re "$gdb_prompt $"
- send_gdb "set width 0\n"
- gdb_expect -re "$gdb_prompt $"
+ gdb_test_no_output "set language c++"
+ gdb_test_no_output "set width 0"
# Using catch_demangling_errors this way ensures that, if one of
# the functions raises a Tcl error, then it'll get reported, and