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 175312 - Pop Topmost Call does not work
Summary: Pop Topmost Call does not work
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: henk89
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-23 15:54 UTC by Alexander Pepin
Modified: 2015-03-16 14:15 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Pepin 2009-10-23 15:54:48 UTC
Steps to reproduce:
- create a local project
- add a source file with the following code:
#include <iostream>

void printWelcome();
void printArguments(int length, char** list);
void printHeader(int length);
void printArray(int length, char** list);


int main(int argc, char**argv) {
    // Prints welcome message...
    printWelcome();
    // Prints arguments...
    printArguments(argc, argv);
    
    return 0;
}

void printWelcome(){
    std::cout << "Welcome ..." << std::endl;

}

void printArguments(int length, char** list){
    if(length > 1){
        printHeader(length -1);
        printArray(length - 1, &list[1]);
    }

}

void printHeader(int length){
        std::cout << std::endl <<"Array contains "<< length<< " elements:" << std::endl;
}

void printArray(int length, char** list){
        for (int i = 0; i < length; i++) {
            std::cout << i << ": " << list[i] << std::endl;
        }

}

- set a BP inside 'printArray' function
- run it with some arguments
- start debugging
- when it stops at BP call Debug->Stack->Pop Topmost Call
Result: Debugger goes to 'printArguments' function instead of main
Comment 1 Alexander Pepin 2009-10-23 16:04:59 UTC
please interpret "run it with some arguments" as "set some arguments in 'Project Properties'->Run->Arguments"
Comment 2 Egor Ushakov 2009-10-27 10:10:32 UTC
java works the same way...
Comment 3 Egor Ushakov 2009-10-27 10:32:27 UTC
sun studio also works the same
Comment 4 soldatov 2014-12-08 15:51:41 UTC
Now "Pop Topmost Call" works as Step Out and it is not a true. Dbx and Java debugger has other (correct) behavior.
Dev-team can downgrade or use "Will Not Fix" status in order to close bug.
Comment 5 soldatov 2014-12-08 17:45:24 UTC
More clear test case (First comment contains wrong conclusion. "Result: Debugger goes to 'printArguments' function instead of main" line should be ignored):

#include <stdio.h>
void A();
void B();
void C();

void A() {
    B();
    puts("A");
}
void B() {
    C(); // expected current line after Pop Topmost Call
    puts("B"); // real current line
}
void C() {
    puts("C"); // set line breakpoint in this line
}
int main(int argc, char** argv) {
    A();
    return 0;
}
Comment 6 henk89 2015-03-16 14:14:02 UTC
Fixed in:
http://hg.netbeans.org/cnd-main/rev/4ece296df7cb