Smith Dwayne
Smith Dwayne

Reputation: 2807

Debugging C++ in Netbeans

I am very new to work c++ Programs with Netbeans IDE in Ubuntu. I wrote a simple Hello World Program and tried to debug it using step Into. When I Click Step Into Option From Debug Menu I got new window opened in the name of " Diassembly(main) " . The Debug process didn't reach my source code line at any way. I repeatedly click Step Into Function At last the process got end Without Tracing my source code line. But In the Debug output window I got the Correct Result.

#include <iostream>
using namespace std;
int main()
{
    cout<<"Hello";
    cout<<"World";
}

Why This process Control goes to the Diassembly (main) window ? How to rectify this problem ?

Upvotes: 0

Views: 3265

Answers (3)

HEKTO
HEKTO

Reputation: 4191

You must compile with -g option, otherwise the debugger won't be able to stop on a breakpoint. As for disassembling window - I can't reproduce that (I'm on Netbeans 7.4 in Ubuntu 13). You should just close the window if you don't need it.

Upvotes: 3

Superdrac
Superdrac

Reputation: 1208

Pehaps that there is an answer here (i can't comment sorry)

"No source available for main()" error when debugging simple C++ in Eclipse with gdb

Upvotes: 1

Hai Nguyen
Hai Nguyen

Reputation: 81

First, you have to toggle a break point in your code by clicking on the line number of the line you want to stop in source window, if you did not. Then hit Debug. Don't step into function that you not build from source, just step over it.

Upvotes: 2

Related Questions