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

This commit is contained in:
Georg Brandl 2009-03-31 22:35:46 +00:00
parent 9e47ce49a0
commit 44fb2a9314

View file

@ -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