Index: gdb/target.c
===================================================================
RCS file: /cvs/src/src/gdb/target.c,v
retrieving revision 1.259
diff -u -p -r1.259 target.c
--- gdb/target.c	7 Jul 2010 16:15:17 -0000	1.259
+++ gdb/target.c	12 Jul 2010 07:20:37 -0000
@@ -22,6 +22,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
+#include <inttypes.h>
 #include <errno.h>
 #include "gdb_string.h"
 #include "target.h"
@@ -3270,9 +3271,8 @@ debug_to_insert_breakpoint (struct gdbar
   retval = debug_target.to_insert_breakpoint (gdbarch, bp_tgt);
 
   fprintf_unfiltered (gdb_stdlog,
-		      "target_insert_breakpoint (0x%lx, xxx) = %ld\n",
-		      (unsigned long) bp_tgt->placed_address,
-		      (unsigned long) retval);
+		      "target_insert_breakpoint (0x%" PRIuPTR ", xxx) = %d\n",
+		      (uintptr_t) bp_tgt->placed_address, retval);
   return retval;
 }
 
@@ -3285,9 +3285,8 @@ debug_to_remove_breakpoint (struct gdbar
   retval = debug_target.to_remove_breakpoint (gdbarch, bp_tgt);
 
   fprintf_unfiltered (gdb_stdlog,
-		      "target_remove_breakpoint (0x%lx, xxx) = %ld\n",
-		      (unsigned long) bp_tgt->placed_address,
-		      (unsigned long) retval);
+		      "target_remove_breakpoint (0x%" PRIuPTR ", xxx) = %d\n",
+		      (intptr_t) bp_tgt->placed_address, retval);
   return retval;
 }
 
@@ -3299,11 +3298,8 @@ debug_to_can_use_hw_breakpoint (int type
   retval = debug_target.to_can_use_hw_breakpoint (type, cnt, from_tty);
 
   fprintf_unfiltered (gdb_stdlog,
-		      "target_can_use_hw_breakpoint (%ld, %ld, %ld) = %ld\n",
-		      (unsigned long) type,
-		      (unsigned long) cnt,
-		      (unsigned long) from_tty,
-		      (unsigned long) retval);
+		      "target_can_use_hw_breakpoint (%d, %d, %d) = %d\n",
+		      type, cnt, from_tty, retval);
   return retval;
 }
 
@@ -3315,10 +3311,9 @@ debug_to_region_ok_for_hw_watchpoint (CO
   retval = debug_target.to_region_ok_for_hw_watchpoint (addr, len);
 
   fprintf_unfiltered (gdb_stdlog,
-		      "target_region_ok_for_hw_watchpoint (%ld, %ld) = 0x%lx\n",
-		      (unsigned long) addr,
-		      (unsigned long) len,
-		      (unsigned long) retval);
+		      "target_region_ok_for_hw_watchpoint (%" PRIuPTR \
+		      ", %d) = 0x%" PRIuPTR "\n",
+		      (uintptr_t) addr, len, (uintptr_t) retval);
   return retval;
 }
 
@@ -3331,9 +3326,9 @@ debug_to_can_accel_watchpoint_condition 
   retval = debug_target.to_can_accel_watchpoint_condition (addr, len, rw, cond);
 
   fprintf_unfiltered (gdb_stdlog,
-		      "target_can_accel_watchpoint_condition (0x%lx, %d, %d, 0x%lx) = %ld\n",
-		      (unsigned long) addr, len, rw, (unsigned long) cond,
-		      (unsigned long) retval);
+		      "target_can_accel_watchpoint_condition (0x%" PRIuPTR \
+		      ", %d, %d, 0x%" PRIuPTR ") = %d\n",
+		      addr, len, rw, (intptr_t) cond, retval);
   return retval;
 }
 
@@ -3345,8 +3340,7 @@ debug_to_stopped_by_watchpoint (void)
   retval = debug_target.to_stopped_by_watchpoint ();
 
   fprintf_unfiltered (gdb_stdlog,
-		      "target_stopped_by_watchpoint () = %ld\n",
-		      (unsigned long) retval);
+		      "target_stopped_by_watchpoint () = %d\n", retval);
   return retval;
 }
 
@@ -3358,9 +3352,8 @@ debug_to_stopped_data_address (struct ta
   retval = debug_target.to_stopped_data_address (target, addr);
 
   fprintf_unfiltered (gdb_stdlog,
-		      "target_stopped_data_address ([0x%lx]) = %ld\n",
-		      (unsigned long)*addr,
-		      (unsigned long)retval);
+		      "target_stopped_data_address ([0x%" PRIuPTR "]) = %d\n",
+		      (uintptr_t)*addr, retval);
   return retval;
 }
 
