Guido van Rossum | 35f7542 | 1998-10-13 23:51:13 +0000 | [diff] [blame] | 1 | import os |
| 2 | import bdb |
| 3 | import traceback |
| 4 | from Tkinter import * |
Guido van Rossum | 504b0bf | 1999-01-02 21:28:54 +0000 | [diff] [blame] | 5 | from WindowList import ListedToplevel |
Guido van Rossum | 35f7542 | 1998-10-13 23:51:13 +0000 | [diff] [blame] | 6 | |
Guido van Rossum | 5188a25 | 1998-10-16 18:59:39 +0000 | [diff] [blame] | 7 | import StackViewer |
| 8 | |
Guido van Rossum | 35f7542 | 1998-10-13 23:51:13 +0000 | [diff] [blame] | 9 | |
| 10 | class Debugger(bdb.Bdb): |
Guido van Rossum | 504b0bf | 1999-01-02 21:28:54 +0000 | [diff] [blame] | 11 | |
Guido van Rossum | 35e55da | 1998-10-14 03:43:05 +0000 | [diff] [blame] | 12 | interacting = 0 |
Guido van Rossum | 504b0bf | 1999-01-02 21:28:54 +0000 | [diff] [blame] | 13 | |
Guido van Rossum | 3fb3515 | 1998-10-16 21:09:05 +0000 | [diff] [blame] | 14 | vstack = vsource = vlocals = vglobals = None |
Guido van Rossum | 504b0bf | 1999-01-02 21:28:54 +0000 | [diff] [blame] | 15 | |
Guido van Rossum | 35f7542 | 1998-10-13 23:51:13 +0000 | [diff] [blame] | 16 | def __init__(self, pyshell): |
| 17 | bdb.Bdb.__init__(self) |
| 18 | self.pyshell = pyshell |
| 19 | self.make_gui() |
Guido van Rossum | 504b0bf | 1999-01-02 21:28:54 +0000 | [diff] [blame] | 20 | |
Guido van Rossum | 9016fcf | 1999-01-11 14:46:55 +0000 | [diff] [blame] | 21 | def close(self, event=None): |
Guido van Rossum | 35e55da | 1998-10-14 03:43:05 +0000 | [diff] [blame] | 22 | if self.interacting: |
| 23 | self.top.bell() |
| 24 | return |
| 25 | self.pyshell.close_debugger() |
Guido van Rossum | 35f7542 | 1998-10-13 23:51:13 +0000 | [diff] [blame] | 26 | self.top.destroy() |
Guido van Rossum | 504b0bf | 1999-01-02 21:28:54 +0000 | [diff] [blame] | 27 | |
Guido van Rossum | 35e55da | 1998-10-14 03:43:05 +0000 | [diff] [blame] | 28 | def run(self, *args): |
| 29 | try: |
| 30 | self.interacting = 1 |
| 31 | return apply(bdb.Bdb.run, (self,) + args) |
| 32 | finally: |
| 33 | self.interacting = 0 |
Guido van Rossum | 35f7542 | 1998-10-13 23:51:13 +0000 | [diff] [blame] | 34 | |
| 35 | def user_line(self, frame): |
| 36 | self.interaction(frame) |
| 37 | |
| 38 | def user_return(self, frame, rv): |
| 39 | # XXX show rv? |
Guido van Rossum | b52cfa1 | 1998-10-19 02:24:40 +0000 | [diff] [blame] | 40 | ##self.interaction(frame) |
| 41 | pass |
Guido van Rossum | 35f7542 | 1998-10-13 23:51:13 +0000 | [diff] [blame] | 42 | |
| 43 | def user_exception(self, frame, info): |
| 44 | self.interaction(frame, info) |
Guido van Rossum | 504b0bf | 1999-01-02 21:28:54 +0000 | [diff] [blame] | 45 | |
Guido van Rossum | 35f7542 | 1998-10-13 23:51:13 +0000 | [diff] [blame] | 46 | def make_gui(self): |
| 47 | pyshell = self.pyshell |
| 48 | self.flist = pyshell.flist |
| 49 | self.root = root = pyshell.root |
Guido van Rossum | 504b0bf | 1999-01-02 21:28:54 +0000 | [diff] [blame] | 50 | self.top = top =ListedToplevel(root) |
| 51 | self.top.wm_title("Debug Control") |
| 52 | self.top.wm_iconname("Debug") |
Guido van Rossum | 35e55da | 1998-10-14 03:43:05 +0000 | [diff] [blame] | 53 | top.wm_protocol("WM_DELETE_WINDOW", self.close) |
Guido van Rossum | 9016fcf | 1999-01-11 14:46:55 +0000 | [diff] [blame] | 54 | self.top.bind("<Escape>", self.close) |
Guido van Rossum | 80d132d | 1998-10-16 16:12:11 +0000 | [diff] [blame] | 55 | # |
Guido van Rossum | 35f7542 | 1998-10-13 23:51:13 +0000 | [diff] [blame] | 56 | self.bframe = bframe = Frame(top) |
Guido van Rossum | 35e55da | 1998-10-14 03:43:05 +0000 | [diff] [blame] | 57 | self.bframe.pack(anchor="w") |
Guido van Rossum | 35f7542 | 1998-10-13 23:51:13 +0000 | [diff] [blame] | 58 | self.buttons = bl = [] |
Guido van Rossum | 80d132d | 1998-10-16 16:12:11 +0000 | [diff] [blame] | 59 | # |
Guido van Rossum | 35f7542 | 1998-10-13 23:51:13 +0000 | [diff] [blame] | 60 | self.bcont = b = Button(bframe, text="Go", command=self.cont) |
| 61 | bl.append(b) |
Guido van Rossum | 3fb3515 | 1998-10-16 21:09:05 +0000 | [diff] [blame] | 62 | self.bstep = b = Button(bframe, text="Step", command=self.step) |
Guido van Rossum | 35f7542 | 1998-10-13 23:51:13 +0000 | [diff] [blame] | 63 | bl.append(b) |
Guido van Rossum | 80d132d | 1998-10-16 16:12:11 +0000 | [diff] [blame] | 64 | self.bnext = b = Button(bframe, text="Over", command=self.next) |
Guido van Rossum | 35f7542 | 1998-10-13 23:51:13 +0000 | [diff] [blame] | 65 | bl.append(b) |
Guido van Rossum | 80d132d | 1998-10-16 16:12:11 +0000 | [diff] [blame] | 66 | self.bret = b = Button(bframe, text="Out", command=self.ret) |
Guido van Rossum | 35f7542 | 1998-10-13 23:51:13 +0000 | [diff] [blame] | 67 | bl.append(b) |
Guido van Rossum | 85ef9dc | 1999-01-28 22:00:30 +0000 | [diff] [blame] | 68 | self.bret = b = Button(bframe, text="Quit", command=self.quit) |
| 69 | bl.append(b) |
Guido van Rossum | 80d132d | 1998-10-16 16:12:11 +0000 | [diff] [blame] | 70 | # |
Guido van Rossum | 35f7542 | 1998-10-13 23:51:13 +0000 | [diff] [blame] | 71 | for b in bl: |
| 72 | b.configure(state="disabled") |
| 73 | b.pack(side="left") |
Guido van Rossum | 80d132d | 1998-10-16 16:12:11 +0000 | [diff] [blame] | 74 | # |
| 75 | self.cframe = cframe = Frame(bframe) |
| 76 | self.cframe.pack(side="left") |
| 77 | # |
Guido van Rossum | 3fb3515 | 1998-10-16 21:09:05 +0000 | [diff] [blame] | 78 | if not self.vstack: |
| 79 | self.__class__.vstack = BooleanVar(top) |
| 80 | self.vstack.set(1) |
Guido van Rossum | 80d132d | 1998-10-16 16:12:11 +0000 | [diff] [blame] | 81 | self.bstack = Checkbutton(cframe, |
| 82 | text="Stack", command=self.show_stack, variable=self.vstack) |
| 83 | self.bstack.grid(row=0, column=0) |
Guido van Rossum | 3fb3515 | 1998-10-16 21:09:05 +0000 | [diff] [blame] | 84 | if not self.vsource: |
| 85 | self.__class__.vsource = BooleanVar(top) |
Guido van Rossum | b52cfa1 | 1998-10-19 02:24:40 +0000 | [diff] [blame] | 86 | ##self.vsource.set(1) |
Guido van Rossum | 80d132d | 1998-10-16 16:12:11 +0000 | [diff] [blame] | 87 | self.bsource = Checkbutton(cframe, |
| 88 | text="Source", command=self.show_source, variable=self.vsource) |
Guido van Rossum | 6b38483 | 1998-10-16 17:16:59 +0000 | [diff] [blame] | 89 | self.bsource.grid(row=0, column=1) |
Guido van Rossum | 3fb3515 | 1998-10-16 21:09:05 +0000 | [diff] [blame] | 90 | if not self.vlocals: |
| 91 | self.__class__.vlocals = BooleanVar(top) |
| 92 | self.vlocals.set(1) |
Guido van Rossum | 80d132d | 1998-10-16 16:12:11 +0000 | [diff] [blame] | 93 | self.blocals = Checkbutton(cframe, |
| 94 | text="Locals", command=self.show_locals, variable=self.vlocals) |
| 95 | self.blocals.grid(row=1, column=0) |
Guido van Rossum | 3fb3515 | 1998-10-16 21:09:05 +0000 | [diff] [blame] | 96 | if not self.vglobals: |
| 97 | self.__class__.vglobals = BooleanVar(top) |
Guido van Rossum | b52cfa1 | 1998-10-19 02:24:40 +0000 | [diff] [blame] | 98 | ##self.vglobals.set(1) |
Guido van Rossum | 80d132d | 1998-10-16 16:12:11 +0000 | [diff] [blame] | 99 | self.bglobals = Checkbutton(cframe, |
| 100 | text="Globals", command=self.show_globals, variable=self.vglobals) |
| 101 | self.bglobals.grid(row=1, column=1) |
| 102 | # |
Guido van Rossum | 35e55da | 1998-10-14 03:43:05 +0000 | [diff] [blame] | 103 | self.status = Label(top, anchor="w") |
| 104 | self.status.pack(anchor="w") |
| 105 | self.error = Label(top, anchor="w") |
Guido van Rossum | b52cfa1 | 1998-10-19 02:24:40 +0000 | [diff] [blame] | 106 | self.error.pack(anchor="w", fill="x") |
Guido van Rossum | 3fb3515 | 1998-10-16 21:09:05 +0000 | [diff] [blame] | 107 | self.errorbg = self.error.cget("background") |
Guido van Rossum | 5188a25 | 1998-10-16 18:59:39 +0000 | [diff] [blame] | 108 | # |
| 109 | self.fstack = Frame(top, height=1) |
| 110 | self.fstack.pack(expand=1, fill="both") |
| 111 | self.flocals = Frame(top) |
| 112 | self.flocals.pack(expand=1, fill="both") |
| 113 | self.fglobals = Frame(top, height=1) |
| 114 | self.fglobals.pack(expand=1, fill="both") |
Guido van Rossum | 3fb3515 | 1998-10-16 21:09:05 +0000 | [diff] [blame] | 115 | # |
| 116 | if self.vstack.get(): |
| 117 | self.show_stack() |
| 118 | if self.vlocals.get(): |
| 119 | self.show_locals() |
| 120 | if self.vglobals.get(): |
| 121 | self.show_globals() |
Guido van Rossum | 504b0bf | 1999-01-02 21:28:54 +0000 | [diff] [blame] | 122 | |
Guido van Rossum | 3fb3515 | 1998-10-16 21:09:05 +0000 | [diff] [blame] | 123 | frame = None |
Guido van Rossum | 504b0bf | 1999-01-02 21:28:54 +0000 | [diff] [blame] | 124 | |
Guido van Rossum | 35f7542 | 1998-10-13 23:51:13 +0000 | [diff] [blame] | 125 | def interaction(self, frame, info=None): |
| 126 | self.frame = frame |
| 127 | code = frame.f_code |
| 128 | file = code.co_filename |
Guido van Rossum | 35e55da | 1998-10-14 03:43:05 +0000 | [diff] [blame] | 129 | base = os.path.basename(file) |
Guido van Rossum | 35f7542 | 1998-10-13 23:51:13 +0000 | [diff] [blame] | 130 | lineno = frame.f_lineno |
Guido van Rossum | 3fb3515 | 1998-10-16 21:09:05 +0000 | [diff] [blame] | 131 | # |
Guido van Rossum | b7ffca3 | 1998-10-15 12:18:49 +0000 | [diff] [blame] | 132 | message = "%s:%s" % (base, lineno) |
| 133 | if code.co_name != "?": |
| 134 | message = "%s: %s()" % (message, code.co_name) |
Guido van Rossum | 35e55da | 1998-10-14 03:43:05 +0000 | [diff] [blame] | 135 | self.status.configure(text=message) |
Guido van Rossum | 3fb3515 | 1998-10-16 21:09:05 +0000 | [diff] [blame] | 136 | # |
Guido van Rossum | 35f7542 | 1998-10-13 23:51:13 +0000 | [diff] [blame] | 137 | if info: |
| 138 | type, value, tb = info |
Guido van Rossum | 35e55da | 1998-10-14 03:43:05 +0000 | [diff] [blame] | 139 | try: |
| 140 | m1 = type.__name__ |
| 141 | except AttributeError: |
| 142 | m1 = "%s" % str(type) |
| 143 | if value is not None: |
| 144 | try: |
| 145 | m1 = "%s: %s" % (m1, str(value)) |
| 146 | except: |
| 147 | pass |
Guido van Rossum | 3fb3515 | 1998-10-16 21:09:05 +0000 | [diff] [blame] | 148 | bg = "yellow" |
Guido van Rossum | 35e55da | 1998-10-14 03:43:05 +0000 | [diff] [blame] | 149 | else: |
| 150 | m1 = "" |
Guido van Rossum | 80d132d | 1998-10-16 16:12:11 +0000 | [diff] [blame] | 151 | tb = None |
Guido van Rossum | 3fb3515 | 1998-10-16 21:09:05 +0000 | [diff] [blame] | 152 | bg = self.errorbg |
| 153 | self.error.configure(text=m1, background=bg) |
| 154 | # |
Guido van Rossum | 80d132d | 1998-10-16 16:12:11 +0000 | [diff] [blame] | 155 | sv = self.stackviewer |
| 156 | if sv: |
| 157 | stack, i = self.get_stack(self.frame, tb) |
| 158 | sv.load_stack(stack, i) |
Guido van Rossum | 3fb3515 | 1998-10-16 21:09:05 +0000 | [diff] [blame] | 159 | # |
Guido van Rossum | b52cfa1 | 1998-10-19 02:24:40 +0000 | [diff] [blame] | 160 | self.show_variables(1) |
Guido van Rossum | 3fb3515 | 1998-10-16 21:09:05 +0000 | [diff] [blame] | 161 | # |
Guido van Rossum | 80d132d | 1998-10-16 16:12:11 +0000 | [diff] [blame] | 162 | if self.vsource.get(): |
| 163 | self.sync_source_line() |
Guido van Rossum | 3fb3515 | 1998-10-16 21:09:05 +0000 | [diff] [blame] | 164 | # |
Guido van Rossum | 35f7542 | 1998-10-13 23:51:13 +0000 | [diff] [blame] | 165 | for b in self.buttons: |
| 166 | b.configure(state="normal") |
Guido van Rossum | 3fb3515 | 1998-10-16 21:09:05 +0000 | [diff] [blame] | 167 | # |
Guido van Rossum | 35f7542 | 1998-10-13 23:51:13 +0000 | [diff] [blame] | 168 | self.top.tkraise() |
| 169 | self.root.mainloop() |
Guido van Rossum | 3fb3515 | 1998-10-16 21:09:05 +0000 | [diff] [blame] | 170 | # |
Guido van Rossum | 35f7542 | 1998-10-13 23:51:13 +0000 | [diff] [blame] | 171 | for b in self.buttons: |
| 172 | b.configure(state="disabled") |
| 173 | self.status.configure(text="") |
Guido van Rossum | 3fb3515 | 1998-10-16 21:09:05 +0000 | [diff] [blame] | 174 | self.error.configure(text="", background=self.errorbg) |
Guido van Rossum | 35f7542 | 1998-10-13 23:51:13 +0000 | [diff] [blame] | 175 | self.frame = None |
Guido van Rossum | 504b0bf | 1999-01-02 21:28:54 +0000 | [diff] [blame] | 176 | |
Guido van Rossum | 80d132d | 1998-10-16 16:12:11 +0000 | [diff] [blame] | 177 | def sync_source_line(self): |
| 178 | frame = self.frame |
| 179 | if not frame: |
| 180 | return |
| 181 | code = frame.f_code |
| 182 | file = code.co_filename |
| 183 | lineno = frame.f_lineno |
| 184 | if file[:1] + file[-1:] != "<>" and os.path.exists(file): |
| 185 | edit = self.flist.open(file) |
| 186 | if edit: |
| 187 | edit.gotoline(lineno) |
Guido van Rossum | 504b0bf | 1999-01-02 21:28:54 +0000 | [diff] [blame] | 188 | |
Guido van Rossum | 35f7542 | 1998-10-13 23:51:13 +0000 | [diff] [blame] | 189 | def cont(self): |
| 190 | self.set_continue() |
| 191 | self.root.quit() |
Guido van Rossum | 504b0bf | 1999-01-02 21:28:54 +0000 | [diff] [blame] | 192 | |
Guido van Rossum | 35f7542 | 1998-10-13 23:51:13 +0000 | [diff] [blame] | 193 | def step(self): |
| 194 | self.set_step() |
| 195 | self.root.quit() |
Guido van Rossum | 504b0bf | 1999-01-02 21:28:54 +0000 | [diff] [blame] | 196 | |
Guido van Rossum | 35f7542 | 1998-10-13 23:51:13 +0000 | [diff] [blame] | 197 | def next(self): |
| 198 | self.set_next(self.frame) |
| 199 | self.root.quit() |
Guido van Rossum | 504b0bf | 1999-01-02 21:28:54 +0000 | [diff] [blame] | 200 | |
Guido van Rossum | 35f7542 | 1998-10-13 23:51:13 +0000 | [diff] [blame] | 201 | def ret(self): |
| 202 | self.set_return(self.frame) |
| 203 | self.root.quit() |
Guido van Rossum | 80d132d | 1998-10-16 16:12:11 +0000 | [diff] [blame] | 204 | |
Guido van Rossum | 85ef9dc | 1999-01-28 22:00:30 +0000 | [diff] [blame] | 205 | def quit(self): |
| 206 | self.set_quit() |
| 207 | self.root.quit() |
| 208 | |
Guido van Rossum | 80d132d | 1998-10-16 16:12:11 +0000 | [diff] [blame] | 209 | stackviewer = None |
| 210 | |
| 211 | def show_stack(self): |
| 212 | if not self.stackviewer and self.vstack.get(): |
Guido van Rossum | 80d132d | 1998-10-16 16:12:11 +0000 | [diff] [blame] | 213 | self.stackviewer = sv = StackViewer.StackViewer( |
Guido van Rossum | 5188a25 | 1998-10-16 18:59:39 +0000 | [diff] [blame] | 214 | self.fstack, self.flist, self) |
Guido van Rossum | 80d132d | 1998-10-16 16:12:11 +0000 | [diff] [blame] | 215 | if self.frame: |
Guido van Rossum | 6b38483 | 1998-10-16 17:16:59 +0000 | [diff] [blame] | 216 | stack, i = self.get_stack(self.frame, None) |
| 217 | sv.load_stack(stack, i) |
Guido van Rossum | 80d132d | 1998-10-16 16:12:11 +0000 | [diff] [blame] | 218 | else: |
| 219 | sv = self.stackviewer |
| 220 | if sv and not self.vstack.get(): |
| 221 | self.stackviewer = None |
| 222 | sv.close() |
Guido van Rossum | 5188a25 | 1998-10-16 18:59:39 +0000 | [diff] [blame] | 223 | self.fstack['height'] = 1 |
Guido van Rossum | 504b0bf | 1999-01-02 21:28:54 +0000 | [diff] [blame] | 224 | |
Guido van Rossum | 80d132d | 1998-10-16 16:12:11 +0000 | [diff] [blame] | 225 | def show_source(self): |
| 226 | if self.vsource.get(): |
| 227 | self.sync_source_line() |
| 228 | |
| 229 | def show_frame(self, (frame, lineno)): |
Guido van Rossum | 3fb3515 | 1998-10-16 21:09:05 +0000 | [diff] [blame] | 230 | self.frame = frame |
| 231 | self.show_variables() |
Guido van Rossum | 5188a25 | 1998-10-16 18:59:39 +0000 | [diff] [blame] | 232 | |
| 233 | localsviewer = None |
Guido van Rossum | 3fb3515 | 1998-10-16 21:09:05 +0000 | [diff] [blame] | 234 | globalsviewer = None |
Guido van Rossum | 80d132d | 1998-10-16 16:12:11 +0000 | [diff] [blame] | 235 | |
| 236 | def show_locals(self): |
Guido van Rossum | 5188a25 | 1998-10-16 18:59:39 +0000 | [diff] [blame] | 237 | lv = self.localsviewer |
Guido van Rossum | 3fb3515 | 1998-10-16 21:09:05 +0000 | [diff] [blame] | 238 | if self.vlocals.get(): |
| 239 | if not lv: |
| 240 | self.localsviewer = StackViewer.NamespaceViewer( |
| 241 | self.flocals, "Locals") |
| 242 | else: |
| 243 | if lv: |
| 244 | self.localsviewer = None |
| 245 | lv.close() |
| 246 | self.flocals['height'] = 1 |
| 247 | self.show_variables() |
Guido van Rossum | 5188a25 | 1998-10-16 18:59:39 +0000 | [diff] [blame] | 248 | |
Guido van Rossum | 80d132d | 1998-10-16 16:12:11 +0000 | [diff] [blame] | 249 | def show_globals(self): |
Guido van Rossum | 3fb3515 | 1998-10-16 21:09:05 +0000 | [diff] [blame] | 250 | gv = self.globalsviewer |
| 251 | if self.vglobals.get(): |
| 252 | if not gv: |
| 253 | self.globalsviewer = StackViewer.NamespaceViewer( |
| 254 | self.fglobals, "Globals") |
| 255 | else: |
| 256 | if gv: |
| 257 | self.globalsviewer = None |
| 258 | gv.close() |
| 259 | self.fglobals['height'] = 1 |
| 260 | self.show_variables() |
| 261 | |
Guido van Rossum | b52cfa1 | 1998-10-19 02:24:40 +0000 | [diff] [blame] | 262 | def show_variables(self, force=0): |
Guido van Rossum | 3fb3515 | 1998-10-16 21:09:05 +0000 | [diff] [blame] | 263 | lv = self.localsviewer |
| 264 | gv = self.globalsviewer |
| 265 | frame = self.frame |
| 266 | if not frame: |
| 267 | ldict = gdict = None |
| 268 | else: |
| 269 | ldict = frame.f_locals |
| 270 | gdict = frame.f_globals |
| 271 | if lv and gv and ldict is gdict: |
| 272 | ldict = None |
| 273 | if lv: |
Guido van Rossum | b52cfa1 | 1998-10-19 02:24:40 +0000 | [diff] [blame] | 274 | lv.load_dict(ldict, force) |
Guido van Rossum | 3fb3515 | 1998-10-16 21:09:05 +0000 | [diff] [blame] | 275 | if gv: |
Guido van Rossum | b52cfa1 | 1998-10-19 02:24:40 +0000 | [diff] [blame] | 276 | gv.load_dict(gdict, force) |
| 277 | |
| 278 | def set_breakpoint_here(self, edit): |
| 279 | text = edit.text |
| 280 | filename = edit.io.filename |
| 281 | if not filename: |
| 282 | text.bell() |
| 283 | return |
| 284 | lineno = int(float(text.index("insert"))) |
| 285 | msg = self.set_break(filename, lineno) |
| 286 | if msg: |
| 287 | text.bell() |
| 288 | return |
| 289 | text.tag_add("BREAK", "insert linestart", "insert lineend +1char") |
Guido van Rossum | 504b0bf | 1999-01-02 21:28:54 +0000 | [diff] [blame] | 290 | |
Guido van Rossum | b52cfa1 | 1998-10-19 02:24:40 +0000 | [diff] [blame] | 291 | # A literal copy of Bdb.set_break() without the print statement at the end |
| 292 | def set_break(self, filename, lineno, temporary=0, cond = None): |
Guido van Rossum | 504b0bf | 1999-01-02 21:28:54 +0000 | [diff] [blame] | 293 | import linecache # Import as late as possible |
| 294 | line = linecache.getline(filename, lineno) |
| 295 | if not line: |
| 296 | return 'That line does not exist!' |
| 297 | if not self.breaks.has_key(filename): |
| 298 | self.breaks[filename] = [] |
| 299 | list = self.breaks[filename] |
| 300 | if not lineno in list: |
| 301 | list.append(lineno) |
| 302 | bp = bdb.Breakpoint(filename, lineno, temporary, cond) |