This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 198612

Summary: C++ Step by Step
Product: cnd Reporter: mikikiki
Component: DebuggerAssignee: Egor Ushakov <gorrus>
Status: RESOLVED DUPLICATE    
Severity: normal CC: apepin
Priority: P3    
Version: 7.0   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description mikikiki 2011-05-15 14:34:05 UTC
Hello :)

Installed NetBeans 7.0 full package. This issue is only in C++ dev. since I checked in in Java and haven’t found this problem there.

The problem: 
I try to go step by step F7 (line by line) in debug mode but it jumps over the lines to the next breakpoint. Sometimes it jumps to next breakpoint and from there it continues as expected line by line. For example:

#include <iostream>
int main(int argc, char**argv)
{
    // Prints welcome message...
    std::cout << "Welcome ..." << std::endl;

    int i = 5;
    int j = 10;
    
    std::string s1 = "TEST";
    std::string s2 = "TEST2";
    
    // Prints arguments...
    if (argc > 1) {
        std::cout << std::endl << "Arguments:" << std::endl;
        for (int i = 1; i < argc; i++) {
            std::cout << i << ": " << argv[i] << std::endl;
        }
    }
    
    return 0;
}

Scenarios: (BP=breakpoint)
1) If I put BP on the first line std::out << Welcome... it stops there and the next hit on F7 goes to the end of the program (executes everything)
NOT GOOD
2) The same as (1) but after the stop on BP I do "run to cursor" and let's assume the cursor now on "int j = 10;". After this hit on F7 will jump to next line as expected and then to the next next next.
Works fine, but this is annoying on every debug to make run to cursor in order to debug step by step.
3) If I put BP on the first line "..cout<< Welcome..." and second BP on "s1="TEST"; it stops on first BP then F7 will jump to next BP (skipping the lines with int i= 5; and int j=10;:-(  ) and then F7 works fine again.

I saw the same problem when I Googled it even in earlier versions but it seems like nobody took care of reporting/treating the bug.

FYI

Best Regards,
respectfully,
Miki
Comment 1 soldatov 2011-05-16 09:01:45 UTC

*** This bug has been marked as a duplicate of bug 197493 ***
Comment 2 Alexander Pepin 2011-07-06 14:10:34 UTC
Should be added to test scenarios.
Comment 3 soldatov 2011-07-18 09:13:02 UTC
Now I think it is duplicate of 200196 (not a iz197493)
Comment 4 Alexander Pepin 2011-07-18 11:22:00 UTC
Added testStepOverAfterBreakpoint to StepOver gdb test suite.
Comment 5 Egor Ushakov 2011-09-27 12:01:27 UTC
please clarify what OS and gdb version you were using?
looks like the same problem from the bug 200196
Comment 6 Egor Ushakov 2011-10-10 08:11:29 UTC

*** This bug has been marked as a duplicate of bug 200196 ***