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

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gdb-6.8/] [pre-binutils-2.20.1-sync/] [gdb/] [testsuite/] [gdb.trace/] [while-stepping.exp] - Diff between revs 24 and 157

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

Rev 24 Rev 157
#   Copyright 1998, 2007, 2008 Free Software Foundation, Inc.
#   Copyright 1998, 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
# This file was written by Michael Snyder (msnyder@cygnus.com)
# This file was written by Michael Snyder (msnyder@cygnus.com)
load_lib "trace-support.exp";
load_lib "trace-support.exp";
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
gdb_exit
gdb_exit
gdb_start
gdb_start
if [istarget "m68k-*-elf"] then {
if [istarget "m68k-*-elf"] then {
    set srcfile gdb_c_test.c
    set srcfile gdb_c_test.c
    set binfile [board_info target d490_binfile];
    set binfile [board_info target d490_binfile];
} else {
} else {
    set testfile "actions"
    set testfile "actions"
    set srcfile ${testfile}.c
    set srcfile ${testfile}.c
    set binfile ${objdir}/${subdir}/${testfile}
    set binfile ${objdir}/${subdir}/${testfile}
    if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" $binfile \
    if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" $binfile \
            executable {debug nowarnings}] != "" } {
            executable {debug nowarnings}] != "" } {
        untested while-stepping.exp
        untested while-stepping.exp
        return -1
        return -1
    }
    }
}
}
gdb_reinitialize_dir $srcdir/$subdir
gdb_reinitialize_dir $srcdir/$subdir
# If testing on a remote host, download the source file.
# If testing on a remote host, download the source file.
# remote_download host $srcdir/$subdir/$srcfile
# remote_download host $srcdir/$subdir/$srcfile
gdb_file_cmd $binfile
gdb_file_cmd $binfile
#
#
# test while-stepping command
# test while-stepping command
#
#
gdb_delete_tracepoints
gdb_delete_tracepoints
set trcpt1 [gdb_gettpnum gdb_c_test]
set trcpt1 [gdb_gettpnum gdb_c_test]
if { $trcpt1 <= 0 } then {
if { $trcpt1 <= 0 } then {
    fail "Could not find gdb_c_test function"
    fail "Could not find gdb_c_test function"
    return;
    return;
}
}
# 5.12 basic while-stepping command (collect regs)
# 5.12 basic while-stepping command (collect regs)
gdb_test "info tracepoints" \
gdb_test "info tracepoints" \
        "Num Enb Address\[ \]+PassC StepC What.*$trcpt1.*0x.*\[\t \]+\[0-9\]+\[\t \]+0\[\t \]+.*in gdb_c_test.*" \
        "Num Enb Address\[ \]+PassC StepC What.*$trcpt1.*0x.*\[\t \]+\[0-9\]+\[\t \]+0\[\t \]+.*in gdb_c_test.*" \
        "5.12: set a tracepoint, stepcount is zero"
        "5.12: set a tracepoint, stepcount is zero"
set stepcount 12
set stepcount 12
gdb_trace_setactions "5.12: set stepcount to $stepcount" \
gdb_trace_setactions "5.12: set stepcount to $stepcount" \
        "" \
        "" \
        "while-stepping $stepcount" "" \
        "while-stepping $stepcount" "" \
        "collect \$regs" "^$" \
        "collect \$regs" "^$" \
        "end" ""
        "end" ""
gdb_test "info tracepoints" \
gdb_test "info tracepoints" \
    "Num Enb Address\[ \]+PassC StepC What.*$trcpt1.*0x.*\[\t \]+\[0-9\]+\[\t \]+$stepcount\[\t \]+.*in gdb_c_test.*" \
    "Num Enb Address\[ \]+PassC StepC What.*$trcpt1.*0x.*\[\t \]+\[0-9\]+\[\t \]+$stepcount\[\t \]+.*in gdb_c_test.*" \
        "5.12: confirm stepcount set to $stepcount"
        "5.12: confirm stepcount set to $stepcount"
gdb_test "info tracepoints" \
gdb_test "info tracepoints" \
    "Num Enb Address\[ \]+PassC StepC What.*
    "Num Enb Address\[ \]+PassC StepC What.*
.*while-stepping $stepcount.*" \
.*while-stepping $stepcount.*" \
        "5.12: info trace shows \"while-stepping\""
        "5.12: info trace shows \"while-stepping\""
# 5.13 step out of context while collecting local variable
# 5.13 step out of context while collecting local variable
#      [deferred to dynamic test section]
#      [deferred to dynamic test section]
proc while_stepping_bogus_arg { bogus msgstring } {
proc while_stepping_bogus_arg { bogus msgstring } {
    global gdb_prompt;
    global gdb_prompt;
    gdb_trace_setactions "$msgstring" \
    gdb_trace_setactions "$msgstring" \
            "" \
            "" \
            "while-stepping $bogus" "\[Ee\]rror|\[Ww\]arning"
            "while-stepping $bogus" "\[Ee\]rror|\[Ww\]arning"
}
}
# 5.14 while-stepping (no argument)
# 5.14 while-stepping (no argument)
while_stepping_bogus_arg "" "5.14: while-stepping null stepcount"
while_stepping_bogus_arg "" "5.14: while-stepping null stepcount"
# 5.15 while-stepping (zero stepcount)
# 5.15 while-stepping (zero stepcount)
while_stepping_bogus_arg "0" "5.15: while-stepping rejects zero stepcount"
while_stepping_bogus_arg "0" "5.15: while-stepping rejects zero stepcount"
# 5.16 while-stepping without collecting anything
# 5.16 while-stepping without collecting anything
gdb_trace_setactions "5.16: step without collecting anything" \
gdb_trace_setactions "5.16: step without collecting anything" \
        "" \
        "" \
        "while-stepping $stepcount" "^$" \
        "while-stepping $stepcount" "^$" \
        "end" ""
        "end" ""
gdb_test "info tracepoints" \
gdb_test "info tracepoints" \
        ".*$trcpt1.*0x.*\[\t \]+\[0-9\]+\[\t \]+$stepcount\[\t \]+.*in gdb_c_test.*\[ \t\]+Actions for tracepoint $trcpt1:.*\[ \t\]+while-stepping $stepcount.*\[ \t\]+end.*\[ \t\]+end.*" \
        ".*$trcpt1.*0x.*\[\t \]+\[0-9\]+\[\t \]+$stepcount\[\t \]+.*in gdb_c_test.*\[ \t\]+Actions for tracepoint $trcpt1:.*\[ \t\]+while-stepping $stepcount.*\[ \t\]+end.*\[ \t\]+end.*" \
        "5.16: confirm actions, step without collecting anything"
        "5.16: confirm actions, step without collecting anything"
 
 

powered by: WebSVN 2.1.0

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