Blame SOURCES/gdb-6.7-charsign-test.patch

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