CHAPTER 9 - Back Trace Ranges

     09.01 Introduction
     09.02 Using Back Trace Ranges
     09.03 Special Notes

09.01 Introduction

     Soft-ICE can collect instruction information in a back trace history
     buffer as your program executes. These instructions can then be
     displayed after a bug has occurred. This allows you to go back and
     retrace a program's action to determine the actual flow of
     instructions preceding a break point.

     Instruction information is collected on accesses within a specified
     address range, rather than system wide. The ranges can be from 1 byte
     to 1 megabyte, so if desired, complete system information can be
     obtained. Using specific ranges rather than collecting all
     instructions is useful for two reasons:

     1. The back trace history buffer is not cluttered by extraneous
     information that you are not interested in. For example, you may not
     be interested in interrupt activity and execution within MSDOS.

     2. Back trace ranges degrade system performance while they are active.
     By limiting the range to an area that you are interested in, you can
     improve system performance greatly.

     Soft-ICE has two methods of utilizing the instructions in the back
     trace history buffer:

     1. The SHOW command allows you to display instructions from the back
     trace history buffer. You must specify how many instructions you wish
     to go back in the buffer.

     2. The TRACE command allows you to go back and replay instructions
     from the back trace history buffer, This way you can see the
     instruction flow within the context of the surrounding program code or
     source code.

09.02 Using Back Trace Ranges

     To use back trace ranges you must do the following:

     1. Allocate a back trace history buffer of the desired size by
     inserting the /TRA switch on the S-ICE.EXE line in CONFIG.SYS. For
     example, to create a back trace buffer of 100K you might have the
     following line in your CONFIG.SYS file:

     DEVICE = S-ICE.EXE 100

     A back trace history buffer of 10K is allocated by default. If this is
     suitable for your needs you do not have to allocate a larger buffer.
     The history buffer size is only limited by the amount of extended
     memory available.

     2. Enable back trace ranges by creating a memory range break point
     with the T or TW verb. For example:

     BPR 1000:0 2000:0 T

     The T and TW verbs do not cause break points instead they log
     instruction information that can be displayed later with the SHOW or
     TRACE commands.

     3. Set any other break points if desired.

     4. Exit from Soft-ICE with the X command.

     5. After a break point has occurred, or you have popped Soft-ICE up
     with the hot key, you can display instructions in the buffer with the
     SHOW command. For example, to go back 50 instructions in the buffer
     and display instructions type:

     SHOW 50

     6. To replay a series of instructions you must first enter trace
     simulation mode with the TRACE command. To begin replaying the
     sequence of instructions starting back 50 in the buffer type:

     TRACE 50

     7. After you have entered trace simulation mode, you can trace through
     the sequence of instructions by using the XT, XP, or XG commands. This
     allows you to re-enact the program flow. For example, you can single
     step through the sequence of instructions in the buffer, starting at
     the instruction specified by the TRACE command, by typing:

     XT
     XT
     .
     .
     .
     XT

     The XT command single steps through the back trace history buffer.

     The XP command program steps through the back trace history buffer.

     The XG command goes to an address in the back trace history buffer.

     8. To exit from trace simulation mode type:

     TRACE OFF

     9. To reset the back trace history buffer, use the X command.

09.03 Special Notes

     While in trace simulation mode, most Soft-ICE commands work as normal,
     including 