-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgdbinit
48 lines (35 loc) · 1.28 KB
/
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
37
38
39
40
41
42
43
44
45
46
# My options #
#
# enable printing derived type using vtable info
set print object on
# nice structure printing
set print pretty on
# coloured prompt (\001 and \002 are to indicate non-printing characters to gdb; see http://dirac.org/linux/gdb/03-Initialization,_Listing,_And_Running.php
# note that coloured prompt doesn't work in TUI mode :-(
#set prompt \001\033[31m\002(gdb) \001\033[0m\002
# ---------------------------------------------------------------------------------- #
# python section to import pretty printers for Qt
python
import sys, os.path
sys.path.insert(0, os.path.expanduser('~/.gdb'))
from qt4_gdb_pretty_printers import register_qt4_printers
register_qt4_printers (None)
import qt5printers
qt5printers.register_printers(gdb.current_objfile())
end
# ---------------------------------------------------------------------------------- #
# Prints QString from Qt 4
# Taken from http://silmor.de/qtstuff.printqstring.php [Qt 5 version also available]
define printqstring
printf "(QString)0x%x (length=%i): \"",&$arg0,$arg0.d->size
set $i=0
while $i < $arg0.d->size
set $c=$arg0.d->data[$i++]
if $c < 32 || $c > 127
printf "\\u0x%04x", $c
else
printf "%c", (char)$c
end
end
printf "\"\n"
end