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 163627 - Multiple C/C++ debuggers create multiple toggle breakpoints
Summary: Multiple C/C++ debuggers create multiple toggle breakpoints
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Egor Ushakov
URL:
Keywords:
Depends on:
Blocks: 151788
  Show dependency tree
 
Reported: 2009-04-24 18:09 UTC by _ gordonp
Modified: 2011-06-20 14:45 UTC (History)
3 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
mkgdb2 script (908 bytes, text/plain)
2009-04-24 18:10 UTC, _ gordonp
Details
rmgdb2 script (421 bytes, text/plain)
2009-04-24 18:11 UTC, _ gordonp
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ gordonp 2009-04-24 18:09:01 UTC
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.
Comment 1 _ gordonp 2009-04-24 18:10:36 UTC
Created attachment 80879 [details]
mkgdb2 script
Comment 2 _ gordonp 2009-04-24 18:11:15 UTC
Created attachment 80880 [details]
rmgdb2 script
Comment 3 Thomas Preisler 2009-04-24 18:30:13 UTC
I think this is a P2. If CND wants to claim it supports multiple debugger plug-ins, this needs to be fixed.
Comment 4 Egor Ushakov 2009-04-27 16:47:09 UTC
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.
Comment 5 ivan 2009-04-27 20:44:19 UTC
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.



   
Comment 7 Egor Ushakov 2009-08-12 14:43:44 UTC
still need an architecture to handle any number of properties in common breakpoint
Comment 8 Egor Ushakov 2009-08-19 17:17:35 UTC
all the rest is enhancement
Comment 9 Egor Ushakov 2011-06-20 14:45:03 UTC
fixed in 7.0