[Python-Dev] sys.settrace does not produce events for C functions (original) (raw)
Guido van Rossum guido at python.org
Sun Jan 21 16:02:10 EST 2018
- Previous message (by thread): [Python-Dev] sys.settrace does not produce events for C functions
- Next message (by thread): [Python-Dev] Slipping Python 3.5.5rc1 and 3.4.8rc1 because of a Travis CI issue--can someone make Travis CI happy?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
As I posted to the issue:
The reason not to pass C calls to the tracing function is that tracing exists to support pdb and other debuggers, and pdb only cares about tracing through Python code. So the docs should be updated.
On Sun, Jan 21, 2018 at 11:40 AM, Pablo Galindo Salgado <pablogsal at gmail.com
wrote:
The docs for sys.settrace mention that:
>> event is a string: 'call', 'line', 'return', 'exception', >> 'ccall', 'creturn', or 'cexception' But in the code for ceval.c the only point where calltrace is invoked with PyTraceCCALL or PyTraceCRETURN is under the CTRACE macro. In this macro this line prevents any function set up using sys.settrace to call calltrace with the mentioned arguments: if (tstate->usetracing && tstate->cprofilefunc) Notice that from the code of PyEvalSetTrace and PyEvalSetProfile, only the later sets tstate->cprofilefunc and therefore only functions installed using sys.setprofile will recieve a ccall for the event. Xiang Zhan has suggested me to ask here what is the best course of action: 1) Document this behavior. 2) Fix the code. This question is related to this issue: https://bugs.python.org/issue17799 Thanks everyone for your time! Pablo
Python-Dev mailing list Python-Dev at python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/ guido%40python.org
-- --Guido van Rossum (python.org/~guido) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20180121/3114d417/attachment.html>
- Previous message (by thread): [Python-Dev] sys.settrace does not produce events for C functions
- Next message (by thread): [Python-Dev] Slipping Python 3.5.5rc1 and 3.4.8rc1 because of a Travis CI issue--can someone make Travis CI happy?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]