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.
If there are 2 (or more) C/C++ debuggers enabled at the same time, when a user sets a toggle breakpoint both (all) debuggers annotate the line and you see a multi-breakpoint icon in the editor and multiple breakpoints in the breakpoint view. Currently there is no easy way to demonstrate this problem because there is only the single gdb debugger module in netbeans. However, you see this when you run sunstudio express with gdb enabled or when you run netbeans with dbxgui enabled (this is much harder to do, but can be done). Another way to demonstrate this problem is with a script I wrote called "mkgdb2". This script copies cnd.debugger.gdb to cnd.debugger.gdb2 and renames/refactors all relevant references of gdb to gdb2 (including different cases). There is also a "rmgdb2" script to back the changes out. I'll attach these scripts to this issue. So who should care about this issue? Well, its one of the problems keeping dbxgui and gdb from seemlessly coexisting. Its also a serious issue for MC because both gdb and MC's debugger will set line breakpoints when a user sets a toggle breakpoint. One possible solution relies on a proposed fix suggested in 163524. That issue binds a debugger module (or modules) to a toolchain. Given that binding, a debugger could ignore toggle breakpoints if its not the "active" debugger module for that project. I won't make this issue depend on 163524 because thats only one of many possible fixes. However, both this issue and 163524 stand in the way of coexistence of multiple C/C++ debugger.
Created attachment 80879 [details] mkgdb2 script
Created attachment 80880 [details] rmgdb2 script
I think this is a P2. If CND wants to claim it supports multiple debugger plug-ins, this needs to be fixed.
I do not agree that this is a P2, here is my point of view: The problem is that we have two ToggleBreakpointActionProviders in both debuggers and they both create different LineBreakpoints for c/c++ files. That's why we see both in breakpoints view. We can always create only one using new breakpoint dialog. When debugger starts it determines which breakpoints to use and just skips the rest. So the only problem in this issue is that users see several breakpoints created for one line, not one as they may expect. In my opinion correct solution should be: External debuggers should not create their own ToggleBreakpointActions, but use LineBreakpoints created with the default ToggleBreakpointActionProvider. We will move LineBreakpoint and the default ToggleBreakpointActionProvider into C/C++ Debugger Common package and make them public. Anyway I do not think it is a perfect timing to implement it for 6.7.
I have the following issues with the response. 1) What default LineBreakpoint? This is not CND's problem, but debuggercores. It's filed against CND only because we're more aware of the situation but the solution should be general and applicable to the whole IDE. For examples, same problem of bpt duplication, happens between jpda debugger and dbx because they both understand java. 1) What happens if a bpt is toggled in the middle of a session? How can one then detect it's creation and send a bpt command to the debugger engine? How about bpt deletion? DebuggerManager.breakpointAdded/breakpointRemoved()? 2) different debugger engines have different attributes of bpts. For example dbxgui has bpt counts and conditions and such which might work _differently_ from some other engines bpts. A default LineBreakpoint would lack any engine specific attributes.
as a first step gdb's breakpoints made common: http://hg.netbeans.org/cnd-main?cmd=changeset;node=f0809f02c46c http://hg.netbeans.org/cnd-main?cmd=changeset;node=39929622d203 http://hg.netbeans.org/cnd-main?cmd=changeset;node=504755b1df50 http://hg.netbeans.org/cnd-main?cmd=changeset;node=71404adea5cc http://hg.netbeans.org/cnd-main?cmd=changeset;node=5d3125fb430f implemented wrappers for dbx
still need an architecture to handle any number of properties in common breakpoint
all the rest is enhancement
fixed in 7.0