From: Andrew Cagney Date: Fri, 5 Nov 2004 23:38:25 +0000 (+0000) Subject: 2004-11-05 Andrew Cagney X-Git-Tag: gdb_6_3-20041109-release~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b572b73ef2aa137656df9615fb9e8c9c634ee32a;p=thirdparty%2Fbinutils-gdb.git 2004-11-05 Andrew Cagney Backport 2004-10-27 Jim Blandy * remote.c (fetch_register_using_p): Construct 'p' packet in a manner independent of the host byte order. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e8cbfc8bebb..3a008d581b0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2004-11-05 Andrew Cagney + + Backport 2004-10-27 Jim Blandy + * remote.c (fetch_register_using_p): Construct 'p' packet in a + manner independent of the host byte order. + 2004-11-04 Kei Sakamoto * Makefile.in (m32r-tdep.o): Update dependencies. diff --git a/gdb/remote.c b/gdb/remote.c index c389c4a7f3b..5d1ac7f2eb0 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -3176,9 +3176,10 @@ fetch_register_using_p (int regnum) char regp[MAX_REGISTER_SIZE]; int i; - buf[0] = 'p'; - bin2hex((char *) ®num, &buf[1], sizeof(regnum)); - buf[9] = 0; + p = buf; + *p++ = 'p'; + p += hexnumstr (p, regnum); + *p++ = '\0'; remote_send (buf, rs->remote_packet_size); if (buf[0] != 0 && buf[0] != 'E') { p = buf;