Setup
In order to debug Metview, you must first ensure that it has been built with debugging enabled. This involves setting the --enable-debug
flag when running the configure
script - see the Installation Guide for Metview 4.4 and below.
Starting the debugger in the correct environment
When debugging a Metview module, the debugger must be started from the correct environment.
- If you are running Metview from the directory where it was built (not installed), then when you start Metview you will see the XServ bar. There is a button here called debug which brings up an xterm with Metview's environment in it.
- If you are running Metview from its installation directory, you can create a debug window as follows:
- Create a new Shell icon (either from the Basic drawer, or from the New Icon desktop menu)
- Edit the icon and type '
xterm
' (without the quotes) in it, and save - Right-click | execute the Shell icon
Debugging a module
From a terminal which has the correct environment as described above, you can go to Metview's executable directory:
cd $METVIEW_BIN
From here, you can start the debugger with your chosen module. Generally, the command-line argument -nofork
should be supplied. In the case of the Macro module, -serve
should also be supplied. If the module does not start, then it might be because it is already running - from a Metview desktop, choose Process Monitor from the Tools menu and stop the process. If debugging the Display Window, then the corresponding executable is called uPlot
; running this will create an empty Display Window into which you can drop icons.