To debug a component you must run the debug version of the server, and use a debugger running on the same host as EAServer. Chapter 3, “Creating and Configuring Servers,” in 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 C++ Debug
(com.sybase.jaguar.component.cpp.debug) property under
the Advanced tab to true
.
Follow these steps to attach to the server and step into your component code:
Configure the component properties and verify the CPP Debug property is enabled (or set to true). See “CORBA component property descriptions”.
Start your C++ debugger and configure it to launch EAServer using the server-start script.
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.
Make sure the jag_dbg_stop breakpoint
is set before running your client application.
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.
When you finish debugging, reconfigure the component properties and verify the CPP Debug property is disabled (or set to true). See “CORBA component property descriptions”.