[svn:parrot] r35781 - trunk/compilers/pirc/src
[email protected] Mon, 19 Jan 2009 15:36:03 -0800 (PST)
| Newsgroups | perl.cvs.parrot |
|---|---|
| Message-ID | <[email protected]> |
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);
*/