OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gdb/] [gdb-6.8/] [gdb-6.8.openrisc-2.1/] [gdb/] [testsuite/] [gdb.base/] [advance.exp] - Diff between revs 24 and 33

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

Rev 24 Rev 33
# Copyright 2003, 2007, 2008 Free Software Foundation, Inc.
# Copyright 2003, 2007, 2008 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 .  */
# 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
# advance.exp -- Expect script to test 'advance' in gdb
# advance.exp -- Expect script to test 'advance' in gdb
if $tracelevel then {
if $tracelevel then {
    strace $tracelevel
    strace $tracelevel
}
}
set testfile advance
set testfile advance
set srcfile ${testfile}.c
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
set binfile ${objdir}/${subdir}/${testfile}
remote_exec build "rm -f ${binfile}"
remote_exec build "rm -f ${binfile}"
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
    untested advance.exp
    untested advance.exp
    return -1
    return -1
}
}
gdb_exit
gdb_exit
gdb_start
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
gdb_load ${binfile}
if ![runto_main] then {
if ![runto_main] then {
    fail "Can't run to main"
    fail "Can't run to main"
    return 0
    return 0
}
}
# Verify that "advance " works.  (This is really just syntactic
# Verify that "advance " works.  (This is really just syntactic
# sugar for "tbreak ; continue".)
# sugar for "tbreak ; continue".)
#
#
gdb_test "advance [gdb_get_line_number "advance this location"]" \
gdb_test "advance [gdb_get_line_number "advance this location"]" \
        "main .* at .*:.*b = 3.*advance this location.*" \
        "main .* at .*:.*b = 3.*advance this location.*" \
        "advance line number"
        "advance line number"
# Verify that a malformed "advance" is gracefully caught.
# Verify that a malformed "advance" is gracefully caught.
#
#
gdb_test "advance [gdb_get_line_number "advance malformed"] then stop" \
gdb_test "advance [gdb_get_line_number "advance malformed"] then stop" \
        "Junk at end of arguments." "malformed advance"
        "Junk at end of arguments." "malformed advance"
# Verify that "advance " works.
# Verify that "advance " works.
#
#
gdb_test "advance func" \
gdb_test "advance func" \
        "func.*at.*x = x \\+ 5." \
        "func.*at.*x = x \\+ 5." \
        "advance func"
        "advance func"
# Verify that "advance " when funcname is NOT called by the current
# Verify that "advance " when funcname is NOT called by the current
# frame, stops at the end of the current frame.
# frame, stops at the end of the current frame.
#
#
# gdb can legitimately stop on either the current line or the next line,
# gdb can legitimately stop on either the current line or the next line,
# depending on whether the machine instruction for 'call' on the current
# depending on whether the machine instruction for 'call' on the current
# line has more instructions after it or not.
# line has more instructions after it or not.
#
#
gdb_test "advance func3" \
gdb_test "advance func3" \
        "(in main|).*(func \\(c\\)|marker1 \\(\\)).*stop here after leaving current frame..."\
        "(in main|).*(func \\(c\\)|marker1 \\(\\)).*stop here after leaving current frame..."\
        "advance function not called by current frame"
        "advance function not called by current frame"
# break at main again
# break at main again
#
#
gdb_test "break [gdb_get_line_number "break here"]" \
gdb_test "break [gdb_get_line_number "break here"]" \
        ".*Breakpoint.* at .*" \
        ".*Breakpoint.* at .*" \
        "set breakpoint at call to func3"
        "set breakpoint at call to func3"
gdb_test "continue" \
gdb_test "continue" \
        ".*Breakpoint ${decimal}, main.*func3.*break here.*" \
        ".*Breakpoint ${decimal}, main.*func3.*break here.*" \
        "continue to call to func3 in main"
        "continue to call to func3 in main"
# Verify that "advance " when funcname is called as parameter to
# Verify that "advance " when funcname is called as parameter to
# another function works.
# another function works.
#
#
gdb_test "advance foo" \
gdb_test "advance foo" \
        "foo \\(a=5\\).*int b = a \\+ 10;"\
        "foo \\(a=5\\).*int b = a \\+ 10;"\
        "advance function called as param"
        "advance function called as param"
# Verify that we get an error if we use 'advance' w/o argument
# Verify that we get an error if we use 'advance' w/o argument
#
#
gdb_test "advance" \
gdb_test "advance" \
        "Argument required \\(a location\\)."\
        "Argument required \\(a location\\)."\
        "advance with no argument"
        "advance with no argument"
 
 

powered by: WebSVN 2.1.0

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