~ubuntu-branches/debian/jessie/gdb/jessie

« back to all changes in this revision

Viewing changes to gdb/testsuite/gdb.reverse/watch-reverse.exp

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Jacobowitz
  • Date: 2010-03-20 01:21:29 UTC
  • mfrom: (1.3.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20100320012129-t7h25y8zgr8c2369
Tags: 7.1-1
* New upstream release, including:
  - PIE support (Closes: #346409).
  - C++ improvements, including static_cast<> et al, namespace imports,
    and bug fixes in printing virtual base classes.
  - Multi-program debugging.  One GDB can now debug multiple programs
    at the same time.
  - Python scripting improvements, including gdb.parse_and_eval.
  - Updated MIPS Linux signal frame layout (Closes: #570875).
  - No internal error stepping over _dl_debug_state (Closes: #569551).
* Update to Standards-Version: 3.8.4 (no changes required).
* Include more relevant (and smaller) docs in the gdbserver package
  (Closes: #571132).
* Do not duplicate documentation in gdb64, gdb-source, and libgdb-dev.
* Fix crash when switching into TUI mode (Closes: #568489).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2008, 2009 Free Software Foundation, Inc.
 
1
# Copyright 2008, 2009, 2010 Free Software Foundation, Inc.
2
2
 
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
38
38
    # FIXME: command ought to acknowledge, so we can test if it succeeded.
39
39
}
40
40
 
41
 
# Only software watchpoints can be used in reverse
42
 
gdb_test "set can-use-hw-watchpoints 0" "" ""
 
41
# Test software watchpoints
 
42
gdb_test "set can-use-hw-watchpoints 0" "" "disable hw watchpoints"
43
43
 
44
44
gdb_test "break marker1" \
45
45
    "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \
123
123
    ".*\[Ww\]atchpoint.*ival3.*Old value = 0.*New value = -1.*ival3 = count; ival4 = count;.*" \
124
124
    "watchpoint hit in reverse, fifth time"
125
125
 
126
 
 
127
 
return 0
 
126
gdb_test "set can-use-hw-watchpoints 1" "" "enable hw watchpoints"
 
127
 
 
128
###
 
129
###
 
130
###
 
131
 
 
132
# FIXME 'set exec-dir' command should give some output so we can test.
 
133
gdb_test "set exec-direction forward" "" "set forward"
 
134
 
 
135
# Continue until first change, from -1 to 0
 
136
 
 
137
gdb_test "continue" \
 
138
    ".*\[Ww\]atchpoint.*ival3.*Old value = -1.*New value = 0.*ival3 = count; ival4 = count;.*" \
 
139
    "watchpoint hit, forward replay, first time"
 
140
 
 
141
# Continue until the next change, from 0 to 1.
 
142
gdb_test "continue" \
 
143
    ".*\[Ww\]atchpoint.*ival3.*Old value = 0.*New value = 1.*ival3 = count; ival4 = count;.*" \
 
144
    "watchpoint hit, forward replay, second time"
 
145
 
 
146
# Continue until the next change, from 1 to 2.
 
147
gdb_test "continue" \
 
148
    ".*\[Ww\]atchpoint.*ival3.*Old value = 1.*New value = 2.*ival3 = count; ival4 = count;.*" \
 
149
    "watchpoint hit, forward replay, third time"
 
150
 
 
151
# Continue until the next change, from 2 to 3.
 
152
gdb_test "continue" \
 
153
    ".*\[Ww\]atchpoint.*ival3.*Old value = 2.*New value = 3.*ival3 = count; ival4 = count;.*" \
 
154
    "watchpoint hit, forward replay, fourth time"
 
155
 
 
156
# Continue until the next change, from 3 to 4.
 
157
# Note that this one is outside the loop.
 
158
 
 
159
gdb_test "continue" \
 
160
    ".*\[Ww\]atchpoint.*ival3.*Old value = 3.*New value = 4.*ival3 = count; ival4 = count;.*" \
 
161
    "watchpoint hit, forward replay, fifth time"
 
162
 
 
163
# Continue until we hit the finishing marker function.
 
164
# Make sure we hit no more watchpoints.
 
165
 
 
166
gdb_test "continue" "marker2 .*" "replay forward to marker2"
 
167
 
 
168
###
 
169
###
 
170
###
 
171
 
 
172
# FIXME 'set exec-dir' command should give some output so we can test.
 
173
gdb_test "set exec-direction reverse" "" "set reverse"
 
174
 
 
175
# Reverse until the previous change, from 4 to 3
 
176
# Note that this one is outside the loop
 
177
 
 
178
gdb_test "continue" \
 
179
    ".*\[Ww\]atchpoint.*ival3.*Old value = 4.*New value = 3.*ival3 = count; ival4 = count;.*" \
 
180
    "watchpoint hit in reverse, HW, first time"
 
181
 
 
182
# Reverse until the previous change, from 3 to 2.
 
183
gdb_test "continue" \
 
184
    ".*\[Ww\]atchpoint.*ival3.*Old value = 3.*New value = 2.*ival3 = count; ival4 = count;.*" \
 
185
    "watchpoint hit in reverse, HW, second time"
 
186
 
 
187
# Reverse until the previous change, from 2 to 1.
 
188
gdb_test "continue" \
 
189
    ".*\[Ww\]atchpoint.*ival3.*Old value = 2.*New value = 1.*ival3 = count; ival4 = count;.*" \
 
190
    "watchpoint hit in reverse, HW, third time"
 
191
 
 
192
# Reverse until the previous change, from 1 to 0.
 
193
gdb_test "continue" \
 
194
    ".*\[Ww\]atchpoint.*ival3.*Old value = 1.*New value = 0.*ival3 = count; ival4 = count;.*" \
 
195
    "watchpoint hit in reverse, HW, fourth time"
 
196
 
 
197
# Reverse until first change, from 0 to -1
 
198
 
 
199
gdb_test "continue" \
 
200
    ".*\[Ww\]atchpoint.*ival3.*Old value = 0.*New value = -1.*ival3 = count; ival4 = count;.*" \
 
201
    "watchpoint hit in reverse, HW, fifth time"
 
202