This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch, spu] Detect OpenCL program executables
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: jan dot kratochvil at redhat dot com (Jan Kratochvil)
- Cc: ken at linux dot vnet dot ibm dot com (Ken Werner), gdb-patches at sourceware dot org
- Date: Sat, 26 Jun 2010 00:04:00 +0200 (CEST)
- Subject: Re: [patch, spu] Detect OpenCL program executables
Jan Kratochvil wrote:
> On 32bit hosts with --enable-64-bit-bfd --enable-targets=all it causes:
>
> solib-spu.c: In function 'append_ocl_sos':
> solib-spu.c:130: error: format '%lx' expects type 'long unsigned int', but argument 4 has type 'CORE_ADDR'
Oops, sorry for overlooking that.
Fixed by using hex_string just like in spu_current_sos.
Tested on powerpc64-linux, committed to mainline.
Bye,
Ulrich
ChangeLog:
* solib-spu.c (append_ocl_sos): Fix xsnprintf statement for
hosts where CORE_ADDR is long long.
Index: gdb/solib-spu.c
===================================================================
RCS file: /cvs/src/src/gdb/solib-spu.c,v
retrieving revision 1.11
diff -u -p -r1.11 solib-spu.c
--- gdb/solib-spu.c 25 Jun 2010 17:39:56 -0000 1.11
+++ gdb/solib-spu.c 25 Jun 2010 20:40:57 -0000
@@ -126,8 +126,9 @@ append_ocl_sos (struct so_list **link_pt
new = XZALLOC (struct so_list);
/* Encode FD and object ID in path name. */
- xsnprintf (new->so_name, sizeof new->so_name, "@0x%lx <%d>",
- data, SPUADDR_SPU (*ocl_program_addr_base));
+ xsnprintf (new->so_name, sizeof new->so_name, "@%s <%d>",
+ hex_string (data),
+ SPUADDR_SPU (*ocl_program_addr_base));
strcpy (new->so_original_name, new->so_name);
*link_ptr = new;
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com