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-7.2/] [gdb-7.2-or32-1.0rc1/] [gdb/] [testsuite/] [gdb.reverse/] [break-reverse.exp] - Blame information for rev 341

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 330 jeremybenn
#   Copyright 2008, 2009, 2010 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
# This file is part of the GDB testsuite.  It tests reverse debugging
17
# with breakpoints.
18
 
19
if ![target_info exists gdb,can_reverse] {
20
    return
21
}
22
 
23
set testfile "break-reverse"
24
set srcfile  ${testfile}.c
25
 
26
if { [prepare_for_testing $testfile.exp $testfile $srcfile] } {
27
    return -1
28
}
29
 
30
set foo_location  [gdb_get_line_number "break in foo" ]
31
set bar_location  [gdb_get_line_number "break in bar" ]
32
set main_location [gdb_get_line_number "break in main"]
33
set end_location  [gdb_get_line_number "end of main"  ]
34
 
35
runto main
36
 
37
if [target_info exists gdb,use_precord] {
38
    # Activate process record/replay
39
    gdb_test_no_output "record" "Turn on process record"
40
}
41
 
42
gdb_test "break foo" \
43
    "Breakpoint $decimal at .* line $foo_location\." \
44
    "set breakpoint on foo"
45
 
46
gdb_test "break bar" \
47
    "Breakpoint $decimal at .* line $bar_location\." \
48
    "set breakpoint on bar"
49
 
50
gdb_test "break $end_location" \
51
    "Breakpoint $decimal at .* line $end_location\." \
52
    set breakpoint at end of main"
53
 
54
gdb_continue_to_breakpoint "foo" ".*/$srcfile:$foo_location.*"
55
gdb_continue_to_breakpoint "bar" ".*/$srcfile:$bar_location.*"
56
gdb_continue_to_breakpoint "end" ".*/$srcfile:$end_location.*"
57
 
58
gdb_test_no_output "set exec-direction reverse" "set reverse"
59
 
60
gdb_continue_to_breakpoint "bar backward"  ".*/$srcfile:$bar_location.*"
61
gdb_continue_to_breakpoint "foo backward"  ".*/$srcfile:$foo_location.*"
62
 
63
gdb_test_multiple "continue" "main backward" {
64
    -re ".*Breakpoint $decimal,.*/$srcfile:$main_location.*$gdb_prompt $" {
65
        pass "main backward"
66
    }
67
    -re "No more reverse-execution history.* break in main .*$gdb_prompt $" {
68
        pass "main backward"
69
    }
70
}
71
 
72
gdb_test_no_output "set exec-direction forward" "set forward"
73
 
74
gdb_continue_to_breakpoint "foo" ".*/$srcfile:$foo_location.*"
75
gdb_continue_to_breakpoint "bar" ".*/$srcfile:$bar_location.*"
76
 
77
gdb_test_multiple "continue" "end of record log" {
78
    -re ".*Breakpoint $decimal,.*/$srcfile:$end_location.*$gdb_prompt $" {
79
        pass "end of record log"
80
    }
81
    -re "No more reverse-execution history.* end of main .*$gdb_prompt $" {
82
        pass "end of record log"
83
    }
84
}

powered by: WebSVN 2.1.0

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