-
Notifications
You must be signed in to change notification settings - Fork 401
/
Python_Debugger.rb
140 lines (109 loc) · 3.01 KB
/
Python_Debugger.rb
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
cheatsheet do
title 'Python Debugger'
docset_file_name 'Python_Debugger'
keyword 'pdb'
source_url 'http://cheat.kapeli.com'
category do
id 'Getting Started'
entry do
name 'Start pdb inside a python script'
command 'import pdb;pdb.set_trace() '
end
entry do
name 'Start pdb from the command line'
command 'python -m pdb <file.py>'
end
end
category do
id 'Stepping'
entry do
name 'Step over'
command 'n(ext)'
end
entry do
name 'Step into'
command 's(tep)'
end
entry do
name 'Continue until the current function returns'
command 'r(eturn)'
end
entry do
name 'Continue until the next breakpoint is encountered'
command 'c(ontinue)'
end
entry do
name 'Up one level in the stack trace'
command 'u(p)'
end
entry do
name 'Down one level in the stack trace'
command 'd(own)'
end
entry do
name 'Show help'
command 'h(elp)'
command 'h(elp) command'
end
entry do
name 'Quit debugger'
command 'q(uit)'
end
end
category do
id 'Breakpoints'
entry do
name 'Show all breakpoints'
command 'b(reak)'
end
entry do
name 'Set a breakpoint at a specific line'
command 'b(reak) line_number'
end
entry do
name 'Set a breakpoint at a specific line, if condition is met'
command 'b(reak) line_number, condition'
end
entry do
name 'Set a breakpoint in a file at a specific line'
command 'b(reak) file:line_number'
end
entry do
name 'Set a breakpoint at the first line of a function'
command 'b(reak) func'
end
entry do
name 'Disable breakpoint number'
command 'disable number'
end
entry do
name 'Enable breakpoint number'
command 'enable number'
end
entry do
name 'Remove breakpoint number'
command 'clear number'
end
end
category do
id 'Printing'
entry do
name 'Print the value of expr'
command 'p(rint) expr'
command 'pp expr'
end
entry do
name 'Print current position and stack trace'
command 'w(here)'
end
entry do
name 'Print 11 lines of code around the current line'
command 'l(ist)'
command 'l(ist) start, end'
end
entry do
name 'Print the arguments of the current function'
command 'a(rgs)'
end
end
end