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] - Blame information for rev 24

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 24 jeremybenn
#   Copyright 2001, 2007, 2008 Free Software Foundation, Inc.
2
 
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 3 of the License, or
6
# (at your option) any later version.
7
#
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
# GNU General Public License for more details.
12
#
13
# You should have received a copy of the GNU General Public License
14
# along with this program.  If not, see .
15
 
16
# Please email any bugs, comments, and/or additions to this file to:
17
# bug-gdb@prep.ai.mit.edu
18
 
19
# This file was written by Michael Snyder. (msnyder@redhat.com)
20
 
21
if $tracelevel then {
22
    strace $tracelevel
23
}
24
 
25
#
26
# Test breakpoints at consecutive instruction addresses.
27
#
28
 
29
set prms_id 0
30
set bug_id 0
31
 
32
set testfile "consecutive"
33
set srcfile ${testfile}.c
34
set binfile ${objdir}/${subdir}/${testfile}
35
 
36
if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug nowarnings}] != "" } {
37
    untested consecutive.exp
38
    return -1
39
}
40
 
41
if [get_compiler_info ${binfile}] {
42
    return -1
43
}
44
 
45
gdb_exit
46
gdb_start
47
gdb_reinitialize_dir $srcdir/$subdir
48
gdb_load ${binfile}
49
 
50
if [target_info exists gdb_stub] {
51
    gdb_step_for_stub;
52
}
53
 
54
if ![runto_main] then {
55
    perror "couldn't run to breakpoint"
56
    continue
57
}
58
 
59
set nl "\[\r\n\]+"
60
 
61
gdb_breakpoint foo
62
gdb_test "continue" "Breakpoint $decimal, foo .*" \
63
        "continue to breakpoint in foo"
64
 
65
set bp_addr 0
66
set stop_addr 0
67
 
68
send_gdb "x /2i \$pc\n"
69
gdb_expect {
70
    global hex
71
    global nl
72
    global bp_addr
73
    global gdb_prompt
74
 
75
    -re "$hex.*${nl}($hex).*$gdb_prompt $" {
76
        set bp_addr $expect_out(1,string)
77
        pass "get breakpoint address for foo"
78
    }
79
    -re ".*$gdb_prompt $" {
80
        fail "get breakpoint address for foo"
81
        return 0;
82
    }
83
    timeout {
84
        fail "get breakpoint address for foo (timeout)"
85
        return 0;
86
    }
87
}
88
 
89
gdb_test "break \*$bp_addr" "Breakpoint $decimal at $bp_addr: file .*" \
90
        "set bp, 2nd instr"
91
 
92
send_gdb "step\n"
93
gdb_expect {
94
    -re "Breakpoint $decimal, ($hex) in foo.*$gdb_prompt $" {
95
        set stop_addr $expect_out(1,string)
96
        if [eval expr "$bp_addr == $stop_addr"] then {
97
            pass "stopped at bp, 2nd instr"
98
        } else {
99
            fail "stopped at bp, 2nd instr (wrong address)"
100
        }
101
    }
102
    -re ".*$gdb_prompt $" {
103
        fail "stopped at bp, 2nd instr"
104
    }
105
    timeout {
106
        fail "stopped at bp, 2nd instr (timeout)"
107
 
108
    }
109
}
110
 

powered by: WebSVN 2.1.0

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