Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions
idlelib.Debugger.Debugger Class Reference

List of all members.

Public Member Functions

def __init__
def run
def close
def make_gui
def interaction
def sync_source_line
def cont
def step
def next
def ret
def quit
def show_stack
def show_source
def show_frame
def show_locals
def show_globals
def show_variables
def set_breakpoint_here
def clear_breakpoint_here
def clear_file_breaks
def load_breakpoints

Public Attributes

 pyshell
 idb
 frame
 interacting
 flist
 root
 top
 bframe
 buttons
 bcont
 bstep
 bnext
 bret
 cframe
 bstack
 bsource
 blocals
 bglobals
 status
 error
 errorbg
 fstack
 flocals
 fglobals

Static Public Attributes

 vstack = vsourcevlocalsvglobalsNone
 stackviewer = None
 localsviewer = None
 globalsviewer = None

Private Member Functions

def __frame2fileline

Detailed Description

Definition at line 51 of file Debugger.py.


Constructor & Destructor Documentation

def idlelib.Debugger.Debugger.__init__ (   self,
  pyshell,
  idb = None 
)

Definition at line 55 of file Debugger.py.

00055 
00056     def __init__(self, pyshell, idb=None):
00057         if idb is None:
00058             idb = Idb(self)
00059         self.pyshell = pyshell
00060         self.idb = idb
00061         self.frame = None
00062         self.make_gui()
00063         self.interacting = 0

Here is the caller graph for this function:


Member Function Documentation

def idlelib.Debugger.Debugger.__frame2fileline (   self,
  frame 
) [private]

Definition at line 211 of file Debugger.py.

00211 
00212     def __frame2fileline(self, frame):
00213         code = frame.f_code
00214         filename = code.co_filename
00215         lineno = frame.f_lineno
00216         return filename, lineno

Here is the caller graph for this function:

def idlelib.Debugger.Debugger.clear_breakpoint_here (   self,
  filename,
  lineno 
)

Definition at line 307 of file Debugger.py.

00307 
00308     def clear_breakpoint_here(self, filename, lineno):
00309         self.idb.clear_break(filename, lineno)

def idlelib.Debugger.Debugger.clear_file_breaks (   self,
  filename 
)

Definition at line 310 of file Debugger.py.

00310 
00311     def clear_file_breaks(self, filename):
00312         self.idb.clear_all_file_breaks(filename)

Here is the caller graph for this function:

def idlelib.Debugger.Debugger.close (   self,
  event = None 
)

Definition at line 71 of file Debugger.py.

00071 
00072     def close(self, event=None):
00073         if self.interacting:
00074             self.top.bell()
00075             return
00076         if self.stackviewer:
00077             self.stackviewer.close(); self.stackviewer = None
00078         # Clean up pyshell if user clicked debugger control close widget.
00079         # (Causes a harmless extra cycle through close_debugger() if user
00080         # toggled debugger from pyshell Debug menu)
00081         self.pyshell.close_debugger()
00082         # Now close the debugger control window....
00083         self.top.destroy()

Here is the caller graph for this function:

Definition at line 217 of file Debugger.py.

00217 
00218     def cont(self):
00219         self.idb.set_continue()
00220         self.root.quit()

def idlelib.Debugger.Debugger.interaction (   self,
  message,
  frame,
  info = None 
)

Definition at line 159 of file Debugger.py.

00159 
00160     def interaction(self, message, frame, info=None):
00161         self.frame = frame
00162         self.status.configure(text=message)
00163         #
00164         if info:
00165             type, value, tb = info
00166             try:
00167                 m1 = type.__name__
00168             except AttributeError:
00169                 m1 = "%s" % str(type)
00170             if value is not None:
00171                 try:
00172                     m1 = "%s: %s" % (m1, str(value))
00173                 except:
00174                     pass
00175             bg = "yellow"
00176         else:
00177             m1 = ""
00178             tb = None
00179             bg = self.errorbg
00180         self.error.configure(text=m1, background=bg)
00181         #
00182         sv = self.stackviewer
00183         if sv:
00184             stack, i = self.idb.get_stack(self.frame, tb)
00185             sv.load_stack(stack, i)
00186         #
00187         self.show_variables(1)
00188         #
00189         if self.vsource.get():
00190             self.sync_source_line()
00191         #
00192         for b in self.buttons:
00193             b.configure(state="normal")
00194         #
00195         self.top.wakeup()
00196         self.root.mainloop()
00197         #
00198         for b in self.buttons:
00199             b.configure(state="disabled")
00200         self.status.configure(text="")
00201         self.error.configure(text="", background=self.errorbg)
00202         self.frame = None

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 313 of file Debugger.py.

