Chapter 14 Creating CORBA C++ Components


Debugging C++ components

To debug a component you must run the debug version of the server, and use a debugger running on the same host as EAServer. The EAServer System Administration Guide describes how to start the debug server.

To debug a component from Microsoft Visual C++, you must set the component's com.sybase.jaguar.component.cpp.debug property under the All Properties tab to true .

Follow these steps to attach to the server and step into your component code:

  1. Attach the server process with your debugger.

    Alternatively, start the debugger with the executable. For example, on UNIX, enter:
    dbx $JAGUAR/devbin/jagsrv ServerName
    


    On Windows, enter:
    msdev %JAGUAR%\devbin\jagsrv ServerName
    


    ServerName is the name of the server. If you are using the preconfigured server rather than one that you created yourself, use "Jaguar".
  2. Set a breakpoint on the function jag_dbg_stop. This function executes every time the server loads a component DLL. The jag_dbg_stop prototype is:
    void jag_dbg_stop(char *compName)
    


    The compName parameter specifies the name of the library or shared library that was just started. Several components may be started before yours. In the debugger, display the compName value when the jag_dbg_stop breakpoint is tripped, and monitor the value to determine when your component is started. Breakpoints on jag_dbg_stop are triggered before the server calls the component's create method.

    Note   Make sure the jag_dbg_stop breakpoint is set before running your client application.

  3. When your component's DLL is started, you can specify the component's C++ function names as breakpoints and step into the method's code when it is invoked.

 


Copyright © 2002 Sybase, Inc. All rights reserved.