Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332778 - duplicate breakpoints when using MingW
Summary: duplicate breakpoints when using MingW
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug (show other bugs)
Version: 7.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: cdt-debug-inbox@eclipse.org CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-16 13:17 EST by Siva Velusamy CLA
Modified: 2020-09-04 15:17 EDT (History)
4 users (show)

See Also:


Attachments
The attached patch normalizes both paths before comparing them (733 bytes, patch)
2010-12-16 13:19 EST, Siva Velusamy CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Siva Velusamy CLA 2010-12-16 13:17:44 EST
Build Identifier: CDT 7.0.0

On Windows XPS, I notice that whenever a breakpoint is set in the editor, the breakpoints view shows two of them.

One of the them is installed as part of the user action, and the 2nd one is installed when the MI response of breakpoint inserted is received.

It looks like the problem is because of two styles of paths used:
C:/path/to/file.c
C:\\path\\to\\file.c

The following patch solves the issue, but I'm not fully sure if it is the right thing to do:


diff -u cvs-reorg/plugins/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java src-updated/plugins/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java
--- cvs-reorg/plugins/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java        2010-07-15 14:09:25.514221000 -0700
+++ src-updated/plugins/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java      2010-12-15 16:18:00.621082000 -0800
@@ -237,6 +237,8 @@
                                                        catch( IOException e ) {
                                                        }
                                                }
+                                                sourceHandle = new Path(sourceHandle).toOSString();
+                                                bpSourceHandle = new Path(bpSourceHandle).toOSString();
                                                return sourceHandle.equals( bpSourceHandle ) && location.getLineNumber() == ((ICLineBreakpoint)breakpoint).getLineNumber();
                                        }
                                }


Reproducible: Always

Steps to Reproduce:
1. Start debugging
2. Set a breakpoint by double clicking the marker in the editor.
3.
Comment 1 Siva Velusamy CLA 2010-12-16 13:19:16 EST
Created attachment 185350 [details]
The attached patch normalizes both paths before comparing them