Author: jonathan
Date: Thu Nov 27 16:19:30 2008
New Revision: 33281

Modified:
   branches/bcanno/docs/pdds/pdd13_bytecode.pod

Log:
[pdd] We are keeping the PIR debug segment, so document it and give it a 
segment ID.

Modified: branches/bcanno/docs/pdds/pdd13_bytecode.pod
==============================================================================
--- branches/bcanno/docs/pdds/pdd13_bytecode.pod        (original)
+++ branches/bcanno/docs/pdds/pdd13_bytecode.pod        Thu Nov 27 16:19:30 2008
@@ -307,9 +307,10 @@
   |        |        |    0x02 - Fixup Segment                                |
   |        |        |    0x03 - Constant Table Segment                       |
   |        |        |    0x04 - Bytecode Segment                             |
-  |        |        |    0x05 - Annotations Segment                          |
-  |        |        |    0x06 - PIC Data Segment                             |
-  |        |        |    0x07 - Dependencies Segment                         |
+  |        |        |    0x05 - PIR Debug Segment                            |
+  |        |        |    0x06 - Annotations Segment                          |
+  |        |        |    0x07 - PIC Data Segment                             |
+  |        |        |    0x08 - Dependencies Segment                         |
   +--------+--------+--------------------------------------------------------+
   | 1      | n      | The name of the segment, as a (NULL terminated) ASCII  |
   |        |        | C string. This must be padded with trailing NULL       |
@@ -511,6 +512,46 @@
   +--------+--------+--------------------------------------------------------+
 
 
+=head3 PIR Debug Segment
+
+This segment stores the filenames and line numbers of PIR code that was
+compiled to bytecode. The segment comes in two parts.
+
+=over 4
+
+=item A list of mappings between offsets in the bytecode and filenames,
+indicating that the bytecode from that point on until the next entry was
+generated from the PIR found in the given filename
+
+=item A list of mappings between instructions in the bytecode and line
+numbers, with one entry per instruction
+
+=back
+
+The segment starts with:
+
+  +--------+--------+--------------------------------------------------------+
+  | Offset | Length | Description                                            |
+  +--------+--------+--------------------------------------------------------+
+  | 1      | 1      | Number of filename mappings that follow.               |
+  |        |        |    n                                                   |
+  +--------+--------+--------------------------------------------------------+
+
+Then come n mappings.
+
+  +--------+--------+--------------------------------------------------------+
+  | Offset | Length | Description                                            |
+  +--------+--------+--------------------------------------------------------+
+  | 0      | 1      | Offset in the bytecode.                                |
+  +--------+--------+--------------------------------------------------------+
+  | 1      | 1      | A string constant holding the filename, stored as an   |
+  |        |        | index into the constants table.                        |
+  +--------+--------+--------------------------------------------------------+
+
+This is followed by the line number for each instruction in the bytecode
+segment.
+
+
 =head3 Annotations Segment
 
 Annotations allow any instruction in the bytecode stream to have zero or more

Reply via email to