1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-06 17:26:01 +02:00

Breakdoine the Location hierachy

This commit is contained in:
Alain Magloire 2005-04-29 21:25:08 +00:00
parent c8d7b84191
commit a5cb855d08
6 changed files with 108 additions and 16 deletions

View file

@ -31,12 +31,13 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDIFunctionBreakpoint;
import org.eclipse.cdt.debug.core.cdi.model.ICDILineBreakpoint;
import org.eclipse.cdt.debug.core.cdi.model.ICDIWatchpoint;
import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.MIFormat;
import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.cdi.model.AddressBreakpoint;
import org.eclipse.cdt.debug.mi.core.cdi.model.AddressLocation;
import org.eclipse.cdt.debug.mi.core.cdi.model.Breakpoint;
import org.eclipse.cdt.debug.mi.core.cdi.model.Exceptionpoint;
import org.eclipse.cdt.debug.mi.core.cdi.model.FunctionBreakpoint;
import org.eclipse.cdt.debug.mi.core.cdi.model.FunctionLocation;
import org.eclipse.cdt.debug.mi.core.cdi.model.LineBreakpoint;
import org.eclipse.cdt.debug.mi.core.cdi.model.LocationBreakpoint;
import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
@ -392,10 +393,8 @@ public class BreakpointManager extends Manager {
wpoint.setMIBreakpoints(new MIBreakpoint[] {allMIBreakpoints[i]});
bList.add(wpoint);
} else {
Location location = new Location (allMIBreakpoints[i].getFile(),
allMIBreakpoints[i].getFunction(),
allMIBreakpoints[i].getLine(),
MIFormat.getBigInteger(allMIBreakpoints[i].getAddress()));
LineLocation location = new LineLocation (allMIBreakpoints[i].getFile(),
allMIBreakpoints[i].getLine());
// By default new breakpoint are LineBreakpoint
Breakpoint newBreakpoint = new LineBreakpoint(target, type, location, condition);
newBreakpoint.setMIBreakpoints(new MIBreakpoint[] {allMIBreakpoints[i]});
@ -768,8 +767,8 @@ public class BreakpointManager extends Manager {
synchronized(exceptionBps) {
int id = EXCEPTION_THROW_IDX;
if (exceptionBps[EXCEPTION_THROW_IDX] == null) {
Location location = new Location(null, EXCEPTION_FUNCS[id]);
LineBreakpoint bp = new LineBreakpoint(target, ICDIBreakpoint.REGULAR, location, null);
FunctionLocation location = new FunctionLocation(null, EXCEPTION_FUNCS[id]);
FunctionBreakpoint bp = new FunctionBreakpoint(target, ICDIBreakpoint.REGULAR, location, null);
setLocationBreakpoint(bp);
exceptionBps[id] = bp;
miBreakpoints = bp.getMIBreakpoints();
@ -780,8 +779,8 @@ public class BreakpointManager extends Manager {
synchronized(exceptionBps) {
int id = EXCEPTION_THROW_IDX;
if (exceptionBps[id] == null) {
Location location = new Location(null, EXCEPTION_FUNCS[id]);
LineBreakpoint bp = new LineBreakpoint(target, ICDIBreakpoint.REGULAR, location, null);
FunctionLocation location = new FunctionLocation(null, EXCEPTION_FUNCS[id]);
FunctionBreakpoint bp = new FunctionBreakpoint(target, ICDIBreakpoint.REGULAR, location, null);
setLocationBreakpoint(bp);
exceptionBps[id] = bp;
if (miBreakpoints != null) {
@ -813,16 +812,16 @@ public class BreakpointManager extends Manager {
return new Condition(ignoreCount, expression, tids);
}
public Location createLineLocation(String file, int line) {
return new Location(file, line);
public LineLocation createLineLocation(String file, int line) {
return new LineLocation(file, line);
}
public Location createFunctionLocation(String file, String function) {
return new Location(file, function);
public FunctionLocation createFunctionLocation(String file, String function) {
return new FunctionLocation(file, function);
}
public Location createAddressLocation(BigInteger address) {
return new Location(address);
public AddressLocation createAddressLocation(BigInteger address) {
return new AddressLocation(address);
}
MIBreakInsert[] createMIBreakInsert(LocationBreakpoint bkpt) throws CDIException {

View file

@ -0,0 +1,22 @@
/*******************************************************************************
* Copyright (c) 2000, 2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.debug.mi.core.cdi;
import org.eclipse.cdt.debug.core.cdi.ICDIFileLocation;
public class FileLocation extends Location implements ICDIFileLocation {
public FileLocation(String file) {
super(file);
}
}

View file

@ -0,0 +1,22 @@
/*******************************************************************************
* Copyright (c) 2000, 2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.debug.mi.core.cdi;
import org.eclipse.cdt.debug.core.cdi.ICDILineLocation;
public class LineLocation extends Location implements ICDILineLocation {
public LineLocation(String file, int line) {
super(file, line);
}
}

View file

@ -20,7 +20,7 @@ import org.eclipse.cdt.debug.core.cdi.ICDILocation;
/**
*/
public class Location implements ICDIFileLocation, ICDILineLocation, ICDIFunctionLocation, ICDIAddressLocation {
public class Location implements ICDIFunctionLocation, ICDIAddressLocation {
BigInteger fAddress = null;
String fFile = null;

View file

@ -0,0 +1,26 @@
/*******************************************************************************
* Copyright (c) 2000, 2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.debug.mi.core.cdi.model;
import java.math.BigInteger;
import org.eclipse.cdt.debug.core.cdi.ICDIAddressLocation;
import org.eclipse.cdt.debug.mi.core.cdi.Location;
public class AddressLocation extends Location implements ICDIAddressLocation {
public AddressLocation(BigInteger address) {
super(address);
// TODO Auto-generated constructor stub
}
}

View file

@ -0,0 +1,23 @@
/*******************************************************************************
* Copyright (c) 2000, 2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.debug.mi.core.cdi.model;
import org.eclipse.cdt.debug.core.cdi.ICDIFunctionLocation;
import org.eclipse.cdt.debug.mi.core.cdi.Location;
public class FunctionLocation extends Location implements ICDIFunctionLocation {
public FunctionLocation(String file, String function) {
super(file, function);
}
}