July 5, 2007

How to trace a C program in fedora or red hat linux platform?

  1. If you want to see all the steps it is trying to do. You can try gdb.

    you can also try
    strace -o <someoutputfile> yourprogram

    This will log all the calls the program made into the logfile

  2. shweta try this link

    http://www.google.co.uk/search?hl=en&q=t…

  3. 1# If you want to use an IDE in Linux then use Kdevelop.
    Just go to terminal type kdevelop ( make sure KDE development tools are already installed).

    2# For compiling you can use G++ compiler.

    3# For debugging GDB (it is a command line debugger).

    4# IF you need debugger with GUI then go for "Electric fence", or
    " ddd ".

  4. Use "lint" to check your code before you compile your code.

    If you need to track down runtime errors, use "gdb" The GNU Debugger and "strace" to trace the system calls and signals. Both have their strengths. You can find more information on these in their man pages (at the prompt type "man gdb" and press enter, then space bar to page down or "q" to quit).

    Once you have an idea of where the program is going wrong you can insert commands into your code to print the values of your variables to a log file while it is running and then you will find where your algorithm needs to be corrected or improved.

    There are lots of tutorials available for free on the web. It is an excellent resource.

    Good luck.

  5. GDB is the way! It's a highly powerful tool to trace / debug a gnu C prog!
  6. try to find files with .C extension.

Tags: ,

Tell a Friend Today!

del.icio.us Digg Furl Reddit Ask BlinkList blogmarks Blogg-Buzz Google Ma.gnolia Netscape ppnow Rojo Shadows Simpy Socializer Spurl StumbleUpon Tailrank Technorati Windows Live Wists Yahoo! Help

Permalink • Print

Track this entry

RSS BlogPulse

RSS Technorati Cosmos

Related Searches

, , , ,