develooper Front page | perl.cvs.parrot | Postings from January 2009

[svn:parrot] r35781 - trunk/compilers/pirc/src

From:
kjs
Date:
January 19, 2009 15:36
Subject:
[svn:parrot] r35781 - trunk/compilers/pirc/src
Message ID:
20090119233603.7DE63CB9AE@x12.develooper.com
Author: kjs
Date: Mon Jan 19 15:36:02 2009
New Revision: 35781

Modified:
   trunk/compilers/pirc/src/bcgen.c
   trunk/compilers/pirc/src/pircompunit.c

Log:
[pirc] fix source lines for debug info.

Modified: trunk/compilers/pirc/src/bcgen.c
==============================================================================
--- trunk/compilers/pirc/src/bcgen.c	(original)
+++ trunk/compilers/pirc/src/bcgen.c	Mon Jan 19 15:36:02 2009
@@ -79,6 +79,7 @@
     opcode_t        *opcursor;       /* for writing ops into the code segment */
     Interp          *interp;         /* parrot interpreter */
     PackFile_Debug  *debug_seg;      /* debug segment */
+    int              instr_counter;
 };
 
 
@@ -394,6 +395,10 @@
     self         = VTABLE_get_pmc_keyed_int(interp, interp->iglobals, IGLOBALS_INTERPRETER);
     add_pmc_const(bc, self);
 
+
+    bc->instr_counter = 0;
+    bc->debug_seg     = NULL;
+
     return bc;
 }
 
@@ -458,7 +463,7 @@
             IMCC_INFO(interp)->debug_seg->base.data[IMCC_INFO(interp)->ins_line++] =
                 (opcode_t)ins->line;
                 */
-    bc->debug_seg->base.data[sourceline] = sourceline;
+    bc->debug_seg->base.data[bc->instr_counter++] = sourceline;
 }
 
 

Modified: trunk/compilers/pirc/src/pircompunit.c
==============================================================================
--- trunk/compilers/pirc/src/pircompunit.c	(original)
+++ trunk/compilers/pirc/src/pircompunit.c	Mon Jan 19 15:36:02 2009
@@ -402,7 +402,9 @@
 
     /* set the PIR source line number */
     instr->sourceline = yypirget_lineno(lexer->yyscanner);
-
+/*
+    fprintf(stderr, "[%4d][%s]\n", instr->sourceline, opname);
+*/
     /*
     fprintf(stderr, "offset of %s is: %d\n", opname, instr->offset);
     */



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About