"jerry gay" <[EMAIL PROTECTED]> wrote:
while debugging partcl, leo asked will for some source comments to
understand where the generated code came from. i thought it should be
possible to walk the chain from the code emitter, and print the
calling sub's filename and line number in PIR.

walking the call chain is possible using a ParrotInterpreter PMC,
however, the Sub PMC isn't able to get file and line info. in order to
do this, the Sub PMC needs two new methods, which i propose we call
'get_file' and 'get_line'.

does this seem appropriate? are these method names acceptable?
Oops. In contrast to what I had said on IRC, this isn't the way to do it, as a sub PMC only exists per sub. What exists per *call* of a sub is a context. You can walk down the context chain using the ParrotInterpreter PMC, but that hands back a struct. We can't have a context PMC yet 'cus we need those weak reference thingies that I needed for .NET register pointers. They don't exist yet - they're half way there though. ;-) So get_file and get_line want to be methods on some context PMC that we don't yet have, if that's all acceptable.

Jerry - sorry for being so brain dead.

Jonathan

Reply via email to