00313 
00314     def load_breakpoints(self):
00315         "Load PyShellEditorWindow breakpoints into subprocess debugger"
00316         for editwin in self.pyshell.flist.inversedict:
00317             filename = editwin.io.filename
00318             try:
00319                 for lineno in editwin.breakpoints:
00320                     self.set_breakpoint_here(filename, lineno)
00321             except AttributeError:
00322                 continue

Here is the call graph for this function:

Definition at line 84 of file Debugger.py.

00084 
00085     def make_gui(self):
00086         pyshell = self.pyshell
00087         self.flist = pyshell.flist
00088         self.root = root = pyshell.root
00089         self.top = top = ListedToplevel(root)
00090         self.top.wm_title("Debug Control")
00091         self.top.wm_iconname("Debug")
00092         top.wm_protocol("WM_DELETE_WINDOW", self.close)
00093         self.top.bind("<Escape>", self.close)
00094         #
00095         self.bframe = bframe = Frame(top)
00096         self.bframe.pack(anchor="w")
00097         self.buttons = bl = []
00098         #
00099         self.bcont = b = Button(bframe, text="Go", command=self.cont)
00100         bl.append(b)
00101         self.bstep = b = Button(bframe, text="Step", command=self.step)
00102         bl.append(b)
00103         self.bnext = b = Button(bframe, text="Over", command=self.next)
00104         bl.append(b)
00105         self.bret = b = Button(bframe, text="Out", command=self.ret)
00106         bl.append(b)
00107         self.bret = b = Button(bframe, text="Quit", command=self.quit)
00108         bl.append(b)
00109         #
00110         for b in bl:
00111             b.configure(state="disabled")
00112             b.pack(side="left")
00113         #
00114         self.cframe = cframe = Frame(bframe)
00115         self.cframe.pack(side="left")
00116         #
00117         if not self.vstack:
00118             self.__class__.vstack = BooleanVar(top)
00119             self.vstack.set(1)
00120         self.bstack = Checkbutton(cframe,
00121             text="Stack", command=self.show_stack, variable=self.vstack)
00122         self.bstack.grid(row=0, column=0)
00123         if not self.vsource:
00124             self.__class__.vsource = BooleanVar(top)
00125         self.bsource = Checkbutton(cframe,
00126             text="Source", command=self.show_source, variable=self.vsource)
00127         self.bsource.grid(row=0, column=1)
00128         if not self.vlocals:
00129             self.__class__.vlocals = BooleanVar(top)
00130             self.vlocals.set(1)
00131         self.blocals = Checkbutton(cframe,
00132             text="Locals", command=self.show_locals, variable=self.vlocals)
00133         self.blocals.grid(row=1, column=0)
00134         if not self.vglobals:
00135             self.__class__.vglobals = BooleanVar(top)
00136         self.bglobals = Checkbutton(cframe,
00137             text="Globals", command=self.show_globals, variable=self.vglobals)
00138         self.bglobals.grid(row=1, column=1)
00139         #
00140         self.status = Label(top, anchor="w")
00141         self.status.pack(anchor="w")
00142         self.error = Label(top, anchor="w")
00143         self.error.pack(anchor="w", fill="x")
00144         self.errorbg = self.error.cget("background")
00145         #
00146         self.fstack = Frame(top, height=1)
00147         self.fstack.pack(expand=1, fill="both")
00148         self.flocals = Frame(top)
00149         self.flocals.pack(expand=1, fill="both")
00150         self.fglobals = Frame(top, height=1)
00151         self.fglobals.pack(expand=1, fill="both")
00152         #
00153         if self.vstack.get():
00154             self.show_stack()
00155         if self.vlocals.get():
00156             self.show_locals()
00157         if self.vglobals.get():
00158             self.show_globals()

Definition at line 225 of file Debugger.py.

00225 
00226     def next(self):
00227         self.idb.set_next(self.frame)
00228         self.root.quit()

Here is the caller graph for this function:

Definition at line 233 of file Debugger.py.

00233 
00234     def quit(self):
00235         self.idb.set_quit()
00236         self.root.quit()

Here is the caller graph for this function:

Definition at line 229 of file Debugger.py.

00229 
00230     def ret(self):
00231         self.idb.set_return(self.frame)
00232         self.root.quit()

def idlelib.Debugger.Debugger.run (   self,
  args 
)

Definition at line 64 of file Debugger.py.

00064 
00065     def run(self, *args):
00066         try:
00067             self.interacting = 1
00068             return self.idb.run(*args)
00069         finally:
00070             self.interacting = 0

Here is the caller graph for this function:

def idlelib.Debugger.Debugger.set_breakpoint_here (   self,
  filename,
  lineno 
)

Definition at line 304 of file Debugger.py.

