OLD | NEW |
1 # Copyright 2010-2012 Free Software Foundation, Inc. | 1 # Copyright 2010-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 |
11 # GNU General Public License for more details. | 11 # GNU General Public License for more details. |
12 # | 12 # |
13 # You should have received a copy of the GNU General Public License | 13 # You should have received a copy of the GNU General Public License |
14 # along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
15 | 15 |
16 if $tracelevel then { | 16 load_lib "pascal.exp" |
17 strace $tracelevel | 17 |
| 18 standard_testfile .pas |
| 19 |
| 20 if {[gdb_compile_pascal "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable
[list debug ]] != "" } { |
| 21 untested $testfile.exp |
| 22 return -1 |
18 } | 23 } |
19 | 24 |
20 load_lib "pascal.exp" | 25 clean_restart ${testfile} |
21 | |
22 set testfile "gdb11492" | |
23 set srcfile ${testfile}.pas | |
24 set binfile ${objdir}/${subdir}/${testfile}$EXEEXT | |
25 | |
26 if {[gdb_compile_pascal "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable
[list debug ]] != "" } { | |
27 return -1 | |
28 } | |
29 | |
30 gdb_exit | |
31 gdb_start | |
32 gdb_reinitialize_dir $srcdir/$subdir | |
33 gdb_load ${binfile} | |
34 set bp_location1 [gdb_get_line_number "set breakpoint 1 here"] | 26 set bp_location1 [gdb_get_line_number "set breakpoint 1 here"] |
35 | 27 |
36 if { [gdb_breakpoint ${srcfile}:${bp_location1}] } { | 28 if { [gdb_breakpoint ${srcfile}:${bp_location1}] } { |
37 pass "setting breakpoint 1" | 29 pass "setting breakpoint 1" |
38 } | 30 } |
39 | 31 |
40 # Verify that "start" lands inside the right procedure. | 32 # Verify that "start" lands inside the right procedure. |
41 if { [gdb_start_cmd] < 0 } { | 33 if { [gdb_start_cmd] < 0 } { |
42 untested start | 34 untested start |
43 return -1 | 35 return -1 |
44 } | 36 } |
45 | 37 |
46 gdb_test "" ".* at .*${srcfile}.*" "start" | 38 gdb_test "" ".* at .*${srcfile}.*" "start" |
47 gdb_test "continue" "" | 39 gdb_test "continue" "" |
48 | 40 |
49 gdb_test "print integer_array" { = \{50, 51, 52, 53, 54, 55, 56, 57\}} | 41 gdb_test "print integer_array" { = \{50, 51, 52, 53, 54, 55, 56, 57\}} |
50 gdb_test "print /s integer_array" " = '23456789'" | 42 gdb_test "print /s integer_array" " = '23456789'" |
51 | 43 |
52 gdb_test "print char_array" " = '23456789'" | 44 gdb_test "print char_array" " = '23456789'" |
53 gdb_test "print /d char_array" { = \{50, 51, 52, 53, 54, 55, 56, 57\}} | 45 gdb_test "print /d char_array" { = \{50, 51, 52, 53, 54, 55, 56, 57\}} |
54 gdb_test "print /x char_array" { = \{0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0
x39\}} | 46 gdb_test "print /x char_array" { = \{0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0
x39\}} |
55 # Use next two times to avoid GPC line numbering problem | 47 # Use next two times to avoid GPC line numbering problem |
56 gdb_test "next" "" | 48 gdb_test "next" "" |
57 gdb_test "next" "" | 49 gdb_test "next" "" |
58 gdb_test "print char_array" " = '2345X789'" | 50 gdb_test "print char_array" " = '2345X789'" |
59 gdb_exit | 51 gdb_exit |
60 | 52 |
OLD | NEW |