Files
cdesktop/cde/doc/C/guides/ttGuide/ch03.sgm
2013-08-29 19:46:29 -06:00

175 lines
5.8 KiB
Plaintext

<!-- $XConsortium: ch03.sgm /main/6 1996/09/08 19:35:41 rws $ -->
<!-- (c) Copyright 1995 Digital Equipment Corporation. -->
<!-- (c) Copyright 1995 Hewlett-Packard Company. -->
<!-- (c) Copyright 1995 International Business Machines Corp. -->
<!-- (c) Copyright 1995 Sun Microsystems, Inc. -->
<!-- (c) Copyright 1995 Novell, Inc. -->
<!-- (c) Copyright 1995 FUJITSU LIMITED. -->
<!-- (c) Copyright 1995 Hitachi. -->
<Chapter Id="TTUG.ttsnp.div.1">
<Title Id="TTUG.ttsnp.mkr.1">Using TTSnoop to Debug Messages and Patterns</Title>
<Para><Emphasis><IndexTerm>
<Primary>TTSnoop</Primary>
</IndexTerm></Emphasis>TTSnoop is a tool provided to create and send custom&hyphen;constructed ToolTalk
messages. You can also use TTSnoop as a tool to selectively monitor any or all
ToolTalk messages.</Para>
<Sect1 Id="TTUG.ttsnp.div.2">
<Title>About TTSnoop</Title>
<Para>TTSnoop is a useful interactive tool that you can use to become familiar with
TookTalk concepts and API calls as well as to perform demonstrations. In
addition, TTSnoop is a valuable debugging tool when you are developing
applications.</Para>
<Para>You can use TTSnoop to monitor for messages that match more than one
pattern. When a matched message is displayed, the name of the pattern that
matched the entry can also be displayed.</Para>
<Para>You can add, edit, or delete messages and patterns to scrollable lists. TTSnoop
allows the definitions of multiple patterns and messages to be saved and
loaded from files. You can also define, save, and reload patterns and messages
particular to a category of applications (for example, DeskSet&trade; tools) as well
as associate messages and patterns with a user-defined name.</Para>
</Sect1>
<Sect1 Id="TTUG.ttsnp.div.3">
<Title>Where to Find TTSnoop</Title>
<Para>The TTSnoop program resides in the directory<IndexTerm>
<Primary>/usr/dt/bin/ttsnoop</Primary>
</IndexTerm>
<Filename>/usr/dt/bin</Filename>.</Para>
</Sect1>
<Sect1 Id="TTUG.ttsnp.div.4">
<Title>Starting TTSnoop</Title>
<Para>To start the program, enter the following command on the command line:</Para>
<ProgramListing>ttsnoop [ -t ]</ProgramListing>
<Para>The<IndexTerm><Primary>-t option, of ttsnoop command[t]</Primary>
</IndexTerm> <Filename>-t</Filename> option displays the ToolTalk API calls that are being used to construct a
particular pattern or message.
<!--Original XRef content: 'Table&numsp;3&hyphen;1'--><XRef Role="CodeOrFigureOrTable" Linkend="TTUG.ttsnp.mkr.2"> describes the menu options that are displayed
when TTSnoop starts.</Para>
<Table Id="TTUG.ttsnp.tbl.1" Frame="Topbot">
<Title Id="TTUG.ttsnp.mkr.2">TTSnoop Menu Options</Title>
<TGroup Cols="2">
<ColSpec Colname="1" Colwidth="1.25 in">
<ColSpec Colname="2" Colwidth="3.75 in">
<THead>
<Row>
<Entry><Para><Literal>Menu Option</Literal></Para></Entry>
<Entry><Para><Literal>Description</Literal></Para></Entry>
</Row>
</THead>
<TBody>
<Row>
<Entry><Para>Snoop</Para></Entry>
<Entry><Para>Turn on/off tracing; get version information
</Para></Entry>
</Row>
<Row>
<Entry><Para>Message</Para></Entry>
<Entry><Para>Create, open, receive, and destroy messages</Para></Entry>
</Row>
<Row>
<Entry><Para>Pattern</Para></Entry>
<Entry><Para>Create, open, and destroy patterns</Para></Entry>
</Row>
<Row>
<Entry><Para>File</Para></Entry>
<Entry><Para>Numerous tasks, including joining a file</Para></Entry>
</Row>
<Row>
<Entry><Para>Session</Para></Entry>
<Entry><Para>Join a specific session; set the default session
</Para></Entry>
</Row>
<Row>
<Entry><Para>Ptype</Para></Entry>
<Entry><Para>Declare and undeclare a <literal>ptype</literal>; determine whether
a <literal>ptype</literal> exists
</Para></Entry>
</Row>
<Row>
<Entry><Para>Types</Para></Entry>
<Entry><Para>Generate a list of declared types; generate a list of ToolTalk-based actions
</Para></Entry>
</Row>
<Row>
<Entry><Para>Procid</Para></Entry>
<Entry><Para>Open, close, suspend, and resume a procid
</Para></Entry>
</Row>
<Row>
<Entry><Para>libc</Para></Entry>
<Entry><Para>Call <function>system()</function>, <function>putenv()</function>, <function>chdir()</function>, <function>pause()</function>, and <function>exit()</function>; use <function>exit()</function>
to exit <command>ttsnoop</command>
</Para></Entry>
</Row>
</TBody>
</TGroup>
</Table>
</Sect1>
<Sect1 Id="TTUG.ttsnp.div.5">
<Title>Composing and Sending Messages</Title>
<Para>When you select <command>Message &hyphen;&gt; Create</command>, a dialog is posted that
enables you to
</para>
<itemizedlist>
<listitem>
<para>Create and send a message
</para>
</listitem>
<listitem>
<para>Create a template for a ptype
</para>
</listitem>
<listitem>
<para>Create a template for a ToolTalk type action
</para>
</listitem>
<listitem>
<para>Create a C language template for a message reply handler
</para>
</listitem>
</itemizedlist>
<para>To create a message, select the <command>Create &hyphen;&gt; Tt_message</command> option. The following may be
specified for a message:
</para>
<itemizedlist>
<listitem>
<para>The Scope (for example, File, Session, Both, or File in Session)
</para>
</listitem>
<listitem>
<para>The Session Id
</para>
</listitem>
<listitem>
<para>The Class (for example, Notice or Request)
</para>
</listitem>
<listitem>
<para>The Address (for example, Object, Handler, or Procedure)
</para>
</listitem>
<listitem>
<para>The Disposition (Discard, Queue, or Start)
</para>
</listitem>
<listitem>
<para>The Arguments
</para>
</listitem>
</itemizedlist>
</sect1>
<Sect1 Id="TTUG.ttsnp.div.9">
<Title>To Begin Snooping</Title>
<Para>To turn on the displaying of messages and pattern traffic, select
<command>Snoop &hyphen;&gt; On</command>.
</para>
</Sect1>
<Sect1 Id="TTUG.ttsnp.div.10">
<Title>To Stop Snooping</Title>
<Para>To turn off the displaying of messages and pattern traffic, select
<command>Snoop &hyphen;&gt; Off</command>.
</Para>
</Sect1>
</Chapter>
<!--fickle 1.14 mif-to-docbook 1.7 01/02/96 05:02:32-->