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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.0/] [gdb/] [testsuite/] [gdb.base/] [gdbvars.exp] - Diff between revs 107 and 1765

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

Rev 107 Rev 1765
# Copyright (C) 1992, 1997 Free Software Foundation, Inc.
# Copyright (C) 1992, 1997 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 2 of the License, or
# the Free Software Foundation; either version 2 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, write to the Free Software
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Please email any bugs, comments, and/or additions to this file to:
# Please email any bugs, comments, and/or additions to this file to:
# bug-gdb@prep.ai.mit.edu
# bug-gdb@prep.ai.mit.edu
# This file was written by Fred Fish. (fnf@cygnus.com)
# This file was written by Fred Fish. (fnf@cygnus.com)
if $tracelevel then {
if $tracelevel then {
        strace $tracelevel
        strace $tracelevel
}
}
set prms_id 0
set prms_id 0
set bug_id 0
set bug_id 0
proc test_convenience_variables {} {
proc test_convenience_variables {} {
    global gdb_prompt
    global gdb_prompt
    gdb_test "set \$foo = 101"  "" \
    gdb_test "set \$foo = 101"  "" \
        "Set a new convenience variable"
        "Set a new convenience variable"
    gdb_test "print \$foo"              " = 101" \
    gdb_test "print \$foo"              " = 101" \
        "Print contents of new convenience variable"
        "Print contents of new convenience variable"
    gdb_test "set \$foo = 301"  "" \
    gdb_test "set \$foo = 301"  "" \
        "Set convenience variable to a new value"
        "Set convenience variable to a new value"
    gdb_test "print \$foo"              " = 301" \
    gdb_test "print \$foo"              " = 301" \
        "Print new contents of convenience variable"
        "Print new contents of convenience variable"
    gdb_test "set \$_ = 11"             "" \
    gdb_test "set \$_ = 11"             "" \
        "Set convenience variable \$_"
        "Set convenience variable \$_"
    gdb_test "print \$_"                " = 11" \
    gdb_test "print \$_"                " = 11" \
        "Print contents of convenience variable \$_"
        "Print contents of convenience variable \$_"
    gdb_test "print \$foo + 10" " = 311" \
    gdb_test "print \$foo + 10" " = 311" \
        "Use convenience variable in arithmetic expression"
        "Use convenience variable in arithmetic expression"
    gdb_test "print (\$foo = 32) + 4"   " = 36" \
    gdb_test "print (\$foo = 32) + 4"   " = 36" \
        "Use convenience variable assignment in arithmetic expression"
        "Use convenience variable assignment in arithmetic expression"
    gdb_test "print \$bar"              " = void" \
    gdb_test "print \$bar"              " = void" \
        "Print contents of uninitialized convenience variable"
        "Print contents of uninitialized convenience variable"
}
}
proc test_value_history {} {
proc test_value_history {} {
    global gdb_prompt
    global gdb_prompt
    gdb_test "print 101"        "\\\$1 = 101" \
    gdb_test "print 101"        "\\\$1 = 101" \
        "Set value-history\[1\] using \$1"
        "Set value-history\[1\] using \$1"
    gdb_test "print 102"        "\\\$2 = 102" \
    gdb_test "print 102"        "\\\$2 = 102" \
        "Set value-history\[2\] using \$2"
        "Set value-history\[2\] using \$2"
    gdb_test "print 103"        "\\\$3 = 103" \
    gdb_test "print 103"        "\\\$3 = 103" \
        "Set value-history\[3\] using \$3"
        "Set value-history\[3\] using \$3"
    gdb_test "print \$\$"       "\\\$4 = 102" \
    gdb_test "print \$\$"       "\\\$4 = 102" \
        "Print value-history\[MAX-1\] using inplicit index \$\$"
        "Print value-history\[MAX-1\] using inplicit index \$\$"
    gdb_test "print \$\$"       "\\\$5 = 103" \
    gdb_test "print \$\$"       "\\\$5 = 103" \
        "Print value-history\[MAX-1\] again using implicit index \$\$"
        "Print value-history\[MAX-1\] again using implicit index \$\$"
    gdb_test "print \$" "\\\$6 = 103" \
    gdb_test "print \$" "\\\$6 = 103" \
        "Print value-history\[MAX\] using implicit index \$"
        "Print value-history\[MAX\] using implicit index \$"
    gdb_test "print \$\$2"      "\\\$7 = 102" \
    gdb_test "print \$\$2"      "\\\$7 = 102" \
        "Print value-history\[MAX-2\] using explicit index \$\$2"
        "Print value-history\[MAX-2\] using explicit index \$\$2"
    gdb_test "print \$0"        "\\\$8 = 102" \
    gdb_test "print \$0"        "\\\$8 = 102" \
        "Print value-history\[MAX\] using explicit index \$0"
        "Print value-history\[MAX\] using explicit index \$0"
    gdb_test "print 108"        "\\\$9 = 108"
    gdb_test "print 108"        "\\\$9 = 108"
    gdb_test "print \$\$0"      "\\\$10 = 108" \
    gdb_test "print \$\$0"      "\\\$10 = 108" \
        "Print value-history\[MAX\] using explicit index \$\$0"
        "Print value-history\[MAX\] using explicit index \$\$0"
    gdb_test "print \$1"        "\\\$11 = 101" \
    gdb_test "print \$1"        "\\\$11 = 101" \
        "Print value-history\[1\] using explicit index \$1"
        "Print value-history\[1\] using explicit index \$1"
    gdb_test "print \$2"        "\\\$12 = 102" \
    gdb_test "print \$2"        "\\\$12 = 102" \
        "Print value-history\[2\] using explicit index \$2"
        "Print value-history\[2\] using explicit index \$2"
    gdb_test "print \$3"        "\\\$13 = 103" \
    gdb_test "print \$3"        "\\\$13 = 103" \
        "Print value-history\[3\] using explicit index \$3"
        "Print value-history\[3\] using explicit index \$3"
    gdb_test "print \$-3"       "\\\$14 = 100" \
    gdb_test "print \$-3"       "\\\$14 = 100" \
        "Print (value-history\[MAX\] - 3) using implicit index \$"
        "Print (value-history\[MAX\] - 3) using implicit index \$"
    gdb_test "print \$1 + 3"    "\\\$15 = 104" \
    gdb_test "print \$1 + 3"    "\\\$15 = 104" \
        "Use value-history element in arithmetic expression"
        "Use value-history element in arithmetic expression"
}
}
# Start with a fresh gdb.
# Start with a fresh gdb.
gdb_exit
gdb_exit
gdb_start
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_reinitialize_dir $srcdir/$subdir
send_gdb "set print sevenbit-strings\n" ; gdb_expect -re ".*$gdb_prompt $"
send_gdb "set print sevenbit-strings\n" ; gdb_expect -re ".*$gdb_prompt $"
test_value_history
test_value_history
test_convenience_variables
test_convenience_variables
 
 

powered by: WebSVN 2.1.0

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