[uClibc]gdbserver bugfix for uClibc

Ilguiz Latypov ilatypov at superbt.com
Thu Sep 6 00:42:56 UTC 2001


Hello,

I found a bug in gdbserver that produced the "Invalid hex character
received" message on the client side.  Watching the debug output of the
client-server protocol helped me to realize that the %p format specifier
in send_area() of low-linux.c produced the hexadecimal numbers prepended
with "0x".

This conforms the GNU libc's format interpretation.  However, the gdb
client expects only hexadecimal digits.  Hence the trouble.

Perhaps, the C library supplied with Greg Ungerer's uClinux-coldfire
distribution did not produce extra "0x", and gdbserver worked there.

Ilguiz

=================================================================
diff -u -r1.1.1.1 -r1.2
--- low-linux.c	2001/09/05 21:34:46	1.1.1.1
+++ low-linux.c	2001/09/05 23:00:53	1.2
@@ -52,7 +52,8 @@

 #include <linux/ptrace.h>

-#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1)
+#if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1)) && \
+	! defined(__UCLIBC__)
 #include <sys/reg.h>
 #endif

@@ -505,7 +506,7 @@
 	 */
     unsigned int x;
     x = data_start - (code_end - code_start);
-    sprintf(buf,"Text=%p;Data=%p;Bss=%p;", code_start, x, x);
+    sprintf(buf,"Text=%x;Data=%x;Bss=%x;", code_start, x, x);
 }

 void

=================================================================






More information about the uClibc mailing list