-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgdbinit
More file actions
97 lines (88 loc) · 1.64 KB
/
gdbinit
File metadata and controls
97 lines (88 loc) · 1.64 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#set print address off
#set print null-stop
set breakpoint pending on
set height 100
set history remove-duplicates unlimited
set history save
set history size 2048
set print asm-demangle
set print object
set print static-members off
set print thread-events off
set print vtbl
#set print array
#set print pretty
handle SIGPIPE nostop
handle SIGUSR1 nostop noprint
handle SIGUSR2 nostop noprint
source gdbinit
# because there are rc, rn, and rs:
define rf
reverse-finish
end
define record0u
p/u ($arg0)->record[0][0] @ ($arg0)->s->reclength
end
document record0u
Print/u a record[0] of a TABLE
end
define pp
printf "----------\n%s\n----------\n", $arg0
end
document pp
Print a string verbatim (no C escapes, no truncation)
end
define r-or-c
if $_thread == 0
r
else
c
end
end
define ber
if $argc == 0
b my_message_sql
else
b my_message_sql if error == $arg0
end
r-or-c
end
document ber
Breakpoint on Error and Run.
Put a breakpoint on my_message_sql, optionally only for a specific error code,
and run.
Use: ./mtr --gdb='ber 1160'
end
define bir
b $arg0
if $argc > 1
ign 1 $arg1
end
r-or-c
end
document bir
Breakpint with Ignore and Run.
Put a breakpoint, optionally with an ignore count, and run.
Use: ./mtr --gdb='bir mysql_parse 15'
end
define bque
b parse_sql if $_streq(parser_state->m_lip->m_ptr,$arg0)
comm
pp parser_state->m_lip->m_buf
end
r-or-c
end
document bque
Breakpoint on a Query (and Run).
Use: ./mtr --gdb='bque "select 1 from t1"'
end
define qq
if $_thread == 0
quit
end
end
document qq
Safe quit. Quits only if the program isn't running.
Use: ./mtr --gdb='r;qq'
end
source ~/.gdb.py