00304 
00305     def set_breakpoint_here(self, filename, lineno):
00306         self.idb.set_break(filename, lineno)

Here is the caller graph for this function:

def idlelib.Debugger.Debugger.show_frame (   self,
  stackitem 
)

Definition at line 256 of file Debugger.py.

00256 
00257     def show_frame(self, stackitem):
00258         frame, lineno = stackitem
00259         self.frame = frame
00260         self.show_variables()

Here is the call graph for this function:

Definition at line 276 of file Debugger.py.

00276 
00277     def show_globals(self):
00278         gv = self.globalsviewer
00279         if self.vglobals.get():
00280             if not gv:
00281                 self.globalsviewer = NamespaceViewer(self.fglobals, "Globals")
00282         else:
00283             if gv:
00284                 self.globalsviewer = None
00285                 gv.close()
00286                 self.fglobals['height'] = 1
00287         self.show_variables()

Here is the call graph for this function:

Definition at line 264 of file Debugger.py.

00264 
00265     def show_locals(self):
00266         lv = self.localsviewer
00267         if self.vlocals.get():
00268             if not lv:
00269                 self.localsviewer = NamespaceViewer(self.flocals, "Locals")
00270         else:
00271             if lv:
00272                 self.localsviewer = None
00273                 lv.close()
00274                 self.flocals['height'] = 1
00275         self.show_variables()

Here is the call graph for this function:

Definition at line 252 of file Debugger.py.

00252 
00253     def show_source(self):
00254         if self.vsource.get():
00255             self.sync_source_line()

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 239 of file Debugger.py.

00239 
00240     def show_stack(self):
00241         if not self.stackviewer and self.vstack.get():
00242             self.stackviewer = sv = StackViewer(self.fstack, self.flist, self)
00243             if self.frame:
00244                 stack, i = self.idb.get_stack(self.frame, None)
00245                 sv.load_stack(stack, i)
00246         else:
00247             sv = self.stackviewer
00248             if sv and not self.vstack.get():
00249                 self.stackviewer = None
00250                 sv.close()
00251             self.fstack['height'] = 1

def idlelib.Debugger.Debugger.show_variables (   self,
  force = 0 
)

Definition at line 288 of file Debugger.py.

00288 
00289     def show_variables(self, force=0):
00290         lv = self.localsviewer
00291         gv = self.globalsviewer
00292         frame = self.frame
00293         if not frame:
00294             ldict = gdict = None
00295         else:
00296             ldict = frame.f_locals
00297             gdict = frame.f_globals
00298             if lv and gv and ldict is gdict:
00299                 ldict = None
00300         if lv:
00301             lv.load_dict(ldict, force, self.pyshell.interp.rpcclt)
00302         if gv:
00303             gv.load_dict(gdict, force, self.pyshell.interp.rpcclt)

Here is the caller graph for this function:

Definition at line 221 of file Debugger.py.

00221 
00222     def step(self):
00223         self.idb.set_step()
00224         self.root.quit()

Definition at line 203 of file Debugger.py.

00203 
00204     def sync_source_line(self):
00205         frame = self.frame
00206         if not frame:
00207             return
00208         filename, lineno = self.__frame2fileline(frame)
00209         if filename[:1] + filename[-1:] != "<>" and os.path.exists(filename):
00210             self.flist.gotofileline(filename, lineno)

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 98 of file Debugger.py.

Definition at line 94 of file Debugger.py.

Definition at line 135 of file Debugger.py.

Definition at line 130 of file Debugger.py.

Definition at line 102 of file Debugger.py.

Definition at line 104 of file Debugger.py.

Definition at line 124 of file Debugger.py.

Definition at line 119 of file Debugger.py.

Definition at line 100 of file Debugger.py.

Definition at line 96 of file Debugger.py.

Definition at line 113 of file Debugger.py.

Definition at line 141 of file Debugger.py.

Definition at line 143 of file Debugger.py.

Definition at line 149 of file Debugger.py.

Definition at line 86 of file Debugger.py.

Definition at line 147 of file Debugger.py.

Definition at line 60 of file Debugger.py.

Definition at line 145 of file Debugger.py.

Definition at line 262 of file Debugger.py.

Definition at line 59 of file Debugger.py.

Definition at line 62 of file Debugger.py.

Definition at line 261 of file Debugger.py.

Definition at line 58 of file Debugger.py.

Definition at line 87 of file Debugger.py.

Definition at line 237 of file Debugger.py.

Definition at line 139 of file Debugger.py.

Definition at line 88 of file Debugger.py.

idlelib.Debugger.Debugger.vstack = vsourcevlocalsvglobalsNone [static]

Definition at line 53 of file Debugger.py.


The documentation for this class was generated from the following file: