1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-10 17:55:39 +02:00

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.

This commit is contained in:
Ken Ryall 2007-02-16 02:38:02 +00:00
parent eb3702d09c
commit 608dfc4e8f
3 changed files with 13 additions and 4 deletions

View file

@ -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) {

View file

@ -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);
}

View file

@ -259,4 +259,8 @@ public class MIBreakpoint {
}
}
}
public void setFile(String file) {
this.file = file;
}
}