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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-6.8/] [gdb/] [testsuite/] [gdb.base/] [consecutive.exp] - Diff between revs 24 and 157

Only display areas with differences | Details | Blame | View Log

Rev 24 Rev 157
#   Copyright 2001, 2007, 2008 Free Software Foundation, Inc.
#   Copyright 2001, 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@redhat.com)
# This file was written by Michael Snyder. (msnyder@redhat.com)
if $tracelevel then {
if $tracelevel then {
    strace $tracelevel
    strace $tracelevel
}
}
#
#
# Test breakpoints at consecutive instruction addresses.
# Test breakpoints at consecutive instruction addresses.
#
#
set prms_id 0
set prms_id 0
set bug_id 0
set bug_id 0
set testfile "consecutive"
set testfile "consecutive"
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}" executable {debug nowarnings}] != "" } {
if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
    untested consecutive.exp
    untested consecutive.exp
    return -1
    return -1
}
}
if [get_compiler_info ${binfile}] {
if [get_compiler_info ${binfile}] {
    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 [target_info exists gdb_stub] {
if [target_info exists gdb_stub] {
    gdb_step_for_stub;
    gdb_step_for_stub;
}
}
if ![runto_main] then {
if ![runto_main] then {
    perror "couldn't run to breakpoint"
    perror "couldn't run to breakpoint"
    continue
    continue
}
}
set nl "\[\r\n\]+"
set nl "\[\r\n\]+"
gdb_breakpoint foo
gdb_breakpoint foo
gdb_test "continue" "Breakpoint $decimal, foo .*" \
gdb_test "continue" "Breakpoint $decimal, foo .*" \
        "continue to breakpoint in foo"
        "continue to breakpoint in foo"
set bp_addr 0
set bp_addr 0
set stop_addr 0
set stop_addr 0
send_gdb "x /2i \$pc\n"
send_gdb "x /2i \$pc\n"
gdb_expect {
gdb_expect {
    global hex
    global hex
    global nl
    global nl
    global bp_addr
    global bp_addr
    global gdb_prompt
    global gdb_prompt
    -re "$hex.*${nl}($hex).*$gdb_prompt $" {
    -re "$hex.*${nl}($hex).*$gdb_prompt $" {
        set bp_addr $expect_out(1,string)
        set bp_addr $expect_out(1,string)
        pass "get breakpoint address for foo"
        pass "get breakpoint address for foo"
    }
    }
    -re ".*$gdb_prompt $" {
    -re ".*$gdb_prompt $" {
        fail "get breakpoint address for foo"
        fail "get breakpoint address for foo"
        return 0;
        return 0;
    }
    }
    timeout {
    timeout {
        fail "get breakpoint address for foo (timeout)"
        fail "get breakpoint address for foo (timeout)"
        return 0;
        return 0;
    }
    }
}
}
gdb_test "break \*$bp_addr" "Breakpoint $decimal at $bp_addr: file .*" \
gdb_test "break \*$bp_addr" "Breakpoint $decimal at $bp_addr: file .*" \
        "set bp, 2nd instr"
        "set bp, 2nd instr"
send_gdb "step\n"
send_gdb "step\n"
gdb_expect {
gdb_expect {
    -re "Breakpoint $decimal, ($hex) in foo.*$gdb_prompt $" {
    -re "Breakpoint $decimal, ($hex) in foo.*$gdb_prompt $" {
        set stop_addr $expect_out(1,string)
        set stop_addr $expect_out(1,string)
        if [eval expr "$bp_addr == $stop_addr"] then {
        if [eval expr "$bp_addr == $stop_addr"] then {
            pass "stopped at bp, 2nd instr"
            pass "stopped at bp, 2nd instr"
        } else {
        } else {
            fail "stopped at bp, 2nd instr (wrong address)"
            fail "stopped at bp, 2nd instr (wrong address)"
        }
        }
    }
    }
    -re ".*$gdb_prompt $" {
    -re ".*$gdb_prompt $" {
        fail "stopped at bp, 2nd instr"
        fail "stopped at bp, 2nd instr"
    }
    }
    timeout {
    timeout {
        fail "stopped at bp, 2nd instr (timeout)"
        fail "stopped at bp, 2nd instr (timeout)"
    }
    }
}
}
 
 

powered by: WebSVN 2.1.0

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