[RFA] info_sharedlibrary_command patch

Martin M. Hunt hunt@redhat.com
Mon Feb 19 16:52:00 GMT 2001


info_sharedlibrary_command() currently casts all addresses to long before
printing them.  Obviously this fails if pointers are larger than longs.

2001-02-19  Martin M. Hunt  <hunt@redhat.com>

	* solib.c (info_sharedlibrary_command): Don't assume pointers
	are the same size of long, call	longest_local_hex_string_custom().

Index: solib.c
===================================================================
RCS file: /cvs/src/src/gdb/solib.c,v
retrieving revision 1.34
diff -u -p -r1.34 solib.c
--- solib.c	2001/02/19 11:47:16	1.34
+++ solib.c	2001/02/20 00:19:51
@@ -638,14 +638,14 @@ info_sharedlibrary_command (char *ignore

 	  printf_unfiltered ("%-*s", addr_width,
 			     so->textsection != NULL
-			       ? local_hex_string_custom (
-			           (unsigned long) so->textsection->addr,
+			       ? longest_local_hex_string_custom (
+			           (LONGEST) so->textsection->addr,
 	                           addr_fmt)
 			       : "");
 	  printf_unfiltered ("%-*s", addr_width,
 			     so->textsection != NULL
-			       ? local_hex_string_custom (
-			           (unsigned long) so->textsection->endaddr,
+			       ? longest_local_hex_string_custom (
+			           (LONGEST) so->textsection->endaddr,
 	                           addr_fmt)
 			       : "");
 	  printf_unfiltered ("%-12s", so->symbols_loaded ? "Yes" : "No");



More information about the Gdb-patches mailing list