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.
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
please interpret "run it with some arguments" as "set some arguments in 'Project Properties'->Run->Arguments"
java works the same way...
sun studio also works the same
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.
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; }
Fixed in: http://hg.netbeans.org/cnd-main/rev/4ece296df7cb