diff options
author | Michael W. Hudson <mwh@python.net> | 2002-08-15 14:59:02 (GMT) |
---|---|---|
committer | Michael W. Hudson <mwh@python.net> | 2002-08-15 14:59:02 (GMT) |
commit | dd32a91cc0c8ba178d7ee5e78c30b6920aff66f4 (patch) | |
tree | 1a2062b54d3445ca788fd63c2bc63984dd85f34a /Doc/lib/libdis.tex | |
parent | add88060c1d1a98c7970e35b326e6a65a17ddf04 (diff) | |
download | cpython-dd32a91cc0c8ba178d7ee5e78c30b6920aff66f4.zip cpython-dd32a91cc0c8ba178d7ee5e78c30b6920aff66f4.tar.gz cpython-dd32a91cc0c8ba178d7ee5e78c30b6920aff66f4.tar.bz2 |
This is my patch
[ 587993 ] SET_LINENO killer
Remove SET_LINENO. Tracing is now supported by inspecting co_lnotab.
Many sundry changes to document and adapt to this change.
Diffstat (limited to 'Doc/lib/libdis.tex')
-rw-r--r-- | Doc/lib/libdis.tex | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/Doc/lib/libdis.tex b/Doc/lib/libdis.tex index 16b692d..567c0ee 100644 --- a/Doc/lib/libdis.tex +++ b/Doc/lib/libdis.tex @@ -23,17 +23,15 @@ the following command can be used to get the disassembly of \begin{verbatim} >>> dis.dis(myfunc) - 0 SET_LINENO 1 - - 3 SET_LINENO 2 - 6 LOAD_GLOBAL 0 (len) - 9 LOAD_FAST 0 (alist) - 12 CALL_FUNCTION 1 - 15 RETURN_VALUE - 16 LOAD_CONST 0 (None) - 19 RETURN_VALUE + 2 0 LOAD_GLOBAL 0 (len) + 3 LOAD_FAST 0 (alist) + 6 CALL_FUNCTION 1 + 9 RETURN_VALUE + 10 RETURN_NONE \end{verbatim} +(The ``2'' is a line number). + The \module{dis} module defines the following functions and constants: \begin{funcdesc}{dis}{\optional{bytesource}} @@ -56,6 +54,7 @@ Disassembles a code object, indicating the last instruction if \var{lasti} was provided. The output is divided in the following columns: \begin{enumerate} +\item the line number, for the first instruction of each line \item the current instruction, indicated as \samp{-->}, \item a labelled instruction, indicated with \samp{>\code{>}}, \item the address of the instruction, @@ -402,6 +401,14 @@ is evaluated, the locals are passed to the class definition. Returns with TOS to the caller of the function. \end{opcodedesc} +\begin{opcodedesc}{RETURN_NONE}{} +Returns \constant{None} to the caller of the function. This opcode is +generated as the last opcode of every function and only then, for +reasons to do with tracing support. See the comments in the function +\cfunction{maybe_call_line_trace} in \file{Python/ceval.c} for the +gory details. \versionadded{2.3}. +\end{opcodedesc} + \begin{opcodedesc}{YIELD_VALUE}{} Pops \code{TOS} and yields it from a generator. \end{opcodedesc} @@ -621,7 +628,7 @@ free variable storage. \end{opcodedesc} \begin{opcodedesc}{SET_LINENO}{lineno} -Sets the current line number to \var{lineno}. +This opcode is obsolete. \end{opcodedesc} \begin{opcodedesc}{RAISE_VARARGS}{argc} |