Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

#line directives from PMC file should now work

6 views
Skip to first unread message

Nicholas Clark

unread,
Nov 11, 2004, 9:21:18 AM11/11/04
to perl6-i...@perl.org
I believe that I've now fixed all the bugs and made pmc2c2.pl emit accurate
#line directives in the C source files it generates. This means that C errors
in PMC files under development will be reported by the C compiler as being at
the correct line in the source PMC file, rather than the pseudo-random line
in the auto-generated C file. This should help anyone writing PMCs

Builds pass with the --no-lines option in Makefile removed. Should this
be removed from the template Makefile so that all builds now use #line
directives?

Nicholas Clark

Leopold Toetsch

unread,
Nov 11, 2004, 9:53:19 AM11/11/04
to Nicholas Clark, perl6-i...@perl.org
Nicholas Clark <ni...@ccl4.org> wrote:
> I believe that I've now fixed all the bugs and made pmc2c2.pl emit accurate
> #line directives in the C source files it generates.

Great, thanks a lot.

> Builds pass with the --no-lines option in Makefile removed. Should this
> be removed from the template Makefile so that all builds now use #line
> directives?

Yep. Is there still that %ENV var around to turn line numbers off? - Or
was that in ops2c.pl - PARROT_NO_LINE is it, could be handy sometimes.

> Nicholas Clark

leo

Jeff Clites

unread,
Nov 11, 2004, 12:13:27 PM11/11/04
to Nicholas Clark, Leopold Toetsch, Perl 6 Internals List
On Nov 11, 2004, at 6:53 AM, Leopold Toetsch wrote:

> Nicholas Clark <ni...@ccl4.org> wrote:
>
>> Builds pass with the --no-lines option in Makefile removed. Should
>> this
>> be removed from the template Makefile so that all builds now use #line
>> directives?
>
> Yep. Is there still that %ENV var around to turn line numbers off? - Or
> was that in ops2c.pl - PARROT_NO_LINE is it, could be handy sometimes.

I'd really like a way to turn them off easily (for the ops as well,
actually). I find them to be counterproductive (for our stuff), since
what gets shown in the debugger isn't stuff you can actually get gdb to
evaluate.

JEff

Leopold Toetsch

unread,
Nov 11, 2004, 2:12:52 PM11/11/04
to Jeff Clites, perl6-i...@perl.org
Jeff Clites <jcl...@mac.com> wrote:

> I'd really like a way to turn them off easily (for the ops as well,
> actually). I find them to be counterproductive (for our stuff), since
> what gets shown in the debugger isn't stuff you can actually get gdb to
> evaluate.

It depends. While hacking PMC files its much more useful to have the gcc
error line within the pmc files. Debugging ops is sometimes more
intuitive, if you see the corresponding .c file in the debugger, but not
always.

Anyway, as $ENV{PARROT_NO_LINE} is already in ops2c.pl, it should be
present in all build tools.

> JEff

leo

Jeff Clites

unread,
Nov 11, 2004, 10:37:25 PM11/11/04
to l...@toetsch.at, perl6-i...@perl.org
On Nov 11, 2004, at 11:12 AM, Leopold Toetsch wrote:

> Jeff Clites <jcl...@mac.com> wrote:
>
>> I'd really like a way to turn them off easily (for the ops as well,
>> actually). I find them to be counterproductive (for our stuff), since
>> what gets shown in the debugger isn't stuff you can actually get gdb
>> to
>> evaluate.
>
> It depends. While hacking PMC files its much more useful to have the
> gcc
> error line within the pmc files. Debugging ops is sometimes more
> intuitive, if you see the corresponding .c file in the debugger, but
> not
> always.

Sure--definitely depends on what you're doing. For me, I'm often
debugging a JIT problem, and when I end up in a normal-op call I need
to be able to examine the environment (registers, subsequent ops).

> Anyway, as $ENV{PARROT_NO_LINE} is already in ops2c.pl, it should be
> present in all build tools.

Or maybe also CLI options to the tools, so at least you can hand-modify
the Makefile to easily turn off some, and leave on other. Having a
Configure.pl parameter is also more consistent with everything else we
do, compared to an env. variable.

JEff

0 new messages