| OLD | NEW | 
|---|
| 1 #   Copyright 2003, 2007-2012 Free Software Foundation, Inc. | 1 #   Copyright 2003, 2007-2012 Free Software Foundation, Inc. | 
| 2 | 2 | 
| 3 # This program is free software; you can redistribute it and/or modify | 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 | 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 | 5 # the Free Software Foundation; either version 3 of the License, or | 
| 6 # (at your option) any later version. | 6 # (at your option) any later version. | 
| 7 # | 7 # | 
| 8 # This program is distributed in the hope that it will be useful, | 8 # This program is distributed in the hope that it will be useful, | 
| 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 
| 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 57 gdb_start | 57 gdb_start | 
| 58 gdb_reinitialize_dir $srcdir/$subdir | 58 gdb_reinitialize_dir $srcdir/$subdir | 
| 59 gdb_load ${binfile} | 59 gdb_load ${binfile} | 
| 60 | 60 | 
| 61 gdb_test "break ${srcfile}:[gdb_get_line_number "euphonium"]" ".*" \ | 61 gdb_test "break ${srcfile}:[gdb_get_line_number "euphonium"]" ".*" \ | 
| 62     "set breakpoint" | 62     "set breakpoint" | 
| 63 | 63 | 
| 64 # The goal of all this is to make sure that there's plenty of memory | 64 # The goal of all this is to make sure that there's plenty of memory | 
| 65 # churn, and different amounts of it each time the inferior stops; | 65 # churn, and different amounts of it each time the inferior stops; | 
| 66 # this seems to make GDB crash more reliably. | 66 # this seems to make GDB crash more reliably. | 
| 67 set lines {{if (i%2) == 0} | 67 set lines {{if i<0 || i > 100} | 
|  | 68 »          {echo Invalid i value\n} | 
|  | 69 »          {else} | 
|  | 70 »          {if (i%2) == 0} | 
| 68            {echo "even "} | 71            {echo "even "} | 
| 69            {print i} | 72            {print i} | 
| 70            {else} | 73            {else} | 
| 71            {echo "odd "} | 74            {echo "odd "} | 
| 72            {print i} | 75            {print i} | 
| 73            {end} | 76            {end} | 
| 74            {set variable $foo = 0} | 77            {set variable $foo = 0} | 
| 75            {set variable $j = 0} | 78            {set variable $j = 0} | 
| 76            {while $j < i} | 79            {while $j < i} | 
| 77            {set variable $foo += $j} | 80            {set variable $foo += $j} | 
| 78            {set variable $j++} | 81            {set variable $j++} | 
| 79            {end} | 82            {end} | 
| 80            {print $foo} | 83            {print $foo} | 
| 81            {if i != 40} | 84            {if i != 40} | 
| 82            {c} | 85            {c} | 
| 83            {end} | 86            {end} | 
|  | 87            {end} | 
| 84            {end}} | 88            {end}} | 
| 85 | 89 | 
| 86 send_gdb "commands\n" | 90 send_gdb "commands\n" | 
| 87 for {set i 0} {$i < [llength $lines]} {incr i} { | 91 for {set i 0} {$i < [llength $lines]} {incr i} { | 
| 88     gdb_expect { | 92     gdb_expect { | 
| 89         -re ".*>" { | 93         -re ".*>" { | 
| 90             send_gdb "[lindex $lines $i]\n" | 94             send_gdb "[lindex $lines $i]\n" | 
| 91         } | 95         } | 
| 92         -re "$gdb_prompt $" { | 96         -re "$gdb_prompt $" { | 
| 93             set reason "got top-level prompt early" | 97             set reason "got top-level prompt early" | 
| (...skipping 13 matching lines...) Expand all  Loading... | 
| 107 | 111 | 
| 108 gdb_run_cmd | 112 gdb_run_cmd | 
| 109 | 113 | 
| 110 set prev_timeout $timeout | 114 set prev_timeout $timeout | 
| 111 set timeout 120 | 115 set timeout 120 | 
| 112 | 116 | 
| 113 gdb_test_multiple "" "run program with breakpoint commands" { | 117 gdb_test_multiple "" "run program with breakpoint commands" { | 
| 114     -re "warning: Invalid control type in command structure" { | 118     -re "warning: Invalid control type in command structure" { | 
| 115         kfail "gdb/1489" "run program with breakpoint commands" | 119         kfail "gdb/1489" "run program with breakpoint commands" | 
| 116     } | 120     } | 
|  | 121     -re "Invalid i value\r\n$gdb_prompt $" { | 
|  | 122         xfail "run program with breakpoint commands (i value not readable)" | 
|  | 123     } | 
| 117     -re "$gdb_prompt $" { | 124     -re "$gdb_prompt $" { | 
| 118         pass "run program with breakpoint commands" | 125         pass "run program with breakpoint commands" | 
| 119     } | 126     } | 
| 120     eof { | 127     eof { | 
| 121         kfail "gdb/1489" "run program with breakpoint commands (GDB died)" | 128         kfail "gdb/1489" "run program with breakpoint commands (GDB died)" | 
| 122     } | 129     } | 
| 123 } | 130 } | 
| 124 | 131 | 
| 125 set timeout $prev_timeout | 132 set timeout $prev_timeout | 
| OLD | NEW | 
|---|