How To Debug C/c++ Pgm In Linux? (step-by-step Execution)?

December 3rd, 2009 by admin | Filed under Linux Debugging

In linux we can compile a c/c++ pgm using cc / g++ command. But it will not execute sequentially (Unlike Turbo C ) so if we want to compile pgm sequentially what must be the solution

Related Posts:

tag_iconTags: | | | |

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

1 Response to “How To Debug C/c++ Pgm In Linux? (step-by-step Execution)?”.

  1. Sheetal N :

    You can use gdb (the GNU debugger) to step through programs on Linux.
    First, be sure to compile with the -g flag to include debugging information.
    Then, run gdb to start debugging.
    A few of the commands available are:
    > run
    Starts the program
    > break Create a breakpoint at .
    > step
    Executes the current line of the program.
    > print
    Prints out the value of
    .
    There are a lot more commands available, and can be found by using the help command in gdb. Additionally, there are a *ton* of gdb resources and guides available on the web.
    Hope this helps!

Leave a comment.

To leave a comment, please fill in the fields below.

Powered by Yahoo! Answers