GEOS SDK TechDocs
|
|
5.4 Examining and Modifying Memory
|
6 Additional Features
alias, mwatch, objwatch, save, switch, sym-default, why
These commands are important to know but do not readily fall into any of the previous categories. This section will discuss each of these commands in relation to the debugging process.
alias [<name> [<body>]]
This command is normally used to abbreviate a long command or series of commands with one single, descriptive command. If no arguments are given, then
alias
will just give a list of all the aliases and the commands they alias. The
alias
command is a convenient shortcut for oft used commands or for commands that take a long time to type.
If only one argument is given, then
alias
will try to match that argument to the command it is aliased to. For example, if the
print
command is aliased to
p
, then
alias p
will return
print
as a result. If two arguments are given, then
alias
will cause argument1 to be allowed as an alternative to typing argument2. For example, if the command
print
were to be aliased as
p
, the
alias
command would be used as below:
[hello:0] 5 => alias p print
Typing
p
will now have the same effect in Swat as typing
print
.
mwatch [<message>+]
The
mwatch
(message watch) command watches a particular message and displays all deliveries of that message without stopping GEOS. This command can help to verify that a particular message is getting sent to all the right places and is not sent to any of the wrong places. Up to eight messages can be watched at once, and the
mwatch
command with no arguments clears all watched messages. Note that some message handlers will relay a message on to a superclass' handler; this may make it appear that the message is being delivered again, though this is not the case. (See The mwatch Command
.)
Swat Display 3-12 The mwatch Command
(ui:0) 30 => mwatch MSG_VIS_DRAW MSG_META_EXPOSED (ui:0) 31 => c MSG_VIS_DRAW, ^l2860h:001eh, GenInteractionClass cx = 3f80h, dx = 0000h, bp = 3950h MSG_VIS_DRAW, ^l2860h:001eh, GenInteractionClass cx = 3f80h, dx = 0000h, bp = 3950h MSG_VIS_DRAW, ^l2860h:001eh, GenInteractionClass cx = 3f80h, dx = 0016h, bp = 3950h MSG_VIS_DRAW, ^l2860h:001eh, GenInteractionClass cx = 3f80h, dx = 0016h, bp = 3950h MSG_VIS_DRAW, ^l2860h:002ch, OLGadgetAreaClass cx = 3f80h, dx = 3950h, bp = 3950h MSG_VIS_DRAW, ^l2860h:002ch, OLGadgetAreaClass cx = 3f80h, dx = 3950h, bp = 3950h MSG_VIS_DRAW, ^l2860h:002ch, OLGadgetAreaClass cx = 3f80h, dx = 007ch, bp = 3950h MSG_VIS_DRAW, ^l2860h:002ch, OLGadgetAreaClass cx = 3f80h, dx = 007ch, bp = 3950h MSG_VIS_DRAW, ^l2860h:0020h, GenTextClass cx = 3f80h, dx = 3950h, bp = 3950h MSG_VIS_DRAW, ^l2860h:0020h, GenTextClass cx = 3f80h, dx = 3950h, bp = 3950h MSG_VIS_DRAW, ^l2860h:0020h, GenTextClass cx = 3f80h, dx = 3950h, bp = 3950h
objwatch [<addr>]
The
objwatch
(object watch) command is used for displaying the messages that have reached a particular object. It is useful for verifying that messages are being sent to the object at addr. If no argument is given, then any current
objwatch
is turned off. (See The objwatch Command
.)
Swat Display 3-13 The objwatch Command
mess1:0) 2 => objwatch Mess1View brk5 (mess1:0) 3 => c MSG_META_MOUSE_PTR, ^l44a0h:0020h, GenViewClass cx = 00afh, dx = 0013h, bp = 0000h MSG_META_MOUSE_PTR, ^l44a0h:0020h, GenViewClass cx = 00afh, dx = 0013h, bp = 0000h MSG_META_WIN_UPDATE_COMPLETE, ^l44a0h:0020h, GenViewClass cx = 4b90h, dx = 0000h, bp = 0000h MSG_META_MOUSE_PTR, ^l44a0h:0020h, GenViewClass cx = 00b0h, dx = 0013h, bp = 0000h MSG_META_RAW_UNIV_LEAVE, ^l44a0h:0020h, GenViewClass cx = 44a0h, dx = 0020h, bp = 4b90h MSG_VIS_DRAW, ^l44a0h:0020h, GenViewClass cx = 4b80h, dx = 23c0h, bp = 23c0h MSG_VIS_COMP_GET_MARGINS, ^l44a0h:0020h, GenViewClass cx = 4b80h, dx = 23c0h, bp = 0000h MSG_VIS_DRAW, ^l44a0h:0020h, GenViewClass cx = 4b80h, dx = 0163h, bp = 23c0h MSG_META_WIN_UPDATE_COMPLETE, ^l44a0h:0020h, GenViewClass cx = 4b90h, dx = 0000h, bp = 0000h
save <filename>
The save command, when passed a file name, saves the contents of Swat's main buffer to that file. Thus this command dumps Swat output to a file.
showcalls -L showcalls
The
showcalls
command is, for the most part, only useful under rare circumstances. However,
showcalls
with the -L option is useful for a fairly common situation: a library is failing to load but you can't find which one.
To find out which libraries an application is trying to load, use
showcalls -L
. Swat will tell you whenever a library is sought. Whichever library is being sought when the "missing system file" error message appears is the library that's causing your problems: perhaps you need to re-install it.
Use the
showcalls
command without any arguments to turn off library-loading reporting.
switch [(<patient>:<thread-num>|<threadID>)]
The
switch
command is used to switch between applications or threads in Swat but does not physically change threads on the target PC. This allows the transfer of debugging control between threads of the same patient. If no argument is given, then
switch
will change to the thread executing when GEOS was halted. Another way to switch threads is to type the name of the patient on the command line. If a patient has more than one thread, type the name of the patient, a space, and then the thread number. To change thread numbers within a geode, type a colon followed by the thread number to change to (e.g. "
:1")
sym-default [<patient>]
The
sym-default
(symbol default) command is used to set the default patient to use when parsing an address expression which is not defined in the current patient. For example, if a breakpoint is hit in the kernel and an object in the application code needs to be examined, Swat will know to use the application as a patient and not the kernel. This command is useful when debugging a single patient, the most common way to debug. If no patient argument is given, then the name of the default patient will be displayed.
This command is normally aliased to
sd
.
why
The
why
command prints the error code for an occurrence of a fatal error. This command is useful because it can give a good idea of why GEOS crashed.
GEOS SDK TechDocs
|
|
5.4 Examining and Modifying Memory
|
6 Additional Features