From: Georg Brandl Date: Tue, 31 Mar 2009 22:35:46 +0000 (+0000) Subject: #5617: add a handy function to print a unicode string to gdbinit. X-Git-Tag: v2.7a1~1657 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=44fb2a93140269612090e237d87cd301643bda3d;p=thirdparty%2FPython%2Fcpython.git #5617: add a handy function to print a unicode string to gdbinit. --- diff --git a/Misc/gdbinit b/Misc/gdbinit index f3cb2ead060b..e648f1647bc2 100644 --- a/Misc/gdbinit +++ b/Misc/gdbinit @@ -138,3 +138,16 @@ define pystackv 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