|
|
7a6771 |
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=224128
|
|
|
7a6771 |
|
|
|
7a6771 |
2007-01-25 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
7a6771 |
|
|
|
7a6771 |
* gdb.base/charsign.exp, gdb.base/charsign.c: New files.
|
|
|
7a6771 |
[ stripped ]
|
|
|
7a6771 |
|
|
|
7a6771 |
2007-10-19 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
|
7a6771 |
|
|
|
7a6771 |
Port to GDB-6.7 - only the testcase left, patch has been reverted,
|
|
|
7a6771 |
char-vectors restricted.
|
|
|
7a6771 |
|
|
|
7a6771 |
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/charsign.c
|
|
|
7a6771 |
===================================================================
|
|
|
7a6771 |
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
|
|
7a6771 |
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/charsign.c 2016-02-15 23:26:06.429811778 +0100
|
|
|
7a6771 |
@@ -0,0 +1,37 @@
|
|
|
7a6771 |
+/* This testcase is part of GDB, the GNU debugger.
|
|
|
7a6771 |
+
|
|
|
7a6771 |
+ Copyright 2007 Free Software Foundation, Inc.
|
|
|
7a6771 |
+
|
|
|
7a6771 |
+ This program is free software; you can redistribute it and/or modify
|
|
|
7a6771 |
+ it under the terms of the GNU General Public License as published by
|
|
|
7a6771 |
+ the Free Software Foundation; either version 2 of the License, or
|
|
|
7a6771 |
+ (at your option) any later version.
|
|
|
7a6771 |
+
|
|
|
7a6771 |
+ This program is distributed in the hope that it will be useful,
|
|
|
7a6771 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
7a6771 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
7a6771 |
+ GNU General Public License for more details.
|
|
|
7a6771 |
+
|
|
|
7a6771 |
+ You should have received a copy of the GNU General Public License
|
|
|
7a6771 |
+ along with this program; if not, write to the Free Software
|
|
|
7a6771 |
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
7a6771 |
+
|
|
|
7a6771 |
+ Please email any bugs, comments, and/or additions to this file to:
|
|
|
7a6771 |
+ bug-gdb@prep.ai.mit.edu */
|
|
|
7a6771 |
+
|
|
|
7a6771 |
+int main()
|
|
|
7a6771 |
+{
|
|
|
7a6771 |
+ return 0;
|
|
|
7a6771 |
+}
|
|
|
7a6771 |
+
|
|
|
7a6771 |
+char n[]="A";
|
|
|
7a6771 |
+signed char s[]="A";
|
|
|
7a6771 |
+unsigned char u[]="A";
|
|
|
7a6771 |
+
|
|
|
7a6771 |
+typedef char char_n;
|
|
|
7a6771 |
+typedef signed char char_s;
|
|
|
7a6771 |
+typedef unsigned char char_u;
|
|
|
7a6771 |
+
|
|
|
7a6771 |
+char_n n_typed[]="A";
|
|
|
7a6771 |
+char_s s_typed[]="A";
|
|
|
7a6771 |
+char_u u_typed[]="A";
|
|
|
7a6771 |
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/charsign.exp
|
|
|
7a6771 |
===================================================================
|
|
|
7a6771 |
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
|
|
7a6771 |
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/charsign.exp 2016-02-15 23:26:12.409854237 +0100
|
|
|
7a6771 |
@@ -0,0 +1,63 @@
|
|
|
7a6771 |
+# Copyright 2007 Free Software Foundation, Inc.
|
|
|
7a6771 |
+
|
|
|
7a6771 |
+# This program is free software; you can redistribute it and/or modify
|
|
|
7a6771 |
+# it under the terms of the GNU General Public License as published by
|
|
|
7a6771 |
+# the Free Software Foundation; either version 2 of the License, or
|
|
|
7a6771 |
+# (at your option) any later version.
|
|
|
7a6771 |
+#
|
|
|
7a6771 |
+# This program is distributed in the hope that it will be useful,
|
|
|
7a6771 |
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
7a6771 |
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
7a6771 |
+# GNU General Public License for more details.
|
|
|
7a6771 |
+#
|
|
|
7a6771 |
+# You should have received a copy of the GNU General Public License
|
|
|
7a6771 |
+# along with this program; if not, write to the Free Software
|
|
|
7a6771 |
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
7a6771 |
+
|
|
|
7a6771 |
+set testfile charsign
|
|
|
7a6771 |
+set srcfile ${testfile}.c
|
|
|
7a6771 |
+set binfile [standard_output_file ${testfile}]
|
|
|
7a6771 |
+
|
|
|
7a6771 |
+proc do_test { cflags } {
|
|
|
7a6771 |
+ global srcdir
|
|
|
7a6771 |
+ global binfile
|
|
|
7a6771 |
+ global subdir
|
|
|
7a6771 |
+ global srcfile
|
|
|
7a6771 |
+ global gdb_prompt
|
|
|
7a6771 |
+
|
|
|
7a6771 |
+ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug additional_flags=$cflags]] != "" } {
|
|
|
7a6771 |
+ untested "Couldn't compile test program"
|
|
|
7a6771 |
+ return -1
|
|
|
7a6771 |
+ }
|
|
|
7a6771 |
+
|
|
|
7a6771 |
+ # Get things started.
|
|
|
7a6771 |
+
|
|
|
7a6771 |
+ gdb_exit
|
|
|
7a6771 |
+ gdb_start
|
|
|
7a6771 |
+ gdb_reinitialize_dir $srcdir/$subdir
|
|
|
7a6771 |
+ gdb_load ${binfile}
|
|
|
7a6771 |
+
|
|
|
7a6771 |
+ # For C programs, "start" should stop in main().
|
|
|
7a6771 |
+
|
|
|
7a6771 |
+ gdb_test "p n" \
|
|
|
7a6771 |
+ "= \"A\""
|
|
|
7a6771 |
+ gdb_test "p s" \
|
|
|
7a6771 |
+ "= \\{65 'A', 0 '\\\\0'\\}"
|
|
|
7a6771 |
+ gdb_test "p u" \
|
|
|
7a6771 |
+ "= \\{65 'A', 0 '\\\\0'\\}"
|
|
|
7a6771 |
+ gdb_test "p n_typed" \
|
|
|
7a6771 |
+ "= \"A\""
|
|
|
7a6771 |
+ gdb_test "p s_typed" \
|
|
|
7a6771 |
+ "= \\{65 'A', 0 '\\\\0'\\}"
|
|
|
7a6771 |
+ gdb_test "p u_typed" \
|
|
|
7a6771 |
+ "= \\{65 'A', 0 '\\\\0'\\}"
|
|
|
7a6771 |
+}
|
|
|
7a6771 |
+
|
|
|
7a6771 |
+# The string identification works despite the compiler flags below due to
|
|
|
7a6771 |
+# gdbtypes.c:
|
|
|
7a6771 |
+# if (name && strcmp (name, "char") == 0)
|
|
|
7a6771 |
+# TYPE_FLAGS (type) |= TYPE_FLAG_NOSIGN;
|
|
|
7a6771 |
+
|
|
|
7a6771 |
+do_test {}
|
|
|
7a6771 |
+do_test {-fsigned-char}
|
|
|
7a6771 |
+do_test {-funsigned-char}
|