ICAT Installation/Setup for COMx Connection
IBM Shop IBM Support Download
HomeNewsProductsServicesSolutionsAbout IBM
Search 

ICAT Installation/Setup for COMx Connection

This page shows how to set up the COMx connection for the ICAT remote debugger. This is a two-system setup just like the kernel debugger (KDB) today. See illustration below for more details.



Target OS/2 Setup

You will need to install the debug kernel on the target operating system. The target operating system must be running one of the following versions of the operating systems: Warp 4.0, Warp Server 4.0 SMP, or Warp 3.0 fixpack 26 or greater. Later fixpacks for any of these operating systems are also fine. These levels of the operating system contain the communication code needed to talk to ICAT and support higher baud rates for KDB. KDB does not use the com.sys driver like the rest of the operating system.


If you want to debug the demo device driver, then copy sampledd.sys from your \icatos2\sample directory over to your target system. Edit config.sys and add

DEVICE=C:\SAMPLEDD.SYS This allows the sample device driver to instantiate on the next reboot of the target system.

Note: Sometimes if a lot of device drivers are being loaded, ICAT will not be notified about all of the device drivers. If this occurs, move your required device driver higher up in the device statements in config.sys.

Host OS/2 Setup

The host system can be running almost any version of OS/2, but we recommend OS/2 3.0 or later. You may need to add a later fixpack or download the com.sys driver from the download page in order to obtain the higher baud rates on the host system.


You will need to edit the setenv.cmd and seticat.cmd file. Please set the environment variables carefully. If you don't, communications won't work or source will not be found. The setenv.cmd file contains the information needed to set up your path information. This normally runs once. The seticat.cmd file is used to set up specific debugging environments. This includes location of binaries, location of source, etc. See the seticat.cmd file for more information on the environment variables and their definitions.


Once you have set up the .cmd files and run them, you can start the ICAT debugger by running icatgam.exe.



Debugging the Sample Driver

  • Once you have set up the target system for sampledd.sys as specified above, you must reboot the target system to instantiate sampledd.sys and load the debug kernel.

    You can run a quick check that the target machine is set up OK by running a terminal emulator (such as t, ZOC, etc.) to see that KDB is alive and communicating at 9600 baud. Remember to shut down this terminal emulator before you run icatgam.exe as they will compete over the COMx port. See the diagram above for more details.

  • After you have edited setenv.cmd and seticat.cmd, run them to set up your host environment. Start the ICAT debugger by typing start icatgam.exe. You will see the Debug Session Control (DSC) window and be prompted by the Initialization panel.


    Select the Attach button. This will establish the communication to the remote target debug kernel. The speed of the connection depends on the baud rate you specified. 115K is currently the fastest speed available. Once the attach is complete, the DSC should show the module(s) that has been requested by the CAT_MODULE_LIST to be debugged. If you do not see any modules in the list, it may be for one of the following reasons:

    • Your CAT_HOST_BIN_PATH environment variable does not point to local copies of your debug binaries.
    • Your binaries are not built with debug information.
    • Your binaries are not loaded yet.


  • If sampledd.sys is displayed in the DSC window, click on the "+", and you will notice routines are displayed. Click on the Strategy routine. The strategy routine of the sampledd.sys device driver should come up in the source window.

    Note: This is masm source, so you will see assembler directives,BUT it is source. We support both CodeView (cl and cl386) and HLL (IBM C Set) debug formats for C.

    If when you try your own code and can't get the source, check the following:

    • Check that the CAT_HOST_SOURCE_PATH variable points to the path location where your source resides.
    • Check that your modules were built with debug information. If an object module does not show up in the list of object modules (an exe, dll, sys, etc. file), it usually means that the object module was not built with debug information.

  • Set a breakpoint on line 216 where there is a call to router_table. Then have ICAT "go" by clicking on the green light icon or Run option from the menu. On the target machine, run sample.exe. sample.exe is found in the \icatos2\sample directory where the device driver was located. It will emit a DevIOCtl to open the sampledd.sys device driver. You should hit your breakpoint. When icatgam.exe notifies you of the breakpoint hit, click on the register icon on the toolbar or select Monitors->registers. Click on the storage icon or the Monitors->storage and edit its value to that of the PC reg at the bottom of the register window. You will see memory that corresponds to the code space. See the running example screen capture window above. Now go crazy and debug away. We will be fixing bugs and supplying new debugger spins. When done, close icatgam.exe. The debugger will restore the baud rate back to its original speed and disconnect from the remote kernel.

  • Here are some common problems encountered when using the debugger:

    • A terminal emulator is running at the same time conflicting for the com port.
    • Debug versions of the binary are not located on the target and host machines.
      Note: The debug version of the binary on the target machine can be stripped using the debstrip utility or some other debug stripping tool found with the compiler. This is useful when debug modules are too big to manage. However, the host version must have full debug information because this is where ICAT gathers its debug information. ICAT only request address and state information from the target system.
    • The debugger hangs when shutting down. The workaround is to use PSPM2.EXE to kill the icatgam.exe process. This tool can be found on DevCon or Hobbes.
    • The target system appears to be locked up after the debugger disconnects. The target may still be in KDB. You can re-attach to the target with ICAT and tell it to go, or you can bring up a terminal emulator program and connect to the kernel and hit "g" for go. A baud rate adjustment may be needed.

PrivacyLegalContact---
© 1999 IBM Corporation