Swat Introduction: 5.2 Essential Commands: Attaching and Detaching

Up: GEOS SDK TechDocs | Up | Prev: 5.1 Cycle of Development | Next: 5.3 Breakpoints and Code Stepping
attach, att, detach, quit, cont, Ctrl-C

This group of commands controls the state of the connection between Swat and GEOS when Swat is running. The attach and att commands are used to establish the connection while detach and quit are used to sever it. The most frequently used commands in this group are att with the -r flag and detach . Some related commands contained in the Reference are go , istep , sstep , and next .

The following is a typical but simplified debugging cycle using detach and att . It assumes you have already attached for the first time.

By themselves, the commands shown below can not do much except open and close the communication lines between GEOS and Swat. More commands to examine and modify the application's code as it runs are needed to start actual debugging.

Swat Display 3-3 Detaching and Attaching

(geos:0) 202 => det cont
PC detached
(loader:0) 203 => att
Re-using patient geos
Re-using patient ms4
Re-using patient vidmem
Re-using patient swap
Re-using patient xms
Re-using patient disk
Re-using patient kbd
Re-using patient nimbus
Re-using patient stream
Re-using patient sound
Re-using patient standard
Re-using patient ui
Re-using patient styles
Re-using patient color
Re-using patient ruler
Re-using patient text
Re-using patient motif
Re-using patient vga
Re-using patient spool
Re-using patient serial
Re-using patient msSer
Re-using patient nonts
Re-using patient welcome
Re-using patient shell
Re-using patient manager
Re-using patient math
Re-using patient borlandc
Re-using patient mess1
Thread 1 created for patient geos
Thread 2 created for patient geos
Thread 0 created for patient ui
Thread 0 created for patient spool
Thread 0 created for patient welcome
Thread 0 created for patient manager
Thread 1 created for patient manager
Thread 0 created for patient mess1
Attached to PC
Stopped in 0070h:0005h, address 0070h:0005h
DOS+773: JMP DOS+2963
(geos:0) 204 =>

In this example, we use the det cont command so that GEOS will keep running. We then re-attach with att . In the intervening time, the two machines are independent, and the serial line is unused. We could have taken advantage of this to send down a new copy of some application (as long as that application was not running on the target machine).

att

att 

The att command is similar to the attach command, but has no bootstrap argument (as explained below).

attach

attach [(+b|-b)]

This command is used to attach Swat to the target PC when the Swat stub is already invoked. The -b argument is to bootstrap and the +b argument is not to bootstrap. Bootstrapping means that Swat will search for the symbol files of all of the geodes and threads as they are encountered rather than all at the beginning. This saves some time if you've just detached and need to re-attach, using only a few geodes while debugging. If no argument is given, the most recent bootstrap setting is used. The default bootstrap setting is +b .

cont

cont

The cont command continues the execution of GEOS after it has been stopped for some reason such as at a breakpoint or fatal error or by control-C. This command is often aliased as the letter c .

detach

detach [(cont|leave)]

The detach command will detach Swat from the target PC. By itself, the detach command will detach Swat and exit GEOS. This command is usually used after a bug is encountered and the source code needs to be modified and recompiled (see Detaching and Attaching ).

cont
The cont option will just detach Swat and allow GEOS to continue to run normally. This option is used when the debugging process is finished but GEOS is still needed to do other things (such as word processing) and you may need to re-attach later for further debugging.
leave
The leave option will detach Swat but keep GEOS stopped wherever it was when the detach leave command was given. This command is useful for passing debugging control to someone remotely logged in to the workstation or when Swat can not continue for some reason.

quit

quit [(cont|leave)]

The quit command is only used when Swat needs to be exited for good. It will detach Swat (if necessary), exit from Swat on the development station, and exit from GEOS.

cont
The cont option exits Swat on the development station but allows GEOS to continue running normally on the target PC. This option is used when the debugging process is finished but GEOS is still needed to do other things such as word processing.
leave
The leave option will exit Swat but will keep GEOS stopped wherever it was when the quit leave command was given.

Ctrl-C

Ctrl-C

The Control-C command is the command used to stop the execution of GEOS at any point. This command is executed by holding down the Ctrl key and pressing the c key. It is used to stop GEOS in order to set a breakpoint, examine memory, or to get a command line prompt.


Up: GEOS SDK TechDocs | Up | Prev: 5.1 Cycle of Development | Next: 5.3 Breakpoints and Code Stepping