This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gwk
Recipients ammar2, gwk, vstinner, xdegaye
Date 2017-02-06.17:19:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1486401562.24.0.702016933295.issue29400@psf.upfronthosting.co.za>
In-reply-to
Content
Attached is a new patch, which does not settrace/gettrace and instead offers new settraceinst/gettraceinst per Victor's recommendation.

I did not implement the proposed behavior of raising an exception if the old APIs are used when the inst_tracing flag is set. However I do think it makes sense to do so.

The new sys.settraceinst function takes two arguments: a function and an integer flag that is currently interpreted as a boolean (whether or not to enable instruction level tracing).

I did it this way because I would like to consider adding a third mode, which would only trigger tracing for interesting control-flow events, namely steps for which the previous instruction was a branch. The motivation is that I expect per-instruction tracing to be very slow, and for the code coverage use case at least, these are the interesting events. For this to be useful, a (prev_offset, current_offset) pair would need to be passed as to the trace callback. I am not sure if this would be useful to other applications, e.g. pdb.
History
Date User Action Args
2017-02-06 17:19:22gwksetrecipients: + gwk, vstinner, xdegaye, ammar2
2017-02-06 17:19:22gwksetmessageid: <1486401562.24.0.702016933295.issue29400@psf.upfronthosting.co.za>
2017-02-06 17:19:22gwklinkissue29400 messages
2017-02-06 17:19:22gwkcreate