Search This Blog

Saturday, August 18, 2012

Thursday, August 16, 2012

How to Debug C++ program running on AIX from Windows

great and easy way to debug your running c++ program on aic from windows.
here is the complete video guide.

http://publib.boulder.ibm.com/infocenter/ieduasst/rtnv1r0/index.jsp?topic=/com.ibm.iea.compileraix/compileraix/10.1/Quick_Start_Guide/Launching_a_Debug_Session/player.html

the PDF doc could be found here http://publib.boulder.ibm.com/infocenter/ieduasst/rtnv1r0/topic/com.ibm.iea.compileraix/compileraix/10.1/Quick_Start_Guide/Launching_a_Debug_Session.pdf


  1. 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.         
  2. 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.                                                                                                                                                                                                                                                                                                                                                                 
  3. 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.                                                                                                                                                                                                                                                                                                                                                                 
  4. 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.                                                                                                                                                                                                                                                                                                                                                                 
  5. 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.                                                                                                                                                                                                                                                                                                                                                                 
  6. 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.                                                                                                                                                                                                                                                                                                                                                                 
  7. 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Enjoy
Yaniv Tzanany                                                                                                                                                                                                                                                                                                                                                   

How to Debug a Release build at C++ - VC6

follow the next steps
http://support.microsoft.com/kb/291585

i have no idea where its came from the next article


Debugging in Release Mode
I've heard a myth repeated many times by my fellow VC++ developers. It is that it is not possible to debug in Release Mode. Fortunately, this is a myth.
Rule 7: When all else fails try debugging in release mode.
It is possible to debug in Release mode. The first step is to turn on symbols:
  • In Project Settings (Alt-F2) under the "C++/C tab" set the category to "General" and change the Debug Info setting to "Program Database".
  • Under the "Link tab" check the "Generate Debug Info" tab.
  • Recompile using "Rebuild All"
This will allow you to see the symbols in the release version. You might want to also consider the following:
  • You may want disable your optimization settings when debugging your release version (though this isn't absolutely necessary).
  • If you have trouble placing breakpoints, the command "__asm {int 3}" will cause your program to stop at that line (be sure to remove these lines from your program when you are done debugging).
Debugging in release mode has several limitations.
  • The most annoying one is that you can't easily see into MFC because you don't have the symbols included for the MFC DLL.
  • You must add symbols to the release versions of all libraries and DLL's you wish to debug in your release application.

ActiveMQ - strater minutes

The next minutes are the link and info i used to start my way with ActiveMQ product.

Thursday, August 9, 2012

GetTickCount Linux Implantation


DWORD GetTickCount(void)
{
timespec time1;
clock_gettime(CLOCK_MONOTONIC, &time1);
return (time1.tv_sec * 1000) + (time1.tv_nsec/1000000);
}