diff options
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/lib/libpdb.tex | 12 | ||||
-rw-r--r-- | Doc/ref/ref3.tex | 12 | ||||
-rw-r--r-- | Doc/whatsnew/whatsnew23.tex | 10 |
3 files changed, 24 insertions, 10 deletions
diff --git a/Doc/lib/libpdb.tex b/Doc/lib/libpdb.tex index f8417b8..bf779fe 100644 --- a/Doc/lib/libpdb.tex +++ b/Doc/lib/libpdb.tex @@ -255,6 +255,16 @@ Continue execution until the current function returns. Continue execution, only stop when a breakpoint is encountered. +\item[j(ump) \var{lineno}] + +Set the next line that will be executed. Only available in the +bottom-most frame. This lets you jump back and execute code +again, or jump forward to skip code that you don't want to run. + +It should be noted that not all jumps are allowed -- for instance it +it not possible to jump into the middle of a for loop or out of a +finally clause. + \item[l(ist) \optional{\var{first\optional{, last}}}] List source code for the current file. Without arguments, list 11 @@ -303,7 +313,7 @@ alias pi for k in %1.__dict__.keys(): print "%1.",k,"=",%1.__dict__[k] #Print instance variables in self alias ps pi self \end{verbatim} - + \item[unalias \var{name}] Deletes the specified alias. diff --git a/Doc/ref/ref3.tex b/Doc/ref/ref3.tex index eb1d658..605ed55 100644 --- a/Doc/ref/ref3.tex +++ b/Doc/ref/ref3.tex @@ -812,8 +812,7 @@ frame; \member{f_locals} is the dictionary used to look up local variables; \member{f_globals} is used for global variables; \member{f_builtins} is used for built-in (intrinsic) names; \member{f_restricted} is a flag indicating whether the function is -executing in restricted execution mode; -\member{f_lineno} gives the line number and \member{f_lasti} gives the +executing in restricted execution mode; \member{f_lasti} gives the precise instruction (this is an index into the bytecode string of the code object). \withsubitem{(frame attribute)}{ @@ -821,7 +820,6 @@ the code object). \ttindex{f_code} \ttindex{f_globals} \ttindex{f_locals} - \ttindex{f_lineno} \ttindex{f_lasti} \ttindex{f_builtins} \ttindex{f_restricted}} @@ -830,12 +828,16 @@ Special writable attributes: \member{f_trace}, if not \code{None}, is a function called at the start of each source code line (this is used by the debugger); \member{f_exc_type}, \member{f_exc_value}, \member{f_exc_traceback} represent the most recent exception caught in -this frame. +this frame; \member{f_lineno} is the current line number of the frame +--- writing to this from within a trace function jumps to the given line +(only for the bottom-most frame). A debugger can implement a Jump +command (aka Set Next Statement) by writing to f_lineno. \withsubitem{(frame attribute)}{ \ttindex{f_trace} \ttindex{f_exc_type} \ttindex{f_exc_value} - \ttindex{f_exc_traceback}} + \ttindex{f_exc_traceback} + \ttindex{f_lineno}} \item[Traceback objects] \label{traceback} Traceback objects represent a stack trace of an exception. A diff --git a/Doc/whatsnew/whatsnew23.tex b/Doc/whatsnew/whatsnew23.tex index 39b7c70..ee8d644 100644 --- a/Doc/whatsnew/whatsnew23.tex +++ b/Doc/whatsnew/whatsnew23.tex @@ -12,6 +12,8 @@ % MacOS framework-related changes (section of its own, probably) +% the new set-next-statement functionality of pdb (SF #643835) + %\section{Introduction \label{intro}} {\large This article is a draft, and is currently up to date for some @@ -1201,13 +1203,13 @@ For example: \begin{verbatim} >>> days = ['Mo', 'Tu', 'We', 'Th', 'Fr', 'St', 'Sn'] ->>> random.sample(days, 3) # Choose 3 elements +>>> random.sample(days, 3) # Choose 3 elements ['St', 'Sn', 'Th'] ->>> random.sample(days, 7) # Choose 7 elements +>>> random.sample(days, 7) # Choose 7 elements ['Tu', 'Th', 'Mo', 'We', 'St', 'Fr', 'Sn'] ->>> random.sample(days, 7) # Choose 7 again +>>> random.sample(days, 7) # Choose 7 again ['We', 'Mo', 'Sn', 'Fr', 'Tu', 'St', 'Th'] ->>> random.sample(days, 8) # Can't choose eight +>>> random.sample(days, 8) # Can't choose eight Traceback (most recent call last): File "<stdin>", line 1, in ? File "random.py", line 414, in sample |