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 gdb]: Fix PR gdb/15161 part 3 of 3


Hi,

this patch fixes part three of the PR gdb/15161 issue in
gdbserver/server.c file.
Here we are using to evaluate 'long long' types via strto(u)l instead
of strto(u)ll function.
That patch fixes that.

2013-02-19  Kai Tietz  <ktietz@redhat.com>

	PR gdb/15161
	* server.c (handle_query): Evaluate base via strtoull.
	(process_serial_event): Evaluate addr via strtoull.

Ok for apply?

Regards,
Kai

Index: server.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/server.c,v
retrieving revision 1.184
diff -p -u -r1.184 server.c
--- server.c	25 Jan 2013 14:12:02 -0000	1.184
+++ server.c	19 Feb 2013 17:07:07 -0000
@@ -1813,7 +1814,7 @@ handle_query (char *own_buf, int packet_
       unsigned long long crc;

       require_running (own_buf);
-      base = strtoul (own_buf + 5, &comma, 16);
+      base = (CORE_ADDR) strtoull (own_buf + 5, &comma, 16);
       if (*comma++ != ',')
 	{
 	  write_enn (own_buf);
@@ -3194,7 +3195,7 @@ process_serial_event (void)
       {
 	char *lenptr;
 	char *dataptr;
-	CORE_ADDR addr = strtoul (&own_buf[3], &lenptr, 16);
+	CORE_ADDR addr = (CORE_ADDR) strtoull (&own_buf[3], &lenptr, 16);
 	int len = strtol (lenptr + 1, &dataptr, 16);
 	char type = own_buf[1];
 	int res;


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