diff options
author | Daniel Jacobowitz <drow@false.org> | 2009-11-13 21:59:00 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2009-11-13 21:59:00 +0000 |
commit | 7cbcbded71b7da1f31f63ac3cb5705249e5e4887 (patch) | |
tree | 6b29c6cbb28ebf0caa2b79045a41170249409e94 /gdb/testsuite/gdb.base/display.c | |
parent | f16cd0d502d32721849ec650d4dfda17fb530066 (diff) | |
download | gdb-7cbcbded71b7da1f31f63ac3cb5705249e5e4887.zip gdb-7cbcbded71b7da1f31f63ac3cb5705249e5e4887.tar.gz gdb-7cbcbded71b7da1f31f63ac3cb5705249e5e4887.tar.bz2 |
gdb/testsuite/
* gdb.cp/formatted-ref.exp (test_p_x_ref_addr): Allow the reference
to be in memory.
* gdb.base/display.c (force_mem): New.
(do_loops): Use it. Add breakpoint comments.
(do_vars): Add a breakpoint comment.
* gdb.base/display.exp: Use gdb_get_line_number. Remove hardcoded
line numbers.
Diffstat (limited to 'gdb/testsuite/gdb.base/display.c')
-rw-r--r-- | gdb/testsuite/gdb.base/display.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gdb/testsuite/gdb.base/display.c b/gdb/testsuite/gdb.base/display.c index 3652409..332c45b 100644 --- a/gdb/testsuite/gdb.base/display.c +++ b/gdb/testsuite/gdb.base/display.c @@ -5,20 +5,23 @@ int sum = 0; +/* Call to force a variable onto the stack so we can see its address. */ +void force_mem (int *arg) { } + int do_loops() { int i=0; int k=0; int j=0; float f=3.1415; - for( i = 0; i < LOOP; i++ ) { + for( i = 0; i < LOOP; i++ ) { /* set breakpoint 1 here */ for( j = 0; j < LOOP; j++ ) { for( k = 0; k < LOOP; k++ ) { - sum++; f++; + sum++; f++; force_mem (&k); } } } - return i; + return i; /* set breakpoint 2 here */ } int do_vars() @@ -34,7 +37,7 @@ int do_vars() /* Need some code here to set breaks on. */ for( j = 0; j < LOOP; j++ ) { - if( p_c[j] == c ) { + if( p_c[j] == c ) { /* set breakpoint 3 here */ j++; } else { |