Starting from version 5.5.0, the QSPY host application has been extended with a UDP socket, which is open for communication with various Front-Ends (GUI-based or "headless"). QSpyView is an example of such a Front-End.
QSpyView is written in Tcl/Tk and it runs on all desktop operating systems (Windows, Linux, Mac).
QSpyView currently supports the following commands (NOTE:
QSpyView is extensible with functionality specific to the project at hand, so it can provide many more features on top of the basic functionality enumerated below):
QSpyView) into the Target
The sequence diagram below shows the general structure of
QSpyView. The embedded Target is running an instrumented code that communicates with the QSPY Host application over the Target data link (red arrows). This communication is based on the Q-SPY Protocol. The
QSpyView (Tcl/Tk script) attaches to the QSPY host application by means of the UDP socket that QSPY opens when the
-u command-line option is selected. This communication (blue arrows) uses the same packet structure as the Q-SPY Protocol, but without the HDLC framing, without transparency (escaping), and without the checksum.
QSpyView) receives all this data.
B The QSPY Back-End relays all UDP packets with Record-ID in the range
0..127 to the Target.
128..255are not relayed to the Target, but instead are used for communication between the Front-End and the QSPY Back-End.
In order to run
QSpyView, you need the Tk interpreter called wish installed on your machine.
Wish (version 8.4) is included in the Qtools collection for Windows, so it will be available if you install Qtools. Also, the Tcl/Tk distribution included in Qtools has been already extended with the UDP-Sockets for Tcl, so you can use the
wish interpreters "as is" without any additional modifications.
On Linux, Tcl/Tk is usually installed, but you need to augment the standard Tcl/Tk distribution with the UDP Sockets for Tcl.
Being a Tcl/Tk application,
QSpyView requires the Tk interpreter called wish (windowing shell) to run. This Tcl/Tk interpreter needs to be augmented with the UDP socket extension, because the standard Tcl/Tk distributions typically don't support UDP. (NOTE: The Tcl/Tk interpreters included in the Qtools collection for Windows are already augmented with the UDP socket extension, so you don't need to do anything to use them for
In the simplest form,
QSpyView might be started by changing to the folder
qtools\qspy\qspyview and double-clicking on the qspyview.tcl script. Alternatively, you might open the Command Prompt and type:
This would launch
QSpyView in the "default" configuration, without any customization specific to a project at hand.
However, it also possible to launch
QSpyView customized to a particular project, such as the DPP application, by providing commands and views specific to the project at hand. For this
QSpyView provides an extension mechanism to provide another script as a command-line parameter to the qspyview.tcl script.
wish qspyview.tcl [<cust_script> [<qspy_host> [<qspy_port>]]]
<cust_script>is the customization script (e.g.,
<qspy_host>is the network host name or IP address of the host running the QSPY "Back-End", and
<qspy_port>is the UDP port number opened by the QSPY "Back-End". If the parameters
<qspy_port>are not provided, the defaults of
For example, the DPP example provides the extension script named dpp.tcl, located in the QP examples directory. In this case, you need to choose from which directory you want to launch
QSpyView. If you choose to launch it from the directory containing the extension script, you need to fully-qualify the location of the qspyview.tcl script, as follows:
wish %QTOOLS%\qspy\qspyview\qspyview.tcl dpp.tcl
QSpyViewis to define a shortcut, like the one provided with the DPP example:
In contrast to TCP, which is stream-oriented, UDP is packet-oriented, so the only way to "attach" two ends of communication is to exchange packets. Consequently, immediately after
QSpyView is launched, it tries to attach by sending the ATTACH packet to QSPY. If QSPY responds with the ATTACH response,
QSpyView considers that it is "attached".
However, if the ATTACH response does not arrive within a second or two (because perhaps QSPY is not running),
QSpyView opens a modal dialog box that reminds you to run QSPY with the
-u command-line option, as shown in the screen-shot below:
Depending how you start QSPY, the dialog box might close automatically, which means that QSpyView has successfully attached to QSPY. However, if the dialog box does not close, you need to click the OK button to send ATTACH packet to QSPY, until
QSpyView receives the ATTACH response from QSPY. If you can't "attach", you can click the Cancel button to close
QSpyViewFront-End (e.g., office computer). These two machines can even run different operating systems, for example Linux on the lab computer and Windows in the office, or vice versa. All you need to do is to provide the host-name parameter as the third command-line argument to the
wish qspyview.tcl dpp.tcl 192.168.1.101).
QSpyView can correctly interpret any data from the Target, it needs to obtain certain information about the Target, such as the sizes of object pointers, function pointers, event signals, etc. This information is provided in the QS_TARGET_INFO trace record coming from the Target.
To inform you about the Target status,
QSpyView displays the Target: UNKNOWN in the status bar when the target is "unknown":
If this happens, you can explicitly request the Target information by means of the "Commands->Query Target Info" menu:
After the Target information is received, the
QSpyView status bar shows the build time-stamp of the Target image.
Next: QSpyView UDP Interface