| OLD | NEW |
| 1 # Copyright 2004, 2007-2012 Free Software Foundation, Inc. | 1 # Copyright 2004-2013 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 |
| 11 # GNU General Public License for more details. | 11 # GNU General Public License for more details. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 23 # it is non-current (made a call, interrupted, ...), this is because | 23 # it is non-current (made a call, interrupted, ...), this is because |
| 24 # instructions executed to perform the call may affect "info frame" | 24 # instructions executed to perform the call may affect "info frame" |
| 25 # output. | 25 # output. |
| 26 | 26 |
| 27 if [target_info exists gdb,nosignals] { | 27 if [target_info exists gdb,nosignals] { |
| 28 verbose "Skipping savedregs.exp because of nosignals." | 28 verbose "Skipping savedregs.exp because of nosignals." |
| 29 continue | 29 continue |
| 30 } | 30 } |
| 31 | 31 |
| 32 | 32 |
| 33 set testfile savedregs | 33 standard_testfile .c |
| 34 set srcfile ${testfile}.c | 34 |
| 35 set binfile ${objdir}/${subdir}/${testfile} | |
| 36 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
ug}] != "" } { | 35 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb
ug}] != "" } { |
| 37 untested "Couldn't compile ${module}.c" | 36 untested "Couldn't compile ${module}.c" |
| 38 return -1 | 37 return -1 |
| 39 } | 38 } |
| 40 | 39 |
| 41 # get things started | 40 # get things started |
| 42 gdb_exit | 41 clean_restart ${binfile} |
| 43 gdb_start | |
| 44 gdb_reinitialize_dir $srcdir/$subdir | |
| 45 gdb_load ${binfile} | |
| 46 | 42 |
| 47 # Advance to main | 43 # Advance to main |
| 48 if { ![runto_main] } { | 44 if { ![runto_main] } { |
| 49 gdb_suppress_tests; | 45 gdb_suppress_tests |
| 50 } | 46 } |
| 51 | 47 |
| 52 proc process_saved_regs { current inner outer } { | 48 proc process_saved_regs { current inner outer } { |
| 53 global gdb_prompt | 49 global gdb_prompt |
| 54 global expect_out | 50 global expect_out |
| 55 global saved_regs | 51 global saved_regs |
| 56 | 52 |
| 57 # Skip the CURRENT frame. | 53 # Skip the CURRENT frame. |
| 58 | 54 |
| 59 set level 1 | 55 set level 1 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 | 141 |
| 146 # Breakpoint at and call the caller function, saved-regs of main and | 142 # Breakpoint at and call the caller function, saved-regs of main and |
| 147 # catcher, capture caller's registers. | 143 # catcher, capture caller's registers. |
| 148 gdb_test "break caller" | 144 gdb_test "break caller" |
| 149 gdb_test "call caller (1,2,3,4,5,6,7,8)" | 145 gdb_test "call caller (1,2,3,4,5,6,7,8)" |
| 150 process_saved_regs caller { dummy catcher } { sigtramp thrower main } | 146 process_saved_regs caller { dummy catcher } { sigtramp thrower main } |
| 151 | 147 |
| 152 # Run to callee, again check everything. | 148 # Run to callee, again check everything. |
| 153 gdb_test "advance callee" "callee .* at .*" | 149 gdb_test "advance callee" "callee .* at .*" |
| 154 process_saved_regs callee { caller } { dummy catcher sigtramp thrower main } | 150 process_saved_regs callee { caller } { dummy catcher sigtramp thrower main } |
| OLD | NEW |