public void CalcPagePosition(IOItem item, out long pos, out long len)
        {
            pos = item.Position / kPageSize;
            len = (item.Position + item.Length + (kPageSize - 1)) / kPageSize - pos;

            if (len == 0)
                len = 1;
        }
        public static void Output(TextWriter writer, IOItem item)
        {
            string typestring;

            if (item.FDType == FDType.File)
                typestring = "";
            else
                typestring = "<" + item.FDType.FDTypeToString() + ">";

            writer.WriteLine("{6,-6} {5,-8} at {4,-9} of Pid={1} FD={2}{3}: {0}",
                item.Filename, item.Pid, item.FDNum, typestring,
                item.Position, item.Length,
                item.Routine.AccessRoutineToString());
        }
        public override void PhaseTwo(IOItem item)
        {
            if (item.FDType == FDType.File &&
                (allowPIDs == null || allowPIDs.Contains(item.Pid)))
            {
                long pos, len;
                CalcPagePosition(item, out pos, out len);

                writer.Write("{0}\t{1}\t{2}\t# ",
                    pos + fileStarts[item.Filename], len,
                    (item.Access & AccessType.Write) == 0 ? 0 : 1);
            }
            else
            {
                writer.Write("\t\t\t# ");
            }

            IOItemDirectlyToWriter.Output(writer, item);
        }
        public override void PhaseOne(IOItem item)
        {
            nlines++;

            long pos, len;
            CalcPagePosition(item, out pos, out len);

            int maxpage = 0, npages = (int)(pos + len);
            filePages.TryGetValue(item.Filename, out maxpage);

            if (npages > maxpage)
                filePages[item.Filename] = npages;
        }
 public override void PhaseTwo(IOItem item)
 {
     Output(writer, item);
 }
 public override void PhaseOne(IOItem item)
 {
 }
 public abstract void PhaseTwo(IOItem item);
 public abstract void PhaseOne(IOItem item);