OLD | NEW |
1 # This testcase is part of GDB, the GNU debugger. | 1 # This testcase is part of GDB, the GNU debugger. |
2 | 2 |
3 # Copyright 2001, 2004, 2007-2012 Free Software Foundation, Inc. | 3 # Copyright 2001-2013 Free Software Foundation, Inc. |
4 | 4 |
5 # This program is free software; you can redistribute it and/or modify | 5 # This program is free software; you can redistribute it and/or modify |
6 # it under the terms of the GNU General Public License as published by | 6 # it under the terms of the GNU General Public License as published by |
7 # the Free Software Foundation; either version 3 of the License, or | 7 # the Free Software Foundation; either version 3 of the License, or |
8 # (at your option) any later version. | 8 # (at your option) any later version. |
9 # | 9 # |
10 # This program is distributed in the hope that it will be useful, | 10 # This program is distributed in the hope that it will be useful, |
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 # GNU General Public License for more details. | 13 # GNU General Public License for more details. |
14 # | 14 # |
15 # You should have received a copy of the GNU General Public License | 15 # You should have received a copy of the GNU General Public License |
16 # along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 |
18 # Please email any bugs, comments, and/or additions to this file to: | 18 # Please email any bugs, comments, and/or additions to this file to: |
19 # bug-gdb@gnu.org | 19 # bug-gdb@gnu.org |
20 | 20 |
21 # Test GDB's character set support. | 21 # Test GDB's character set support. |
22 | 22 |
23 | 23 |
24 set testfile "charset" | 24 standard_testfile .c charset-malloc.c |
25 set srcfile ${testfile}.c | 25 |
26 set srcmallocfile ${testfile}-malloc.c | 26 if { [prepare_for_testing ${testfile}.exp ${testfile} [list $srcfile $srcfile2]]
} { |
27 if { [prepare_for_testing ${testfile}.exp ${testfile} [list $srcfile $srcmallocf
ile]] } { | |
28 return -1 | 27 return -1 |
29 } | 28 } |
30 | 29 |
31 # Parse the output from a `show charset' command. Return the host | 30 # Parse the output from a `show charset' command. Return the host |
32 # and target charset as a two-element list. | 31 # and target charset as a two-element list. |
33 proc parse_show_charset_output {testname} { | 32 proc parse_show_charset_output {testname} { |
34 global gdb_prompt | 33 global gdb_prompt |
35 | 34 |
36 gdb_expect { | 35 gdb_expect { |
37 -re "The host character set is \"(.*)\"\\.\[\r\n\]+The target character
set is \"(.*)\"\\.\[\r\n\]+The target wide character set is \"(.*)\"\\.\[\r\n\]+
$gdb_prompt $" { | 36 -re "The host character set is \"(.*)\"\\.\[\r\n\]+The target character
set is \"(.*)\"\\.\[\r\n\]+The target wide character set is \"(.*)\"\\.\[\r\n\]+
$gdb_prompt $" { |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 # Regression test for a typedef to a typedef. | 570 # Regression test for a typedef to a typedef. |
572 gdb_test "print myvar" "= \[0-9\]+ L'A'" \ | 571 gdb_test "print myvar" "= \[0-9\]+ L'A'" \ |
573 "typedef to wchar_t" | 572 "typedef to wchar_t" |
574 } | 573 } |
575 if {$ucs2_ok && $ucs4_ok} { | 574 if {$ucs2_ok && $ucs4_ok} { |
576 test_combination u UTF-16 U UTF-32 | 575 test_combination u UTF-16 U UTF-32 |
577 } | 576 } |
578 | 577 |
579 if {$ucs2_ok} { | 578 if {$ucs2_ok} { |
580 set go 1 | 579 set go 1 |
581 gdb_test_multiple "python print 'hello, world!'" \ | 580 gdb_test_multiple "python print ('hello, world!')" \ |
582 "verify python support for charset tests" { | 581 "verify python support for charset tests" { |
583 -re "not supported.*$gdb_prompt $" { | 582 -re "not supported.*$gdb_prompt $" { |
584 unsupported "python support is disabled" | 583 unsupported "python support is disabled" |
585 set go 0 | 584 set go 0 |
586 } | 585 } |
587 -re "$gdb_prompt $" {} | 586 -re "$gdb_prompt $" {} |
588 } | 587 } |
589 | 588 |
590 if {$go} { | 589 if {$go} { |
591 gdb_test "print u\"abcdef\"" " = u\"abcdef\"" \ | 590 gdb_test "print u\"abcdef\"" " = u\"abcdef\"" \ |
592 "set up for python printing of utf-16 string" | 591 "set up for python printing of utf-16 string" |
593 | 592 |
594 » gdb_test "python print gdb.history(0).string()" "abcdef" \ | 593 » gdb_test "python print (gdb.history(0).string())" "abcdef" \ |
595 "extract utf-16 string using python" | 594 "extract utf-16 string using python" |
596 } | 595 } |
597 } | 596 } |
598 | 597 |
599 # Regression test for a cleanup bug in the charset code. | 598 # Regression test for a cleanup bug in the charset code. |
600 gdb_test "print 'a' == 'a' || 'b' == 'b'" \ | 599 gdb_test "print 'a' == 'a' || 'b' == 'b'" \ |
601 ".* = 1" \ | 600 ".* = 1" \ |
602 "EVAL_SKIP cleanup handling regression test" | 601 "EVAL_SKIP cleanup handling regression test" |
603 | 602 |
604 | 603 |
(...skipping 18 matching lines...) Expand all Loading... |
623 foreach name {short int long} { | 622 foreach name {short int long} { |
624 # We're really just checking to make sure this doesn't give an | 623 # We're really just checking to make sure this doesn't give an |
625 # error. | 624 # error. |
626 gdb_test "print ${name}_array = \"hi\"" \ | 625 gdb_test "print ${name}_array = \"hi\"" \ |
627 " = {.*}" \ | 626 " = {.*}" \ |
628 "assign string to $name array" | 627 "assign string to $name array" |
629 } | 628 } |
630 | 629 |
631 | 630 |
632 gdb_exit | 631 gdb_exit |
OLD | NEW |