-
Notifications
You must be signed in to change notification settings - Fork 1
/
gdbinit
37 lines (33 loc) · 791 Bytes
/
gdbinit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
set history save on
set startup-with-shell off
# got from http://silmor.de/qtstuff.printqstring.php
define printqs5static
set $d=$arg0.d
printf "(Qt5 QString)0x%x length=%i: \"",&$arg0,$d->size
set $i=0
set $ca=(const ushort*)(((const char*)$d)+$d->offset)
while $i < $d->size
set $c=$ca[$i++]
if $c < 32 || $c > 127
printf "\\u%04x", $c
else
printf "%c" , (char)$c
end
end
printf "\"\n"
end
define printqs5dynamic
set $d=(QStringData*)$arg0.d
printf "(Qt5 QString)0x%x length=%i: \"",&$arg0,$d->size
set $i=0
while $i < $d->size
set $c=$d->data()[$i++]
if $c < 32 || $c > 127
printf "\\u%04x", $c
else
printf "%c" , (char)$c
end
end
printf "\"\n"
end
# also try https://github.com/Lekensteyn/qt5printers