diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2006-04-18 14:47:00 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2006-04-18 14:47:00 (GMT) |
commit | a4ebc135ac2bbf1f74327dc37a12a4928b871dd8 (patch) | |
tree | e4139d1d0a4701842b997bd70ca7a3a7e605346e /Include | |
parent | 6db67821a157e89ee53d45c78a5da7dab07b8738 (diff) | |
download | cpython-a4ebc135ac2bbf1f74327dc37a12a4928b871dd8.zip cpython-a4ebc135ac2bbf1f74327dc37a12a4928b871dd8.tar.gz cpython-a4ebc135ac2bbf1f74327dc37a12a4928b871dd8.tar.bz2 |
Refactor: Move code that uses co_lnotab from ceval to codeobject
Diffstat (limited to 'Include')
-rw-r--r-- | Include/code.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Include/code.h b/Include/code.h index ba4c6f8..e9b7906 100644 --- a/Include/code.h +++ b/Include/code.h @@ -72,6 +72,21 @@ PyAPI_FUNC(int) PyCode_Addr2Line(PyCodeObject *, int); ((*(co)->co_code->ob_type->tp_as_buffer->bf_getreadbuffer) \ ((co)->co_code, 0, (void **)(pp))) +typedef struct _addr_pair { + int ap_lower; + int ap_upper; +} PyAddrPair; + +/* Check whether lasti (an instruction offset) falls outside bounds + and whether it is a line number that should be traced. Returns + a line number if it should be traced or -1 if the line should not. + + If lasti is not within bounds, updates bounds. +*/ + +PyAPI_FUNC(int) PyCode_CheckLineNumber(PyCodeObject* co, + int lasti, PyAddrPair *bounds); + #ifdef __cplusplus } #endif |