This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch] OpenCL bool size fix
- From: Ken Werner <ken at linux dot vnet dot ibm dot com>
- To: gdb-patches at sourceware dot org
- Date: Tue, 15 Feb 2011 19:57:09 +0100
- Subject: [patch] OpenCL bool size fix
Hi,
The attached patch changes built-in OpenCL bool data type to a size of one
byte (instead of four). Ok to apply?
Regards
Ken
gdb/ChangeLog
2011-02-15 Ken Werner <ken.werner@de.ibm.com>
* opencl-lang.c (build_opencl_types): Set the size of the built-in
bool data type to a size of one byte.
gdb/testsuite/ChangeLog
2011-02-15 Ken Werner <ken.werner@de.ibm.com>
* gdb.opencl/datatypes.exp: Expect the size of a bool to be one byte.
Index: gdb/opencl-lang.c
===================================================================
RCS file: /cvs/src/src/gdb/opencl-lang.c,v
retrieving revision 1.5
diff -p -u -r1.5 opencl-lang.c
--- gdb/opencl-lang.c 2 Feb 2011 13:47:06 -0000 1.5
+++ gdb/opencl-lang.c 15 Feb 2011 18:51:17 -0000
@@ -1172,7 +1172,7 @@ build_opencl_types (struct gdbarch *gdba
= arch_float_type (gdbarch, 64, "double", floatformats_ieee_double);
BUILD_OCL_VTYPES (double);
builtin_opencl_type->builtin_bool
- = arch_boolean_type (gdbarch, 32, 1, "bool");
+ = arch_boolean_type (gdbarch, 8, 1, "bool");
builtin_opencl_type->builtin_unsigned_char
= arch_integer_type (gdbarch, 8, 1, "unsigned char");
builtin_opencl_type->builtin_unsigned_short
Index: gdb/testsuite/gdb.opencl/datatypes.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.opencl/datatypes.exp,v
retrieving revision 1.4
diff -p -u -r1.4 datatypes.exp
--- gdb/testsuite/gdb.opencl/datatypes.exp 31 Jan 2011 19:05:23 -0000 1.4
+++ gdb/testsuite/gdb.opencl/datatypes.exp 15 Feb 2011 18:51:17 -0000
@@ -44,7 +44,7 @@ gdb_test_no_output "set language opencl"
# Check OpenCL data types (GDB)
gdb_test "whatis bool" "type = bool"
-gdb_test "p sizeof(bool)" " = 4"
+gdb_test "p sizeof(bool)" " = 1"
gdb_test "whatis char" "type = char"
gdb_test "p sizeof(char)" " = 1"
@@ -229,7 +229,7 @@ set have_cl_khr_fp16 [get_integer_valueo
# Check OpenCL data types (DWARF)
gdb_test "whatis b" "type = bool"
-gdb_test "p sizeof(b)" " = 4"
+gdb_test "p sizeof(b)" " = 1"
gdb_test "print b" " = 0"
gdb_test "whatis c" "type = char"