Bug 112008 - Comparing line breakpoints in CBreakpointManager$BreakpointMap
Summary: Comparing line breakpoints in CBreakpointManager$BreakpointMap
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug (show other bugs)
Version: 3.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.0.1   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2005-10-07 20:39 EDT by Matthias Spycher CLA
Modified: 2008-06-19 13:25 EDT (History)
2 users (show)

See Also:


Attachments
suggested patch for isSameBreakpoint() (2.33 KB, patch)
2005-10-07 21:04 EDT, Matthias Spycher CLA
bjorn.freeman-benson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Spycher CLA 2005-10-07 20:39:40 EDT
If I set a breakpoint in an external file (not part of a project) that is
mounted via NFS on a unix host and add the corresponding directory to the list
of source-lookup paths in the launch configuration, the breakpoint manager fails
to identify the breakpoint and automatically creates a new one (duplicate) in
the breakpoints view upon suspension of the program. The only difference between
the two breakpoints is that one refers to the file using an absolute path, while
the other refers to the file using a canonical path. For example:

absolute path : /a/b/c.h
canonical path: /network/a/b/c.h

The problem lies in the comparison of line breakpoints inside the method
CBreakpointManager$BreakpointMap.isSameBreakpoint(). I suspect that the
sourceHandle should be converted to a canonical path before it is used to
compare paths, but only if the sourceElement is not an instanceof IFile.
Comment 1 Matthias Spycher CLA 2005-10-07 21:04:34 EDT
Created attachment 28079 [details]
suggested patch for isSameBreakpoint()

Also includes a fix for NPE described here:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=111828
Comment 2 Nobody - feel free to take it CLA 2005-10-20 13:40:24 EDT
(In reply to comment #0)
> If I set a breakpoint in an external file (not part of a project) that is
> mounted via NFS on a unix host and add the corresponding directory to the list
> of source-lookup paths in the launch configuration, the breakpoint manager 
fails
> to identify the breakpoint and automatically creates a new one (duplicate) in
> the breakpoints view upon suspension of the program. The only difference 
between
> the two breakpoints is that one refers to the file using an absolute path, 
while
> the other refers to the file using a canonical path. For example:
> absolute path : /a/b/c.h
> canonical path: /network/a/b/c.h
> The problem lies in the comparison of line breakpoints inside the method
> CBreakpointManager$BreakpointMap.isSameBreakpoint(). I suspect that the
> sourceHandle should be converted to a canonical path before it is used to
> compare paths, but only if the sourceElement is not an instanceof IFile.

Actually, only LocalFileStorage.getFullPath() returns a canonical path. The 
code has to be changed to check if the source element is an instance of 
LocalFileStorage.
Comment 3 Nobody - feel free to take it CLA 2005-10-24 13:33:07 EDT
Applied with modifications to the HEAD and 3.0.1 branches.
Can you please try it?
Thank you.
Comment 4 Matthias Spycher CLA 2005-11-21 16:52:01 EST
(In reply to comment #3)

I tested with CDT 3.0.1 and it now works as expected.
Thanks
Comment 5 Nobody - feel free to take it CLA 2005-11-21 17:34:27 EST
Thanks.
Comment 6 Doug Schaefer CLA 2008-06-03 14:22:00 EDT
assigning 
Comment 7 Doug Schaefer CLA 2008-06-03 14:22:19 EDT
done