[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index] - Subject: Re: C preprocessor style #line support
- From: David Manura <dm.lua@...>
- Date: Sat, 10 Sep 2011 19:31:03 -0400
On Thu, Aug 25, 2011 at 7:18 PM, Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote: >> It seems to have only one filename per Proto. > That's the real problem. Line numbers are not hard. Does your debugger utilize debug.getinfo and debug.traceback? If so, could you replace those functions at run-time with ones that remap the file names? It may go roughly like this: local old_getinfo = debug.getinfo function debug.getinfo(...) ........ local t = old_getinfo(........) if t.source:match'^@.*%.preprocessed$' then <read source file or byte code with specially encoded source/line info in comments or debug info> t.source = translated_source t.currentline = translated_line ...... end ........ return t end