mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Breakdoine the Location hierachy
This commit is contained in:
parent
c8d7b84191
commit
a5cb855d08
6 changed files with 108 additions and 16 deletions
|
@ -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.ICDILineBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIWatchpoint;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIWatchpoint;
|
||||||
import org.eclipse.cdt.debug.mi.core.MIException;
|
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.MISession;
|
||||||
import org.eclipse.cdt.debug.mi.core.cdi.model.AddressBreakpoint;
|
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.Breakpoint;
|
||||||
import org.eclipse.cdt.debug.mi.core.cdi.model.Exceptionpoint;
|
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.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.LineBreakpoint;
|
||||||
import org.eclipse.cdt.debug.mi.core.cdi.model.LocationBreakpoint;
|
import org.eclipse.cdt.debug.mi.core.cdi.model.LocationBreakpoint;
|
||||||
import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
|
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]});
|
wpoint.setMIBreakpoints(new MIBreakpoint[] {allMIBreakpoints[i]});
|
||||||
bList.add(wpoint);
|
bList.add(wpoint);
|
||||||
} else {
|
} else {
|
||||||
Location location = new Location (allMIBreakpoints[i].getFile(),
|
LineLocation location = new LineLocation (allMIBreakpoints[i].getFile(),
|
||||||
allMIBreakpoints[i].getFunction(),
|
allMIBreakpoints[i].getLine());
|
||||||
allMIBreakpoints[i].getLine(),
|
|
||||||
MIFormat.getBigInteger(allMIBreakpoints[i].getAddress()));
|
|
||||||
// By default new breakpoint are LineBreakpoint
|
// By default new breakpoint are LineBreakpoint
|
||||||
Breakpoint newBreakpoint = new LineBreakpoint(target, type, location, condition);
|
Breakpoint newBreakpoint = new LineBreakpoint(target, type, location, condition);
|
||||||
newBreakpoint.setMIBreakpoints(new MIBreakpoint[] {allMIBreakpoints[i]});
|
newBreakpoint.setMIBreakpoints(new MIBreakpoint[] {allMIBreakpoints[i]});
|
||||||
|
@ -768,8 +767,8 @@ public class BreakpointManager extends Manager {
|
||||||
synchronized(exceptionBps) {
|
synchronized(exceptionBps) {
|
||||||
int id = EXCEPTION_THROW_IDX;
|
int id = EXCEPTION_THROW_IDX;
|
||||||
if (exceptionBps[EXCEPTION_THROW_IDX] == null) {
|
if (exceptionBps[EXCEPTION_THROW_IDX] == null) {
|
||||||
Location location = new Location(null, EXCEPTION_FUNCS[id]);
|
FunctionLocation location = new FunctionLocation(null, EXCEPTION_FUNCS[id]);
|
||||||
LineBreakpoint bp = new LineBreakpoint(target, ICDIBreakpoint.REGULAR, location, null);
|
FunctionBreakpoint bp = new FunctionBreakpoint(target, ICDIBreakpoint.REGULAR, location, null);
|
||||||
setLocationBreakpoint(bp);
|
setLocationBreakpoint(bp);
|
||||||
exceptionBps[id] = bp;
|
exceptionBps[id] = bp;
|
||||||
miBreakpoints = bp.getMIBreakpoints();
|
miBreakpoints = bp.getMIBreakpoints();
|
||||||
|
@ -780,8 +779,8 @@ public class BreakpointManager extends Manager {
|
||||||
synchronized(exceptionBps) {
|
synchronized(exceptionBps) {
|
||||||
int id = EXCEPTION_THROW_IDX;
|
int id = EXCEPTION_THROW_IDX;
|
||||||
if (exceptionBps[id] == null) {
|
if (exceptionBps[id] == null) {
|
||||||
Location location = new Location(null, EXCEPTION_FUNCS[id]);
|
FunctionLocation location = new FunctionLocation(null, EXCEPTION_FUNCS[id]);
|
||||||
LineBreakpoint bp = new LineBreakpoint(target, ICDIBreakpoint.REGULAR, location, null);
|
FunctionBreakpoint bp = new FunctionBreakpoint(target, ICDIBreakpoint.REGULAR, location, null);
|
||||||
setLocationBreakpoint(bp);
|
setLocationBreakpoint(bp);
|
||||||
exceptionBps[id] = bp;
|
exceptionBps[id] = bp;
|
||||||
if (miBreakpoints != null) {
|
if (miBreakpoints != null) {
|
||||||
|
@ -813,16 +812,16 @@ public class BreakpointManager extends Manager {
|
||||||
return new Condition(ignoreCount, expression, tids);
|
return new Condition(ignoreCount, expression, tids);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Location createLineLocation(String file, int line) {
|
public LineLocation createLineLocation(String file, int line) {
|
||||||
return new Location(file, line);
|
return new LineLocation(file, line);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Location createFunctionLocation(String file, String function) {
|
public FunctionLocation createFunctionLocation(String file, String function) {
|
||||||
return new Location(file, function);
|
return new FunctionLocation(file, function);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Location createAddressLocation(BigInteger address) {
|
public AddressLocation createAddressLocation(BigInteger address) {
|
||||||
return new Location(address);
|
return new AddressLocation(address);
|
||||||
}
|
}
|
||||||
|
|
||||||
MIBreakInsert[] createMIBreakInsert(LocationBreakpoint bkpt) throws CDIException {
|
MIBreakInsert[] createMIBreakInsert(LocationBreakpoint bkpt) throws CDIException {
|
||||||
|
|
|
@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -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;
|
BigInteger fAddress = null;
|
||||||
String fFile = null;
|
String fFile = null;
|
||||||
|
|
|
@ -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
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue