On 11/14/05, Nick Glencross <[EMAIL PROTECTED]> wrote:
> Jonathan Worthington wrote:
>
> > I'm looking to work
> > on enabling Parrot to store away HLL debug info - that is, the file name,
> > line number, columns etc in the high level language source code.  This data
> > can then be used to emit useful error messages that relate to the HLL source
> > code rather than the generated PIR/PASM/whatever.
>
> Does it make sense to have nestable structures?
>
> e.g.
>
>   @push HLL "perl"
>
>   @push file "something.pl"
>   @push line 1
>   @push column 17
>       ...
>   @pop column
>   @pop line
>
>   @push line 2
>       ...
>   @push file "inlined.pl"
>   @push line 34
>       ...
>   @pop line
>   @pop file
>       ...
>   @pop line
>
>   @push line 4
>   @push pragma xyz
>       ...
>   @pop pragma
>   @pop line
>   @pop file
>
>   @pop HLL
>
> Ok, ok, the syntax itself isn't important. I'm just doing nesting.

Actually the example notation looks quite different from what other
people are suggesting, so let me rephrase it as:

   .hll_debug_begin HLL "perl5"
   .hll_debug_begin copyright "Fred"

   .hll_debug_begin file "something.pl"
   .hll_debug_begin line 1
   .hll_debug_begin column 17
       ...
   .hll_debug_end column
   .hll_debug_end line

   .hll_debug_begin line 2
       ...
   .hll_debug_begin file "inlined.pl"
   .hll_debug_begin copyright "Jim"
   .hll_debug_begin line 34
       ...
   .hll_debug_end line
   .hll_debug_end copyright
   .hll_debug_end file
       ...
   .hll_debug_end line

   .hll_debug_begin line 4
   .hll_debug_begin pragma xyz
       ...
   .hll_debug_end pragma
   .hll_debug_end line
   .hll_debug_end file

   .hll_debug_end copyright
   .hll_debug_end HLL

It's perhaps not clear that these are sprinkled among a large number
of PIR instructions, even though it might look like this is the
majority of the code.

Another addition to what I suggested before is that the info section
could have a table of contents with entry points where the attribute
stack is empty. That way, instead of always starting from the begging,
the most appropriate entry point can be easily located.

Just some thoughts.

Cheers,

Nick

Reply via email to