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.
Summary: | *Gdb-lite* Implement "Step Out" action | ||
---|---|---|---|
Product: | cnd | Reporter: | Nikolay Molchanov <nikmolchanov> |
Component: | Debugger | Assignee: | Nikolay Molchanov <nikmolchanov> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | ||
Priority: | P1 | ||
Version: | 5.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: |
Description
Nikolay Molchanov
2006-07-14 06:51:45 UTC
Unfortunately there is no good support for "Step Out" in gdb, so it is not clear how to implement it. Actually there is "finish" command in gdb ("-exec-finish" in GDB/MI), which does exactly what we need to implement this feature (great thanks to Gordon - he helped me to find it). I upgraded priority to P1 because this feature should be implemented in Milestone 2B. The suggested fix is to connect button "Step Out" via StepActionProvider with method stepOut() in GdbDebuggerImpl.java, which calls method exec_finish() in GdbProxy.java, which sends "-exec-finish" command to gdb. To implement this solution three new methods are created: File: cnd/gdb/src/org/netbeans/modules/cnd/debugger/gdb/GdbDebuggerImpl.java /** * Resumes execution of the inferior program until * the current function is exited. */ public void stepOut() { setState(STATE_RUNNING); gdb.exec_finish(); } File: cnd/gdb/src/org/netbeans/modules/cnd/debugger/gdb/GdbProxy.java /** * Resumes the execution of the inferior program until the current * function is exited. * * @return null if action is accepted, otherwise return error message */ public String exec_finish() { String reply; reply = gdbProxyCL.exec_finish(); return (reply); } File: cnd/gdb/src/org/netbeans/modules/cnd/debugger/gdb/GdbProxyCL.java /** * Send "-exec-finish" to the debugger (finish this function) * This command resumes execution of the inferior program until * the current function is exited. * * @return null if action is accepted, otherwise return error message */ public String exec_finish() { String reply; String cmd; // Create MI command cmd = MI_CMD_EXEC_FINISH; reply = gdbProxy.gdbProxyML.sendCommand(cmd); return reply; } The fix is integrated in "cnd-nb50-dev" branch. ----------------------------------------------- Tag: cnd-nb50-dev User: NikMolchanov Date: 2006/07/14 15:53:47 Modified: cnd/gdb/src/org/netbeans/modules/cnd/debugger/gdb/GdbProxyCL.java Revision: 1.1.2.32 ------------------------------------------------ Tag: cnd-nb50-dev User: NikMolchanov Date: 2006/07/14 15:55:09 Modified: cnd/gdb/src/org/netbeans/modules/cnd/debugger/gdb/GdbProxy.java Revision: 1.1.2.21 ------------------------------------------------ Tag: cnd-nb50-dev User: NikMolchanov Date: 2006/07/14 15:56:22 Modified: cnd/gdb/src/org/netbeans/modules/cnd/debugger/gdb/GdbDebuggerImpl.java Revision: 1.1.2.17 ------------------------------------------------ Tag: cnd-nb50-dev User: NikMolchanov Date: 2006/07/14 16:00:54 Modified: cnd/gdb/src/org/netbeans/modules/cnd/debugger/gdb/actions/StepActionProvider.java Revision: 1.1.2.4 ------------------------------------------------ For now button "Step Out" is always enabled while the debugging session is active. Additional changes are necessary to disable this button while the program is running, and enable it back when the program is stopped. Is this issue ready to be marked as fixed? If so, please change it. The functionality is implemented and it seems to work just fine. I changed the status to FIXED. If there are any problems feel free to reopen this issue or file another one. |