Message287157
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. |
|
Date |
User |
Action |
Args |
2017-02-06 17:19:22 | gwk | set | recipients:
+ gwk, vstinner, xdegaye, ammar2 |
2017-02-06 17:19:22 | gwk | set | messageid: <1486401562.24.0.702016933295.issue29400@psf.upfronthosting.co.za> |
2017-02-06 17:19:22 | gwk | link | issue29400 messages |
2017-02-06 17:19:22 | gwk | create | |
|