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

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

From:
kjs
Date:
January 19, 2009 15:44
Subject:
[svn:parrot] r35782 - trunk/compilers/pirc/src
Message ID:
20090119234359.3B9F4CB9AE@x12.develooper.com
Author: kjs
Date: Mon Jan 19 15:43:58 2009
New Revision: 35782

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

Log:
[pirc] Eh. debug linenrs are /not/ fixed yet, but the problem is identified. + add some comments. Will fix Another Day.

Modified: trunk/compilers/pirc/src/bcgen.c
==============================================================================
--- trunk/compilers/pirc/src/bcgen.c	(original)
+++ trunk/compilers/pirc/src/bcgen.c	Mon Jan 19 15:43:58 2009
@@ -395,7 +395,7 @@
     self         = VTABLE_get_pmc_keyed_int(interp, interp->iglobals, IGLOBALS_INTERPRETER);
     add_pmc_const(bc, self);
 
-
+    /* initialize debug-segment fields */
     bc->instr_counter = 0;
     bc->debug_seg     = NULL;
 
@@ -419,7 +419,7 @@
     /* allocate enough space. XXX I *think* bytes is /always/ codesize * 4. */
     bc->interp->code->base.data = (opcode_t *)mem_sys_realloc(bc->interp->code->base.data,
                                                               codesize * 4);
-
+    /* store the size of the code-segment */
     bc->interp->code->base.size = codesize;
 
     /* initialize the cursor to write opcodes into the code segment */
@@ -429,20 +429,19 @@
 /*
 
 =item C<void
-create_debugsegment(bytecode * const bc, size_t size)>
+create_debugsegment(bytecode * const bc, size_t size, int sourceline, char const * const file)>
 
-Create a debug segment of size C<size>
+Create a debug segment of size C<size>.
 
 =cut
 
 */
 void
-create_debugsegment(bytecode * const bc, size_t size, int sourceline, char const * const sourcefile)
-{
+create_debugsegment(bytecode * const bc, size_t size, int sourceline, char const * const file) {
     bc->debug_seg = Parrot_new_debug_seg(bc->interp, bc->interp->code, size);
 
     /* XXX why is the +1 needed? FIX! */
-    Parrot_debug_add_mapping(bc->interp, bc->debug_seg, sourceline + 1, sourcefile);
+    Parrot_debug_add_mapping(bc->interp, bc->debug_seg, sourceline + 1, file);
 }
 
 /*
@@ -450,19 +449,13 @@
 =item C<void
 emit_debug_info(bytecode * const bc, int sourceline)>
 
-Emit debug information.
-XXX
+Emit the C<sourceline> number in the debug segment.
 
 =cut
 
 */
 void
 emit_debug_info(bytecode * const bc, int sourceline) {
-    /*
-if (IMCC_INFO(interp)->debug_seg)
-            IMCC_INFO(interp)->debug_seg->base.data[IMCC_INFO(interp)->ins_line++] =
-                (opcode_t)ins->line;
-                */
     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:43:58 2009
@@ -401,7 +401,9 @@
     instr->offset = lexer->codesize;
 
     /* set the PIR source line number */
+    /* XXX yypirget_lineno returns the wrong line no :-( FIX! */
     instr->sourceline = yypirget_lineno(lexer->yyscanner);
+
 /*
     fprintf(stderr, "[%4d][%s]\n", instr->sourceline, opname);
 */



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