IBM Debugger for AIX This education module illustrates how to launch a debugger session for IBM Debugger for AIX®. Overview Overview User interface (idebug) Eclipse/RCP packaging and other debug products Debug engine (irmtdbgc) Expression evaluators and other debug engines Debug preparation Compile program with -g The IBM Debugger for AIX is Eclipse-based. It is based on the Client/Server architecture. The client, or the User Interface is what you interact with. It is based on Eclipse and all platforms of IBM Debugger products have a similar-looking UI. However, they talk to a different engine. The Debug Engine controls the user’s application. With the help of expression evaluator, it can debug C, C++, Cobol , and PL/I programs. On ZSeries, the engine can also debug high level assembly. The UI calls the engine by establishing a TCP/IP connection to the debugger engine. Users can debug on I-series, TPF mainframe, Z-series, AIX and on Windows®. But before you attempt to launch a debug session, make sure your program is compiled with –g option. Otherwise, no source is displayed. This presentation illustrates how to launch a debug session on Windows. Other options that affects debugging Other options that affects debugging Other options that affect debugging -qfullpath -qlinedebug -qtbtable -O should not be used Consult the compiler documentation There are other options that affect debugging. -qfullpath will affect the ability of the debugger to find source files. -qlinedebug suppresses information on variables. -qtbtable can be used to suppress traceback tables. This can affect the ability of the debugger to build stack traces. -O should not be used. Debugging optimized code is possible, but the results can be misleading. Consult the your compiler documentation for more information. Launching a debug session Launching a debug session Start->All Programs->IBM->IBM Debugger for AIX->IBM Debugger for AIX Shortcut to the UI program on your desktop. This presentation illustrates how to launch a debug session on Windows. On Windows, from Start->All Programs->IBM->IBM Debugger for AIX->IBM Debugger for AIX, you can launch the UI. You can also set a shortcut to the UI program and place it on your desktop and double click the icon. Once the UI is launched, there are several steps to follow in order to launch a debug session. Step 1: Select a profile location Step 1: Select a profile location Step 1: Select a profile location. Once the debugger is launched, you are prompted for a profile location. This is a place for breakpoint setting, view setting, and any other customization that you have done to the user interface. You can select the check box “Use this as the default and do not ask again” to bypass this dialogue in the future. Step 2: Check the debugger daemon Step 2: Check the debugger daemon Debugger UI: the debugger daemon Step 2: Check the Debugger Daemon. By default, the debugger daemon is set to port 8001, you will need to know the number when launching the debug engine. In the UI, under the debugger daemon, circled in red, there are controls that let you: stop listening, change port, and obtain workstation IP. Information provided from these controls is necessary for step 3. Step 3: Launch the debugger engine Step 3: Launch the debugger engine Debugger engine: the irmtdbgc command line irmtdbgc –qhost=workstation:port a.out irmtdbgc –qhost=workstation:port –a PID Examples: irmtdbgc –qhost=sunshine a.out irmtdgbc –qhost=sunshine core irmtdbgc –qhost=sunshine –a 1112 Step 3: Launching the debugger engine From a telnet/ssh session to the AIX machine where the debugger engine resides, the irmtdbgc –qhost=workstation:port a.out command line will launch the debugger engine. You can also attach to a running process by using the –a flag. Note that if you use the default 8001 port, it is not necessary to specify the port. In the examples here, you are launching the debugger engine to connect to the host sunshine, default port 8001, to debug a program a.out, core file and attach to a process. Step 3: Launch the debugger engine (continued) Step 3: Launch the debugger engine (continued) DER_DBG_ADDR environment parameter DER_DBG_ADDR=workstation:port export DER_DBG_ADDR=sunshine:8001 irmtdbgc a.out You can also specify the default host and port with the DER_DBG_ADDR environment parameter. For example, you can put the export statement in your profile export DER_DBG_ADDR=host:port And then launch the debugger engine in a simpler way. irmtdbgc a.out will then launch the debugger engine to connect to host sunshine, port 8001 to debug program a.out Screen capture Once you are connected, here is the user interface. The debugger user interface will place the UI on the debug control view similar to this picture. In the lower left corner, you can see your Source Display. In the top left corner, the Debug control gets populated with the call stack. In the lower right corner, you can see variables and monitors. In the top right corner you can see breakpoints. You can drag and move these views to a position that suits your debug style. The debug control view provides stepping actions that are discussed in other modules. Feedback Feedback Your feedback is valuable You can help improve the quality of IBM Education Assistant content to better meet your needs by providing feedback. Did you find this module useful? Did it help you solve a problem or answer a question? Do you have suggestions for improvements? Click to send e-mail feedback: mailto:iea@us.ibm.com?subject=Feedback_about_Launching_a_Debug_Session.ppt This module is also available in PDF format at: ../Launching_a_Debug_Session.pdf You can help improve the quality of IBM Education Assistant content by providing feedback. Trademarks