[Python-checkins] r70912 - python/trunk/Misc/gdbinit

georg.brandl python-checkins at python.org
Wed Apr 1 00:35:46 CEST 2009


Author: georg.brandl
Date: Wed Apr  1 00:35:46 2009
New Revision: 70912

Log:
#5617: add a handy function to print a unicode string to gdbinit.

Modified:
   python/trunk/Misc/gdbinit

Modified: python/trunk/Misc/gdbinit
==============================================================================
--- python/trunk/Misc/gdbinit	(original)
+++ python/trunk/Misc/gdbinit	Wed Apr  1 00:35:46 2009
@@ -138,3 +138,16 @@
     end
     select-frame 0
 end
+
+# generally useful macro to print a Unicode string
+def pu
+  set $uni = $arg0 
+  set $i = 0
+  while (*$uni && $i++<100)
+    if (*$uni < 0x80) 
+      print *(char*)$uni++
+    else
+      print /x *(short*)$uni++
+    end
+  end
+end


More information about the Python-checkins mailing list