[Python-Dev] Why do we need Traceback Objects?

Jeremy Hylton jeremy@cnri.reston.va.us
Thu, 6 Apr 2000 17:29:13 -0400 (EDT)


  >> Vladimir Marangozov wrote:
  >> This reminds me that some time ago I made an experimental patch
  >> for removing SET_LINENO. There was the problem of generating
  >> callbacks for pdb (which I think I solved somehow but I don't
  >> remember the details). I do remember that I had to look at pdb
  >> again for some reason. Is there any interest in reviving this
  >> idea?

I think the details are important.  The only thing the SET_LINENO
opcode does is to call a trace function if one is installed.  It's
necessary to have some way to invoke the trace function when the line
number changes (or it will be relatively difficult to execute code
line-by-line in the debugger <wink>).

Off the top of my head, the only other way I see to invoke the trace
function would be to add code at the head of the mainloop that
computed the line number for each instruction (from lnotab) and called
the trace function if the current line number is different than the
previous time through the loop.  That doesn't sound faster or simpler.

Jeremy