@@ -3375,9 +3368,9 @@ debug_to_watchpoint_addr_within_range (s
 							 start, length);
 
   fprintf_filtered (gdb_stdlog,
-		    "target_watchpoint_addr_within_range (0x%lx, 0x%lx, %d) = %d\n",
-		    (unsigned long) addr, (unsigned long) start, length,
-		    retval);
+		    "target_watchpoint_addr_within_range (0x%" PRIuPTR \
+		    ", 0x%" PRIuPTR ", %d) = %d\n",
+		    (uintptr_t) addr, (uintptr_t) start, length, retval);
   return retval;
 }
 
@@ -3390,9 +3383,9 @@ debug_to_insert_hw_breakpoint (struct gd
   retval = debug_target.to_insert_hw_breakpoint (gdbarch, bp_tgt);
 
   fprintf_unfiltered (gdb_stdlog,
-		      "target_insert_hw_breakpoint (0x%lx, xxx) = %ld\n",
-		      (unsigned long) bp_tgt->placed_address,
-		      (unsigned long) retval);
+		      "target_insert_hw_breakpoint (0x%" PRIuPTR \
+		      ", xxx) = %d\n",
+		      (intptr_t) bp_tgt->placed_address, retval);
   return retval;
 }
 
@@ -3405,9 +3398,9 @@ debug_to_remove_hw_breakpoint (struct gd
   retval = debug_target.to_remove_hw_breakpoint (gdbarch, bp_tgt);
 
   fprintf_unfiltered (gdb_stdlog,
-		      "target_remove_hw_breakpoint (0x%lx, xxx) = %ld\n",
-		      (unsigned long) bp_tgt->placed_address,
-		      (unsigned long) retval);
+		      "target_remove_hw_breakpoint (0x%" PRIuPTR \
+		      ", xxx) = %d\n",
+		      (intptr_t) bp_tgt->placed_address, retval);
   return retval;
 }
 
@@ -3420,9 +3413,10 @@ debug_to_insert_watchpoint (CORE_ADDR ad
   retval = debug_target.to_insert_watchpoint (addr, len, type, cond);
 
   fprintf_unfiltered (gdb_stdlog,
-		      "target_insert_watchpoint (0x%lx, %d, %d, 0x%ld) = %ld\n",
-		      (unsigned long) addr, len, type, (unsigned long) cond,
-		      (unsigned long) retval);
+		      "target_insert_watchpoint (0x%" PRIuPTR \
+		      ", %d, %d, 0x%" PRIuPTR ") = %d\n",
+		      (uintptr_t) addr, len, type, (uintptr_t) cond,
+		      retval);
   return retval;
 }
 
@@ -3435,9 +3429,9 @@ debug_to_remove_watchpoint (CORE_ADDR ad
   retval = debug_target.to_remove_watchpoint (addr, len, type, cond);
 
   fprintf_unfiltered (gdb_stdlog,
-		      "target_remove_watchpoint (0x%lx, %d, %d, 0x%ld) = %ld\n",
-		      (unsigned long) addr, len, type, (unsigned long) cond,
-		      (unsigned long) retval);
+		      "target_remove_watchpoint (0x%" PRIuPTR ", %d, %d, 0x%" PRIuPTR \
+		      ") = %d\n",
+		      (uintptr_t) addr, len, type, (uintptr_t) cond, retval);
   return retval;
 }
 
Index: gdb/gdbserver/server.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/server.c,v
retrieving revision 1.125
diff -u -p -r1.125 server.c
--- gdb/gdbserver/server.c	7 Jul 2010 16:14:04 -0000	1.125
+++ gdb/gdbserver/server.c	12 Jul 2010 09:50:13 -0000
@@ -1539,7 +1539,11 @@ handle_query (char *own_buf, int packet_
 
       if (err == 0)
 	{
+#ifdef _WIN32
+	  sprintf (own_buf, "%I64d", address);
+#else
 	  sprintf (own_buf, "%llx", address);
+#endif
 	  return;
 	}
       else if (err > 0)
@@ -1563,7 +1567,11 @@ handle_query (char *own_buf, int packet_
       n = (*the_target->get_tib_address) (ptid, &tlb);
       if (n == 1)
 	{
+#ifdef _WIN32
+	  sprintf (own_buf, "%I64d", tlb);
+#else
 	  sprintf (own_buf, "%llx", tlb);
+#endif
 	  return;
 	}
       else if (n == 0)
