OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gdb-6.8/] [gdb/] [testsuite/] [gdb.cp/] [maint.exp] - Diff between revs 827 and 840

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 827 Rev 840
# Copyright 2003, 2004, 2006 Free Software Foundation Inc.
# Copyright 2003, 2004, 2006 Free Software Foundation Inc.
# This program is free software; you can redistribute it and/or modify
# 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
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see .
# along with this program.  If not, see .
# This file tests C++-specific maintenance commands and help on those.
# This file tests C++-specific maintenance commands and help on those.
# Currently, no source file is used.
# Currently, no source file is used.
if $tracelevel then {
if $tracelevel then {
        strace $tracelevel
        strace $tracelevel
        }
        }
# Test the help messages.
# Test the help messages.
proc test_help {} {
proc test_help {} {
    set first_component_help "Print the first class/namespace component of NAME"
    set first_component_help "Print the first class/namespace component of NAME"
    set namespace_help "Print the list of possible C\\+\\+ namespaces"
    set namespace_help "Print the list of possible C\\+\\+ namespaces"
    test_prefix_command_help {"maintenance cplus"} {
    test_prefix_command_help {"maintenance cplus"} {
        "C\\+\\+ maintenance commands\.\[\r\n\]+"
        "C\\+\\+ maintenance commands\.\[\r\n\]+"
    }
    }
    test_prefix_command_help {"maint cp" "maintenance cplus"} {
    test_prefix_command_help {"maint cp" "maintenance cplus"} {
        "C\\+\\+ maintenance commands.\r\n\r\n"
        "C\\+\\+ maintenance commands.\r\n\r\n"
    }
    }
    set multiple_help_body "List of maintenance cplus subcommands:\r\n\r\nmaintenance cplus first_component -- ${first_component_help}\r\nmaintenance cplus namespace -- ${namespace_help}\r\n\r\nType \"help maintenance cplus\" followed by maintenance cplus subcommand name for full documentation.\r\nCommand name abbreviations are allowed if unambiguous."
    set multiple_help_body "List of maintenance cplus subcommands:\r\n\r\nmaintenance cplus first_component -- ${first_component_help}\r\nmaintenance cplus namespace -- ${namespace_help}\r\n\r\nType \"help maintenance cplus\" followed by maintenance cplus subcommand name for full documentation.\r\nCommand name abbreviations are allowed if unambiguous."
    gdb_test "maint cp" "\"maintenance cplus\" must be followed by the name of a command.\r\n.*"
    gdb_test "maint cp" "\"maintenance cplus\" must be followed by the name of a command.\r\n.*"
    gdb_test "help maint cp first_component" "${first_component_help}."
    gdb_test "help maint cp first_component" "${first_component_help}."
    gdb_test "help maint cp namespace" "${namespace_help}."
    gdb_test "help maint cp namespace" "${namespace_help}."
}
}
# This is used when NAME should contain only a single component.  Be
# This is used when NAME should contain only a single component.  Be
# careful to make sure that parentheses get escaped properly.
# careful to make sure that parentheses get escaped properly.
proc test_single_component {name} {
proc test_single_component {name} {
    set matchname [string_to_regexp "$name"]
    set matchname [string_to_regexp "$name"]
    gdb_test "maint cp first_component $name" "$matchname"
    gdb_test "maint cp first_component $name" "$matchname"
}
}
# This is used when NAME is invalid.
# This is used when NAME is invalid.
proc test_invalid_name {name} {
proc test_invalid_name {name} {
    set matchname [string_to_regexp "$name"]
    set matchname [string_to_regexp "$name"]
    gdb_test "maint cp first_component $name" \
    gdb_test "maint cp first_component $name" \
        "During symbol reading, unexpected demangled name '$matchname'.\r\n$matchname"
        "During symbol reading, unexpected demangled name '$matchname'.\r\n$matchname"
}
}
proc test_first_component {} {
proc test_first_component {} {
    # The function in question might complain; make sure that we see
    # The function in question might complain; make sure that we see
    # all complaints.
    # all complaints.
    gdb_test "set complaints 1000" ""
    gdb_test "set complaints 1000" ""
    test_single_component "foo"
    test_single_component "foo"
    test_single_component "operator<<"
    test_single_component "operator<<"
    test_single_component "operator>>"
    test_single_component "operator>>"
    test_single_component "operator ->"
    test_single_component "operator ->"
    test_single_component "operator()"
    test_single_component "operator()"
    test_single_component "operator>"
    test_single_component "operator>"
    test_single_component "operator<"
    test_single_component "operator<"
    test_single_component "operator ->"
    test_single_component "operator ->"
    test_single_component "operator  ->"
    test_single_component "operator  ->"
    test_single_component "foo()"
    test_single_component "foo()"
    test_single_component "foo(int)"
    test_single_component "foo(int)"
    test_single_component "foo(X::Y)"
    test_single_component "foo(X::Y)"
    test_single_component "foo(X::Y, A::B)"
    test_single_component "foo(X::Y, A::B)"
    test_single_component "foo(std::basic_streambuf >)"
    test_single_component "foo(std::basic_streambuf >)"
    test_single_component "operator>(X::Y)"
    test_single_component "operator>(X::Y)"
    # Operator names can show up in weird places.
    # Operator names can show up in weird places.
    test_single_component "int operator<< ()"
    test_single_component "int operator<< ()"
    test_single_component "T"
    test_single_component "T"
    # NOTE: carlton/2003-04-23: I've only seen the first of these
    # NOTE: carlton/2003-04-23: I've only seen the first of these
    # produced by the demangler, but I'm including two more just to be
    # produced by the demangler, but I'm including two more just to be
    # on the safe side.
    # on the safe side.
    test_single_component "int foo<&(operator<<(C, C))>()"
    test_single_component "int foo<&(operator<<(C, C))>()"
    test_single_component "int foo<&operator<<(C, C)>()"
    test_single_component "int foo<&operator<<(C, C)>()"
    test_single_component "int foo()"
    test_single_component "int foo()"
    gdb_test "maint cp first_component foo::bar" "foo"
    gdb_test "maint cp first_component foo::bar" "foo"
    gdb_test "maint cp first_component foo::bar::baz" "foo"
    gdb_test "maint cp first_component foo::bar::baz" "foo"
    gdb_test "maint cp first_component C::bar" "C"
    gdb_test "maint cp first_component C::bar" "C"
    gdb_test "maint cp first_component C > >::bar" "C > >"
    gdb_test "maint cp first_component C > >::bar" "C > >"
    # Make sure we behave appropriately on invalid input.
    # Make sure we behave appropriately on invalid input.
    # NOTE: carlton/2003-06-25: As of today, the demangler can in fact
    # NOTE: carlton/2003-06-25: As of today, the demangler can in fact
    # produce examples like the third case below: there really should
    # produce examples like the third case below: there really should
    # be a space between the two <'s.  See PR gdb/1245.
    # be a space between the two <'s.  See PR gdb/1245.
    test_invalid_name "foo<"
    test_invalid_name "foo<"
    test_invalid_name "foo("
    test_invalid_name "foo("
    test_invalid_name "bool operator<"
    test_invalid_name "bool operator<"
}
}
proc test_namespace {} {
proc test_namespace {} {
    # There's not a lot we can do to test this.
    # There's not a lot we can do to test this.
    gdb_test "maint cp namespace" "Possible namespaces:"
    gdb_test "maint cp namespace" "Possible namespaces:"
}
}
gdb_exit
gdb_exit
gdb_start
gdb_start
test_help
test_help
test_first_component
test_first_component
test_namespace
test_namespace
gdb_exit
gdb_exit
return 0
return 0
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.