This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Fix build of sparc-solaris2.8 with -m64.


Hi,

Attached is a patch to fix gdb build on sparc-solaris2.8 with -m64.

Without this patch, I get:

.../procfs.c:5798: error: format '%#10x' expects type 'unsigned int', but argument 4 has type 'size_t'

The patch fixes the problem by casting a size_t variable to unsigned
long.  Also, it teaches printf_filtered to expect unsigned long
accordingly.

Tested by building gdb.  Committed as obvious.

Kazu Hirata

2009-01-20  Kazu Hirata  <kazu@codesourcery.com>

	* gdb/procfs.c (info_mappings_callback): Cast map->pr_size to
	unsigned long.

Index: gdb/procfs.c
===================================================================
--- gdb/procfs.c	(revision 234281)
+++ gdb/procfs.c	(working copy)
@@ -5790,17 +5790,17 @@ info_mappings_callback (struct prmap *ma
 #endif
 
   if (gdbarch_addr_bit (current_gdbarch) == 32)
-    printf_filtered ("\t%#10lx %#10lx %#10x %#10x %7s\n",
+    printf_filtered ("\t%#10lx %#10lx %#10lx %#10x %7s\n",
 		     (unsigned long) map->pr_vaddr,
 		     (unsigned long) map->pr_vaddr + map->pr_size - 1,
-		     map->pr_size,
+		     (unsigned long) map->pr_size,
 		     pr_off,
 		     mappingflags (map->pr_mflags));
   else
-    printf_filtered ("  %#18lx %#18lx %#10x %#10x %7s\n",
+    printf_filtered ("  %#18lx %#18lx %#10lx %#10x %7s\n",
 		     (unsigned long) map->pr_vaddr,
 		     (unsigned long) map->pr_vaddr + map->pr_size - 1,
-		     map->pr_size,
+		     (unsigned long) map->pr_size,
 		     pr_off,
 		     mappingflags (map->pr_mflags));
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]