Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(416)

Side by Side Diff: gdb/testsuite/gdb.base/return-nodebug.exp

Issue 11969036: Merge GDB 7.5.1 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@master
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « gdb/testsuite/gdb.base/return.c ('k') | gdb/testsuite/gdb.base/return2.exp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (C) 2009-2012 Free Software Foundation, Inc. 1 # Copyright (C) 2009-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 proc do_test {type} { 16 proc do_test {type} {
17 set typenospace [string map {{ } -} $type] 17 set typenospace [string map {{ } -} $type]
18 18
19 global pf_prefix 19 with_test_prefix "$typenospace" {
20 set old_prefix $pf_prefix 20 » if {[runto "func"]} {
21 lappend pf_prefix "$typenospace:" 21 » # Verify that we do not crash when using "return" from a
22 » # function with no debugging info. Such function has no
23 » # `struct symbol'. It may still have an associated
24 » # `struct minimal_symbol'.
22 25
23 if {[runto "func"]} { 26 » gdb_test "return -1" \
24 » # Verify that we do not crash when using "return" from a function with 27 » » "Return value type not available for selected stack frame\\.\r\n Please use an explicit cast of the value to return\\." \
25 » # no debugging info. Such function has no `struct symbol'. It may 28 » » "return from function with no debug info without a cast"
26 » # still have an associated `struct minimal_symbol'.
27 29
28 » gdb_test "return -1" \ 30 » # Cast of the result to the proper width must be done explicitely.
29 » » "Return value type not available for selected stack frame\\.\r\ nPlease use an explicit cast of the value to return\\." \ 31 » gdb_test "return ($type) -1" "#0 .* main \\(.*" \
30 » » "return from function with no debug info without a cast" 32 » » "return from function with no debug info with a cast" \
33 » » "Make selected stack frame return now\\? \\(y or n\\) " "y"
31 34
32 » # Cast of the result to the proper width must be done explicitely. 35 » gdb_test "advance marker" "marker \\(.*" \
33 » gdb_test "return ($type) -1" "#0 .* main \\(.*"»» » \ 36 » » "advance to marker"
34 » » "return from function with no debug info with a cast"» \
35 » » "Make selected stack frame return now\\? \\(y or n\\) " "y"
36 37
37 » gdb_test "advance marker" "marker \\(.*" \ 38 » # And if it returned the full width of the result.
38 » » "advance to marker" 39 » gdb_test "print /d t" " = -1" "full width of the returned result"
39 40 » }
40 » # And if it returned the full width of the result.
41 » gdb_test "print /d t" " = -1" "full width of the returned result"
42 } 41 }
43
44 set pf_prefix $old_prefix
45 } 42 }
46 43
47 foreach type {{signed char} {short} {int} {long} {long long}} { 44 foreach type {{signed char} {short} {int} {long} {long long} {float} {double}} {
48 set typeesc [string map {{ } {\ }} $type] 45 set typeesc [string map {{ } {\ }} $type]
49 set typenospace [string map {{ } -} $type] 46 set typenospace [string map {{ } -} $type]
50 47
51 set testfile "return-nodebug" 48 set testfile "return-nodebug"
52 set srcfile ${testfile}.c 49 set srcfile ${testfile}.c
53 set srcfile1 ${testfile}1.c 50 set srcfile1 ${testfile}1.c
54 set binfile ${objdir}/${subdir}/${testfile}-${typenospace} 51 set binfile ${objdir}/${subdir}/${testfile}-${typenospace}
55 52
56 set additional_flags "additional_flags=-DTYPE=$typeesc" 53 set additional_flags "additional_flags=-DTYPE=$typeesc"
57 54
(...skipping 10 matching lines...) Expand all
68 continue 65 continue
69 } 66 }
70 67
71 gdb_exit 68 gdb_exit
72 gdb_start 69 gdb_start
73 gdb_reinitialize_dir $srcdir/$subdir 70 gdb_reinitialize_dir $srcdir/$subdir
74 gdb_load ${binfile} 71 gdb_load ${binfile}
75 72
76 do_test $type 73 do_test $type
77 } 74 }
OLDNEW
« no previous file with comments | « gdb/testsuite/gdb.base/return.c ('k') | gdb/testsuite/gdb.base/return2.exp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698