[Python-Dev] seeing off SET_LINENO

Mark Hammond mhammond@skippinet.com.au
Thu, 1 Aug 2002 23:28:59 +1000


[Michael]

> At the moment 'line' is called by the SET_LINENO opcode.  My patch
> changes it to be called when the co_lnotab indicates execution has
> moved onto a different line.
>
> The reason this changes behaviour is that currently a SET_LINENO
> opcode is emitted for the def line of every function (I guess this is
> to cope with
>
> def functions_like_this(): return 1

Right - sorry - my misunderstanding.

> If my patch goes in, I'll probably change pdb to catch 'call' events,
> and nag authors of other debuggers that they should do the same.

Yes, I agree this should not be necessary.  You may even find debugger
implementers already hack around this :)  And yes, I agree that if debugger
implementers really want to hook something on function entry, they should
use the facility explicity designed for that purpose ;)

> It is possible to generate an extra 'line' trace event to mimic the
> old behaviour, but it's gross.

Agreed.

> Now I've spent some minutes explaining myself, you can explain to me
> where you got the idea that I was even considering doing so from!

Sorry, I just didn't re-read the thread well enough.  Jumping to conclusions
seems to be one of my strong points ;)

Mark.