This chapter shows you how to start the IRIX IM analyzer, explains pertinent concepts, and presents an overview of its graphical user interface. This chapter contains the following sections:
The IRIX IM analyzer is integrated with the ProDev WorkShop Debugger, cvd. To start the Debugger from a shell command line, use the following syntax:
cvd [-pid pid] [-host host] [executable [corefile]] [&] |
You can specify the executable from the Debugger and by default the host is local, so all you really need to enter is cvd.
You issue IRIX IM analyzer commands graphically from the IRIX IM analyzer subwindow of the main Debugger window (see figure). To access the subwindow, you must pull down the Views menu and select “IRIX IM Analyzer”
When you first bring up the IRIX IM Analyzer, it may ask you if you want to change $LD_LIBRARY_PATH to include /usr/lib/WorkShop/Motif. In that directory are instrumented versions of the Silicon Graphics Xlib, Xt, and Xm libraries. These versions include debugging symbols and special support for IRIX IM Analyzer functions.
It is strongly recommended that you click OK to the dialog and use these libraries. Doing so enables all of the features of the IRIX IM Analyzer. These libraries are identical in functionality to the libraries shipped with IRIX 5.3. The analyzer uses the Silicon Graphics enhanced version of these libraries. There are no instrumented MIPS/ABI versions of the libraries.
The IRIX IM Analyzer provides specific debugging support for X/Motif applications. There are various examiners for different X/Motif objects (for example, widgets and X graphics contexts) that are normally difficult or impossible to inspect using ordinary debugger functionality. Also, you can set widget-level breakpoints and collect X event history information (in the same manner as xscope).
When you first bring up the IRIX IM Analyzer, you see the Widget examiner. It may be blank or displaying a Widget that it found on the callstack if you have a stopped process. Most of the examiners in the IRIX IM Analyzer try to detect interesting objects from the callstack and offer to display them for you, automatically.
At the bottom of the IRIX IM Analyzer is a tab panel showing the current set of examiners. Besides the Widget examiner, the Breakpoints, Tree, and Trace examiners are available by default. These four tabs are always present.
To bring up new examiners, use the Examine menu and select one from below the separator. Some examiners (for example, the Callback examiner) cannot be manually selected—they appear only when the callstack context is appropriate. In the case of the Callback examiner, it appears only when the process is stopped somewhere in a widget callback.
To remove an examiner from the tab panel, put the pointer over the tab, click the right button of your mouse, and select 'Remove Examiner' from the popup menu. The tab disappears.
If you select text in one examiner and then choose another using the Examine menu, the new examiner is brought up and the text is used as an expression for it. If you selected text that evaluated to an inappropriate object for the new examiner, an error is generated.
Alternatively, you can select text, pull down the Examine menu, and choose “Selection.” The IRIX IM Analyzer attempts to select an appropriate examiner for the type of the selected text. If the type of the text is unknown, the error Couldn't examine selection in more detail is generated. Otherwise, the appropriate examiner is chosen and the text is evaluated.
You can accomplish the same thing by triple-clicking the line of text. If the type of the text is unknown, nothing happens. Otherwise, the appropriate examiner is chosen and the text is evaluated.
X/Motif applications consist of collections of objects (Motif widgets) and make extensive use of X resources such as windows, graphics context, and so on. The construction model of an X window system hinders you from inspecting the internal structures of widgets and X resources because you are presented with ID values. The IRIX IM Analyzer provides inspection capability for you to see into the data structures behind the ID values.
Traditional debuggers enable you to set breakpoints only in source lines or functions. With the IRIX IM Analyzer, you can set breakpoints for specific widgets or widget classes, for specific control flow constructs like callbacks or event handlers, and (at a lower level) for specific X events or requests.
Due to implementation details, there are several nuisances that currently pose some restrictions to the IRIX IM Analyzer:
The Breakpoints area is active only after you've stopped the process once, and if you've changed $LD_LIBRARY_PATH.
Sometimes, gadget names may be unavailable and are displayed as <object>.You can minimize this condition by getting the widget tree beforehand.
editres-type requests (widget selection and widget tree) work only if the process is running or if the process is stopped outside of a system call. This can be annoying when the process is stopped in select(), waiting for an X server event.
The process state and appearance of the cvd Main View flickers while the IRIX IM Analyzer tries to complete an editres request when the process is stopped.
editres requests may be unreliable if the process is stopped.