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: | Call Stack Window should show function(args...) | ||
---|---|---|---|
Product: | cnd | Reporter: | Nikolay Molchanov <nikmolchanov> |
Component: | Debugger | Assignee: | Egor Ushakov <gorrus> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | ||
Priority: | P3 | ||
Version: | 5.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 88346 |
Description
Nikolay Molchanov
2006-10-13 03:46:04 UTC
Reassigning because I've got too many IZs to fix by FCS. The root of the problem was in method getCSFName in CallStackNodeModel class. It had the following logic scheme: * By default return file name. * If file name is not available, return function name. * If function name is not available, return address. * If function name and address are not available, return "??". The suggested fix is to change the logic scheme to return function name by default (please, see details below). The fix is integrated in "release55" branch, and will be available in nightly build 10/20/2006. Tag: release55 User: NikMolchanov Date: 2006/10/18 23:17:10 Modified: cnd/gdb/src/org/netbeans/modules/cnd/debugger/gdb/models/CallStackNodeModel.java Log: IZ 87053 Call Stack Window should show function(args...) - Changed logic scheme in method getCSFName(Session s, CallStackFrame csf, boolean l) and added javadoc comments: /** * Gets Call Stack Frame name. * Logic scheme: * By default return function name. * If function name is not available, return address. * If function name and address are not available, return filename. * * @param s Session * @param csf Call Stack Frame * @param l A boolean flag to define filename format (l=true means fullname) * @return Call Stack Frame name. */ File Changes: Directory: /cnd/gdb/src/org/netbeans/modules/cnd/debugger/gdb/models/ ===================================================================== File [changed]: CallStackNodeModel.java Url: http://cnd.netbeans.org/source/browse/cnd/gdb/src/org/netbeans/modules/cnd/debugger/gdb/models/CallStackNodeModel.java?r1=1.2.2.1&r2=1.2.2.2 Delta lines: +26 -7 -------------------- --- CallStackNodeModel.java 23 Aug 2006 17:58:07 -0000 1.2.2.1 +++ CallStackNodeModel.java 19 Oct 2006 06:17:08 -0000 1.2.2.2 @@ -132,19 +132,38 @@ } } + /** + * Gets Call Stack Frame name. + * Logic scheme: + * By default return function name. + * If function name is not available, return address. + * If function name and address are not available, return filename. + * + * @param s Session + * @param csf Call Stack Frame + * @param l A boolean flag to define filename format (l=true means fullname) + * @return Call Stack Frame name. + */ public static String getCSFName(Session s, CallStackFrame csf, boolean l) { + final String DOUBLE_QUESTION = "??"; // NOI18N + // By default return function name + String functionName = csf.getFunctionName(); + if (functionName != null && !functionName.equals(DOUBLE_QUESTION)) { + return functionName; + } + // If function name is not available, return address + if (csf.getAddr() != null) { + return NbBundle.getMessage(CallStackNodeModel.class, + "CTL_CallstackModel_Msg_Format", csf.getAddr()); // NOI18N + } + // If function name and address are not available, return filename int ln = csf.getLineNumber(); String fileName = l ? csf.getFullname() : csf.getFileName(); if (ln < 0) { if (fileName != null) { return fileName; - } else if (csf.getFunctionName() != null && !csf.getFunctionName().equals("??")) { // NOI18N - return csf.getFunctionName(); - } else if (csf.getAddr() != null) { - return NbBundle.getMessage(CallStackNodeModel.class, - "CTL_CallstackModel_Msg_Format", csf.getAddr()); // NOI18N } else { - return "??"; // NOI18N + return DOUBLE_QUESTION; } } return fileName + ":" + ln; // NOI18N --------------------------------------------------------------------- *** Issue 87135 has been marked as a duplicate of this issue. *** I think we went from showing the wrong information to showing too little information. The current implementation shows only the function name (by default). There is a Location columm but its not on by default. It also only shows filename, so there is now no way of seeing line number from the callstack. Suggested fix: Show both function, file, and line number. This would be the closest result to what netbeans does (class.method:lnum). Should the file part be absolute, relative, or basename? I think basename is enough, but perhaps some wouldn't mind seeing several mock-ups to be sure. Although the original bug asked for arguments, lets defer that for cnd1. I added line number, so now call stack shows the foillowing information: function name (parameters) | full file name : line number First off, I'm only seeing arguments for the top frame. Subsequent frames have no arguments. I'm also not seeing any locator information (file name and line number). See my comment on Oct 26th in reference to what I'm looking for here. Filename issue was fixed according to last comments by next commit: Checking in GdbProxyVL.java; /shared/data/ccvs/repository/cnd/gdb/src/org/netbeans/modules/cnd/debugger/gdb/GdbProxyVL.java,v <-- GdbProxyVL.java new revision: 1.2.2.22; previous revision: 1.2.2.21 Checking in models/CallStackNodeModel.java; /shared/data/ccvs/repository/cnd/gdb/src/org/netbeans/modules/cnd/debugger/gdb/models/CallStackNodeModel.java,v <-- CallStackNodeModel.java new revision: 1.2.2.3; previous revision: 1.2.2.2 There is a presentation issue -- how we should show filename and method name in our call stack window? MS VS use next notation: ModuleName!ClassName::method(Type variable=value) Line 40 NB notation for Java (note that there is no args in NB atm) ClassName.method:40 I've used next notation cause VS one is too far away from NB standards. ClassName::method; FileName:40 Also I've changed args to be more like in VS, because it looks more readable, and there is no standards in NB yet. Fixed if suggested presentation issue is acceptable. I've reported leftover problem with arguments shows only for top function in stack as separate issue (IZ #88789) Reopened issue and change it to enhancement cause this feature wasn't an actual customer request. See a comment I made to 88789 about why the 1st attempt at fixing this may have failed. The callstack doesn't show any arguments, but they're shown in Local Variables. This is exactly what the Java debugger does. Closing as WILLNOTFIX. The absence of actual values of parameters in call stack is very annoying. MS VS shows them as well as many other debuggers. "Local" window does not help since I can see only last stack frame there, but I need to see all frames. we can get arguments for all stack levels using: -stack-list-arguments 0 correction: -stack-list-arguments 1 initial implementation in: http://hg.netbeans.org/cnd-main/rev/2a97d4a24914 Still some things need to be implemented: - now we show value type, maybe we need to hide it - strings may be too long - structures values may be in a strange form (e.g. stl string) marked as fixed verified in build 20090505 |