Browse Prior Art Database

Source Position to Instruction Position Disclosure

IP.com Disclosure Number: IPCOM000102136D
Original Publication Date: 1990-Oct-01
Included in the Prior Art Database: 2005-Mar-17
Document File: 4 page(s) / 122K

Publishing Venue

IBM

Related People

Turner, TR: AUTHOR

Abstract

Symbolic debuggers are required to map a source position in a file containing a high-level language program to a corresponding instruction position. An inverse map is also needed. Symbolic debuggers have occasion to translate an instruction position to a corresponding position in the source.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 52% of the total text.

Source Position to Instruction Position Disclosure

       Symbolic debuggers are required to map a source position
in a file containing a high-level language program to a corresponding
instruction position.  An inverse map is also needed.  Symbolic
debuggers have occasion to translate an instruction position to a
corresponding position in the source.

      Two functions, f and g, are required (see equations 1 and 2
shown in Fig. 1):  f maps source position, ps, to instruction
position, pi and g maps instruction position to source position.

      Source position is an offset from the start of a file
containing a high-level language source program. Instruction position
is the address of an instruction produced when the program fragment
identified by the source position was translated.

      The relationship between source position and instruction
position is determined when a program is translated.  Translators
including compilers and assemblers, produce instructions
incrementally.  Fragments of source are translated to one or more
machine instructions.  As the source program is consumed machine
instructions are produced.

      INSIGHT:  There is a roughly linear relationship between source
position and instruction position and a least-squares line can be
used to characterize the relationship.  Now, the least-squares line
only approximates the relationship, but a table, indexed by source
position, can be used to correct the approximate position.

      EXAMPLE:  Suppose, during translation, the table shown in Fig.
2 is produced.  Column one, entitled SP (Source Position), contains
the line numbers of the source that, after translation, produced
machine instructions.  The first source line producing executable
machine instructions is line 40.

      Entries in the second column, entitled IP (Instruction
Position), contains the address of the first machine instruction
produced when the corresponding line in column one was translated.

      Equation 3 (Fig. 1) is for the line estimating instruction
position as a function of source position.

      The equation was produced using the formula for the least
squares line.  Source position line numbers were substituted for
values of xi  and instruction position addresses were used in place
of yi .  M is the slope of the line and b is the y-intercept.
In the example, equations 4 and 5 (Fig....