From: Jim Blandy Date: Wed, 27 Oct 2004 20:03:50 +0000 (+0000) Subject: * remote.c (fetch_register_using_p): Construct 'p' packet in a X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fcad0fa40f42e82567ab1e98a65887a54ea5a6d4;p=binutils-gdb.git * 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 84022c0a7e5..62497183a58 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2004-10-27 Jim Blandy + + * remote.c (fetch_register_using_p): Construct 'p' packet in a + manner independent of the host byte order. + 2004-10-27 Mark Kettenis * mips-tdep.c (id_delayed): Remove prototype. 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;