From 608dfc4e8f90586e9ed67bcf07a85f4962bb2f46 Mon Sep 17 00:00:00 2001 From: Ken Ryall Date: Fri, 16 Feb 2007 02:38:02 +0000 Subject: [PATCH] More refined way to address bug 102563. Also track which source file an MI break is supposed to be in even if gdb won't say after it is set. --- .../eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java | 9 +++++++++ .../org/eclipse/cdt/debug/mi/core/cdi/model/Target.java | 4 ---- .../eclipse/cdt/debug/mi/core/output/MIBreakpoint.java | 4 ++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java index 9d4fe24fbd1..e8fb7682857 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java +++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.cdt.debug.mi.core.cdi; +import java.io.File; import java.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; @@ -708,6 +709,13 @@ public class BreakpointManager extends Manager { if (points == null || points.length == 0) { throw new CDIException(CdiResources.getString("cdi.BreakpointManager.Parsing_Error")); //$NON-NLS-1$ } + // Set + if (bkpt.getFile().length() > 0) + { + for (int j = 0; j < points.length; j++) { + points[j].setFile(bkpt.getFile()); + } + } // Make sure that if the breakpoint was disable we create them disable. if (!enable) { int[] numbers = new int[points.length]; @@ -921,6 +929,7 @@ public class BreakpointManager extends Manager { if (bkpt.getLocator() != null) { ICDILocator locator = bkpt.getLocator(); String file = locator.getFile(); + file = new File(file).getName(); String function = locator.getFunction(); int no = locator.getLineNumber(); if (bkpt instanceof LineBreakpoint) { diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java index 1786001f6eb..f5f0edb69b7 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java +++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java @@ -865,10 +865,6 @@ public class Target extends SessionObject implements ICDITarget { public ICDILineBreakpoint setLineBreakpoint(int type, ICDILineLocation location, ICDICondition condition, boolean deferred) throws CDIException { BreakpointManager bMgr = ((Session)getSession()).getBreakpointManager(); - // See bug 102563. Only pass gdb the source file name, not the full path. - // This workaround was in CBreakpointManager in CDT 3.1 but has been moved - // here so that non-gdb CDI clients can get the full path. - location = createLineLocation( new Path(location.getFile()).lastSegment(), location.getLineNumber() ); return bMgr.setLineBreakpoint(this, type, location, condition, deferred); } diff --git a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIBreakpoint.java b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIBreakpoint.java index cacacfe940e..db987cf4a08 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIBreakpoint.java +++ b/debug/org.eclipse.cdt.debug.mi.core/mi/org/eclipse/cdt/debug/mi/core/output/MIBreakpoint.java @@ -259,4 +259,8 @@ public class MIBreakpoint { } } } + + public void setFile(String file) { + this.file = file; + } }