Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikhail Khodjaiants2004-09-07 16:43:45 -0400
committerMikhail Khodjaiants2004-09-07 16:43:45 -0400
commita315994318e197359f6103a3602ae3431107b9de (patch)
tree85600d9e69d230e33dcb57c3031c034555060dd6 /debug/org.eclipse.cdt.debug.ui.tests/core/org
parente452d260ffc97ba5d95b651af87b4acd35d8d2f8 (diff)
downloadorg.eclipse.cdt-a315994318e197359f6103a3602ae3431107b9de.tar.gz
org.eclipse.cdt-a315994318e197359f6103a3602ae3431107b9de.tar.xz
org.eclipse.cdt-a315994318e197359f6103a3602ae3431107b9de.zip
Moved to the new breakpoint management API.
Diffstat (limited to 'debug/org.eclipse.cdt.debug.ui.tests/core/org')
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/BreakpointTests.java190
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/DebugTests.java14
-rw-r--r--debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/LocationTests.java32
3 files changed, 113 insertions, 123 deletions
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/BreakpointTests.java b/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/BreakpointTests.java
index f74a9c2ff16..2cdbcd0fa44 100644
--- a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/BreakpointTests.java
+++ b/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/BreakpointTests.java
@@ -7,15 +7,12 @@ package org.eclipse.cdt.debug.core.tests;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
-
import junit.extensions.TestSetup;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
-
import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.debug.core.cdi.CDIException;
-import org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager;
import org.eclipse.cdt.debug.core.cdi.ICDICondition;
import org.eclipse.cdt.debug.core.cdi.ICDILocation;
import org.eclipse.cdt.debug.core.cdi.ICDISession;
@@ -167,29 +164,29 @@ public class BreakpointTests extends TestCase {
*/
public void testFunctionBreak() throws CoreException, MIException, IOException, CDIException, InterruptedException {
ICDISession session;
- ICDIBreakpointManager breaks;
+ ICDITarget cdiTarget;
ICDILocation location;
boolean caught = false;
session = CDebugHelper.createSession("main", testProject);
assertNotNull(session);
- breaks = session.getBreakpointManager();
- assertNotNull(breaks);
+ cdiTarget = session.getCurrentTarget();
+ assertNotNull(cdiTarget);
/***********************************************************************
* Create a break point on a generic function
**********************************************************************/
- location = breaks.createLocation(null, "func1", 0);
+ location = cdiTarget.createLocation(null, "func1", 0);
assertNotNull(location);
- breaks.setLocationBreakpoint(0, location, null, null);
+ cdiTarget.setLocationBreakpoint(0, location, null, null, false);
/***********************************************************************
* Create a break point on main
**********************************************************************/
- location = breaks.createLocation(null, "main", 0);
+ location = cdiTarget.createLocation(null, "main", 0);
assertNotNull(location);
- breaks.setLocationBreakpoint(0, location, null, null);
+ cdiTarget.setLocationBreakpoint(0, location, null, null, false);
/***********************************************************************
* Try to create a break point on a function name that does not exist We
@@ -197,25 +194,25 @@ public class BreakpointTests extends TestCase {
* CDIException
**********************************************************************/
- location = breaks.createLocation(null, "badname", 0);
+ location = cdiTarget.createLocation(null, "badname", 0);
assertNotNull(location);
try {
- breaks.setLocationBreakpoint(0, location, null, null);
+ cdiTarget.setLocationBreakpoint(0, location, null, null, false);
} catch (CDIException e) {
caught = true;
}
assertTrue(caught);
- breaks.deleteAllBreakpoints();
+ cdiTarget.deleteAllBreakpoints();
/***********************************************************************
* Create a break point on a generic function and see if it will get hit
* and stop program execution.
**********************************************************************/
- location = breaks.createLocation(null, "func1", 0);
+ location = cdiTarget.createLocation(null, "func1", 0);
assertNotNull(location);
- breaks.setLocationBreakpoint(0, location, null, null);
+ cdiTarget.setLocationBreakpoint(0, location, null, null, false);
targets = session.getTargets();
/*
* We better only have one target connected to this session or something
@@ -262,27 +259,27 @@ public class BreakpointTests extends TestCase {
* expected.
*/
public void testLineBreak() throws CoreException, MIException, IOException, CDIException, InterruptedException {
- ICDIBreakpointManager breaks;
+ ICDITarget cdiTarget;
ICDILocation location;
boolean caught = false;
session = CDebugHelper.createSession("main", testProject);
assertNotNull(session);
- breaks = session.getBreakpointManager();
- assertNotNull(breaks);
+ cdiTarget = session.getCurrentTarget();
+ assertNotNull(cdiTarget);
/***********************************************************************
* Create a break point in a generic function
**********************************************************************/
- location = breaks.createLocation("main.c", null, 7);
+ location = cdiTarget.createLocation("main.c", null, 7);
assertNotNull(location);
- breaks.setLocationBreakpoint(0, location, null, null);
+ cdiTarget.setLocationBreakpoint(0, location, null, null, false);
/***********************************************************************
* Create a break point in main
**********************************************************************/
- location = breaks.createLocation("main.c", null, 18);
+ location = cdiTarget.createLocation("main.c", null, 18);
assertNotNull(location);
- breaks.setLocationBreakpoint(0, location, null, null);
+ cdiTarget.setLocationBreakpoint(0, location, null, null, false);
/***********************************************************************
* Try to create a break point on a line that does not exist We expect
@@ -290,10 +287,10 @@ public class BreakpointTests extends TestCase {
* CDIException
**********************************************************************/
- location = breaks.createLocation("main.c", null, 30);
+ location = cdiTarget.createLocation("main.c", null, 30);
assertNotNull(location);
try {
- breaks.setLocationBreakpoint(0, location, null, null);
+ cdiTarget.setLocationBreakpoint(0, location, null, null, false);
} catch (CDIException e) {
caught = true;
}
@@ -304,9 +301,9 @@ public class BreakpointTests extends TestCase {
* Try to create a break point on a line that does not have code on it
**********************************************************************/
- location = breaks.createLocation("main.c", null, 11);
+ location = cdiTarget.createLocation("main.c", null, 11);
assertNotNull(location);
- breaks.setLocationBreakpoint(0, location, null, null);
+ cdiTarget.setLocationBreakpoint(0, location, null, null, false);
/***********************************************************************
* Create a break point in a generic function without passing the source
@@ -315,29 +312,29 @@ public class BreakpointTests extends TestCase {
* and once with an invalid line number, and the first should always
* succeed and the second should always throw an exception.
**********************************************************************/
- location = breaks.createLocation(null, null, 7);
+ location = cdiTarget.createLocation(null, null, 7);
assertNotNull(location);
- breaks.setLocationBreakpoint(0, location, null, null);
+ cdiTarget.setLocationBreakpoint(0, location, null, null, false);
caught = false;
- location = breaks.createLocation(null, null, 30);
+ location = cdiTarget.createLocation(null, null, 30);
assertNotNull(location);
try {
- breaks.setLocationBreakpoint(0, location, null, null);
+ cdiTarget.setLocationBreakpoint(0, location, null, null, false);
} catch (CDIException e) {
caught = true;
}
assertTrue("Ignoring line numbers with no file specified?", caught);
- breaks.deleteAllBreakpoints();
+ cdiTarget.deleteAllBreakpoints();
/***********************************************************************
* Create a break point on a line number and see if it will get hit and
* stop program execution.
**********************************************************************/
- location = breaks.createLocation(null, null, 7);
+ location = cdiTarget.createLocation(null, null, 7);
assertNotNull(location);
- breaks.setLocationBreakpoint(0, location, null, null);
+ cdiTarget.setLocationBreakpoint(0, location, null, null, false);
targets = session.getTargets();
/*
* We better only have one target connected to this session or something
@@ -377,19 +374,19 @@ public class BreakpointTests extends TestCase {
* A couple tests to make sure getting breakpoints works as expected
*/
public void testGetBreak() throws CoreException, MIException, IOException, CDIException {
- ICDIBreakpointManager breaks;
+ ICDITarget cdiTarget;
ICDILocation location;
ICDIBreakpoint[] breakpoints;
ICDILocationBreakpoint curbreak;
session = CDebugHelper.createSession("main", testProject);
assertNotNull(session);
- breaks = session.getBreakpointManager();
- assertNotNull(breaks);
+ cdiTarget = session.getCurrentTarget();
+ assertNotNull(cdiTarget);
/***********************************************************************
* Make sure initially we don't have any breakpoints
**********************************************************************/
- breakpoints = breaks.getBreakpoints();
+ breakpoints = cdiTarget.getBreakpoints();
assertNotNull(breakpoints);
assertTrue(breakpoints.length == 0);
@@ -398,11 +395,11 @@ public class BreakpointTests extends TestCase {
* from the system
**********************************************************************/
/* Create a break point on a generic function */
- location = breaks.createLocation("main.c", "func1", 0);
+ location = cdiTarget.createLocation("main.c", "func1", 0);
assertNotNull(location);
- breaks.setLocationBreakpoint(0, location, null, null);
+ cdiTarget.setLocationBreakpoint(0, location, null, null, false);
- breakpoints = breaks.getBreakpoints();
+ breakpoints = cdiTarget.getBreakpoints();
assertNotNull(breakpoints);
assertTrue(breakpoints.length == 1);
if (breakpoints[0] instanceof ICDILocationBreakpoint) {
@@ -418,11 +415,11 @@ public class BreakpointTests extends TestCase {
* them all back from the system,
**********************************************************************/
/* Create another break point on main */
- location = breaks.createLocation("main.c", "main", 0);
+ location = cdiTarget.createLocation("main.c", "main", 0);
assertNotNull(location);
- breaks.setLocationBreakpoint(0, location, null, null);
+ cdiTarget.setLocationBreakpoint(0, location, null, null, false);
- breakpoints = breaks.getBreakpoints();
+ breakpoints = cdiTarget.getBreakpoints();
assertNotNull(breakpoints);
assertTrue(breakpoints.length == 2);
if (breakpoints[1] instanceof ICDILocationBreakpoint) {
@@ -435,7 +432,7 @@ public class BreakpointTests extends TestCase {
*/
assertTrue(curbreak.getLocation().equals(location));
- breaks.deleteAllBreakpoints();
+ cdiTarget.deleteAllBreakpoints();
/* clean up the session */
session.terminate();
@@ -447,18 +444,18 @@ public class BreakpointTests extends TestCase {
* A couple tests to make sure deleting breakpoints works as expected
*/
public void testDelBreak() throws CoreException, MIException, IOException, CDIException {
- ICDIBreakpointManager breaks;
+ ICDITarget cdiTarget;
ICDILocation location, savedLocation;
ICDIBreakpoint[] breakpoints, savedbreakpoints;
ICDILocationBreakpoint curbreak;
session = CDebugHelper.createSession("main", testProject);
assertNotNull(session);
- breaks = session.getBreakpointManager();
- assertNotNull(breaks);
+ cdiTarget = session.getCurrentTarget();
+ assertNotNull(cdiTarget);
/* Make sure initially we don't have any breakpoints */
- breakpoints = breaks.getBreakpoints();
+ breakpoints = cdiTarget.getBreakpoints();
assertNotNull(breakpoints);
assertTrue(breakpoints.length == 0);
@@ -470,15 +467,15 @@ public class BreakpointTests extends TestCase {
**********************************************************************/
/* Create a break point on a generic function */
- location = breaks.createLocation("main.c", "func1", 0);
+ location = cdiTarget.createLocation("main.c", "func1", 0);
assertNotNull(location);
- curbreak = breaks.setLocationBreakpoint(0, location, null, null);
- breaks.deleteBreakpoint(curbreak);
+ curbreak = cdiTarget.setLocationBreakpoint(0, location, null, null, false);
+ cdiTarget.deleteBreakpoints( new ICDIBreakpoint[] { curbreak } );
pause();
/**
* we should not have any breakpoints left.
*/
- breakpoints = breaks.getBreakpoints();
+ breakpoints = cdiTarget.getBreakpoints();
assertTrue(breakpoints.length == 0);
/***********************************************************************
@@ -489,17 +486,17 @@ public class BreakpointTests extends TestCase {
**********************************************************************/
/* Create a break point on a generic function */
- location = breaks.createLocation("main.c", "func1", 0);
+ location = cdiTarget.createLocation("main.c", "func1", 0);
assertNotNull(location);
- curbreak = breaks.setLocationBreakpoint(0, location, null, null);
+ curbreak = cdiTarget.setLocationBreakpoint(0, location, null, null, false);
savedLocation = curbreak.getLocation();
- location = breaks.createLocation("main.c", "main", 0);
+ location = cdiTarget.createLocation("main.c", "main", 0);
assertNotNull(location);
- curbreak = breaks.setLocationBreakpoint(0, location, null, null);
- breaks.deleteBreakpoint(curbreak);
+ curbreak = cdiTarget.setLocationBreakpoint(0, location, null, null, false);
+ cdiTarget.deleteBreakpoints( new ICDIBreakpoint[] { curbreak } );
pause();
- breakpoints = breaks.getBreakpoints();
+ breakpoints = cdiTarget.getBreakpoints();
/***********************************************************************
* Make sure there is only 1 breakpoint left, and it's the one we expect
*/
@@ -510,9 +507,9 @@ public class BreakpointTests extends TestCase {
/***********************************************************************
* Then delete the other breakpoint.
*/
- breaks.deleteBreakpoint(curbreak);
+ cdiTarget.deleteBreakpoints( new ICDIBreakpoint[] { curbreak } );
pause();
- breakpoints = breaks.getBreakpoints();
+ breakpoints = cdiTarget.getBreakpoints();
assertTrue(breakpoints.length == 0);
/***********************************************************************
@@ -520,23 +517,23 @@ public class BreakpointTests extends TestCase {
**********************************************************************/
savedbreakpoints = new ICDIBreakpoint[1];
for (int x = 0; x < 10; x++) {
- location = breaks.createLocation("main.c", null, x + 1);
- savedbreakpoints[0] = breaks.setLocationBreakpoint(0, location, null, null);
+ location = cdiTarget.createLocation("main.c", null, x + 1);
+ savedbreakpoints[0] = cdiTarget.setLocationBreakpoint(0, location, null, null, false);
assertNotNull(savedbreakpoints[0]);
}
- breaks.deleteBreakpoints(savedbreakpoints);
+ cdiTarget.deleteBreakpoints(savedbreakpoints);
pause();
/* We should now have 9 breakpoints left. */
- breakpoints = breaks.getBreakpoints();
+ breakpoints = cdiTarget.getBreakpoints();
assertTrue(breakpoints.length == 9);
/* Make sure we have the correct 9 breakpoints left */
for (int x = 0; x < breakpoints.length; x++) {
curbreak = (ICDILocationBreakpoint) breakpoints[x];
assertTrue(curbreak.getLocation().getLineNumber() == x + 1);
}
- breaks.deleteAllBreakpoints();
+ cdiTarget.deleteAllBreakpoints();
pause();
- assertTrue(breaks.getBreakpoints().length == 0);
+ assertTrue(cdiTarget.getBreakpoints().length == 0);
/***********************************************************************
* Make sure deleteBreakpoints works when given more then 1 but less
@@ -544,38 +541,38 @@ public class BreakpointTests extends TestCase {
**********************************************************************/
savedbreakpoints = new ICDIBreakpoint[4];
for (int x = 0; x < 10; x++) {
- location = breaks.createLocation("main.c", null, x + 1);
- savedbreakpoints[x % 4] = breaks.setLocationBreakpoint(0, location, null, null);
+ location = cdiTarget.createLocation("main.c", null, x + 1);
+ savedbreakpoints[x % 4] = cdiTarget.setLocationBreakpoint(0, location, null, null, false);
assertNotNull(savedbreakpoints[x % 4]);
}
- breaks.deleteBreakpoints(savedbreakpoints);
+ cdiTarget.deleteBreakpoints(savedbreakpoints);
pause();
/* We should now have 6 breakpoints left. */
- breakpoints = breaks.getBreakpoints();
+ breakpoints = cdiTarget.getBreakpoints();
assertTrue(breakpoints.length == 6);
/* Make sure we have the correct 6 breakpoints left */
for (int x = 0; x < breakpoints.length; x++) {
curbreak = (ICDILocationBreakpoint) breakpoints[x];
assertTrue(curbreak.getLocation().getLineNumber() == x + 1);
}
- breaks.deleteAllBreakpoints();
+ cdiTarget.deleteAllBreakpoints();
pause();
- assertTrue(breaks.getBreakpoints().length == 0);
+ assertTrue(cdiTarget.getBreakpoints().length == 0);
/***********************************************************************
* Make sure deleteBreakpoints works when given all the breakpoints
**********************************************************************/
savedbreakpoints = new ICDIBreakpoint[10];
for (int x = 0; x < 10; x++) {
- location = breaks.createLocation("main.c", null, x + 1);
- savedbreakpoints[x] = breaks.setLocationBreakpoint(0, location, null, null);
+ location = cdiTarget.createLocation("main.c", null, x + 1);
+ savedbreakpoints[x] = cdiTarget.setLocationBreakpoint(0, location, null, null, false);
assertNotNull(savedbreakpoints[x]);
}
- breaks.deleteBreakpoints(savedbreakpoints);
+ cdiTarget.deleteBreakpoints(savedbreakpoints);
pause();
/* We should now have 0 breakpoints left. */
- breakpoints = breaks.getBreakpoints();
+ breakpoints = cdiTarget.getBreakpoints();
assertTrue(breakpoints.length == 0);
/***********************************************************************
@@ -583,14 +580,14 @@ public class BreakpointTests extends TestCase {
**********************************************************************/
for (int x = 0; x < 10; x++) {
- location = breaks.createLocation("main.c", null, x + 1);
- curbreak = breaks.setLocationBreakpoint(0, location, null, null);
+ location = cdiTarget.createLocation("main.c", null, x + 1);
+ curbreak = cdiTarget.setLocationBreakpoint(0, location, null, null, false);
assertNotNull(curbreak);
}
- breaks.deleteAllBreakpoints();
+ cdiTarget.deleteAllBreakpoints();
pause();
/* We should now have 0 breakpoints left. */
- breakpoints = breaks.getBreakpoints();
+ breakpoints = cdiTarget.getBreakpoints();
assertTrue(breakpoints.length == 0);
/* clean up the session */
@@ -604,40 +601,37 @@ public class BreakpointTests extends TestCase {
* work as expected.
*/
public void testCondBreak() throws CoreException, MIException, IOException, CDIException, InterruptedException {
- ICDIBreakpointManager breaks;
- ICDILocation location;
- ICDICondition cond;
boolean caught = false;
session = CDebugHelper.createSession("main", testProject);
assertNotNull(session);
- breaks = session.getBreakpointManager();
- assertNotNull(breaks);
+ ICDITarget cdiTarget = session.getCurrentTarget();
+ assertNotNull(cdiTarget);
/***********************************************************************
* Create a break point on a generic function with an empty condition
**********************************************************************/
- cond = breaks.createCondition(0, "");
- location = breaks.createLocation(null, "func1", 0);
+ ICDICondition cond = cdiTarget.createCondition(0, "");
+ ICDILocation location = cdiTarget.createLocation(null, "func1", 0);
assertNotNull(location);
- breaks.setLocationBreakpoint(0, location, cond, null);
+ cdiTarget.setLocationBreakpoint(0, location, cond, null, false);
/***********************************************************************
* Create a break point on a generic function with an valid condition
**********************************************************************/
- cond = breaks.createCondition(0, "x<10");
- location = breaks.createLocation(null, "func1", 0);
+ cond = cdiTarget.createCondition(0, "x<10");
+ location = cdiTarget.createLocation(null, "func1", 0);
assertNotNull(location);
- breaks.setLocationBreakpoint(0, location, cond, null);
+ cdiTarget.setLocationBreakpoint(0, location, cond, null, false);
/***********************************************************************
* Create a break point on a generic function with an invalid condition
* We expect to get a CDIException when we try to set the breakpoint.
**********************************************************************/
- cond = breaks.createCondition(0, "nonexist<10");
- location = breaks.createLocation(null, "func1", 0);
+ cond = cdiTarget.createCondition(0, "nonexist<10");
+ location = cdiTarget.createLocation(null, "func1", 0);
assertNotNull(location);
try {
- breaks.setLocationBreakpoint(0, location, cond, null);
+ cdiTarget.setLocationBreakpoint(0, location, cond, null, false);
} catch (CDIException e) {
caught = true;
}
@@ -648,12 +642,12 @@ public class BreakpointTests extends TestCase {
* it does not suspend execution of the application until the condition
* is true
**********************************************************************/
- breaks.deleteAllBreakpoints();
- location = breaks.createLocation(null, null, 23);
+ cdiTarget.deleteAllBreakpoints();
+ location = cdiTarget.createLocation(null, null, 23);
assertNotNull(location);
- cond = breaks.createCondition(0, "a>10");
+ cond = cdiTarget.createCondition(0, "a>10");
- breaks.setLocationBreakpoint(0, location, cond, null);
+ cdiTarget.setLocationBreakpoint(0, location, cond, null, false);
targets = session.getTargets();
/*
* We better only have one target connected to this session or something
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/DebugTests.java b/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/DebugTests.java
index 6d841b05dfc..1ff0cc2e3d7 100644
--- a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/DebugTests.java
+++ b/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/DebugTests.java
@@ -8,16 +8,14 @@ package org.eclipse.cdt.debug.core.tests;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
-
import junit.framework.TestCase;
import junit.framework.TestSuite;
-
import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.debug.core.cdi.CDIException;
-import org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager;
import org.eclipse.cdt.debug.core.cdi.ICDILocation;
import org.eclipse.cdt.debug.core.cdi.ICDISession;
import org.eclipse.cdt.debug.core.cdi.ICDISourceManager;
+import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.testplugin.CDebugHelper;
import org.eclipse.cdt.debug.testplugin.CProjectHelper;
@@ -119,18 +117,18 @@ public class DebugTests extends TestCase {
*/
public void testDebug() throws CoreException, MIException, IOException, CDIException {
ICDISourceManager source;
- ICDIBreakpointManager breaks;
+ ICDITarget cdiTarget;
ICDILocation location;
session=CDebugHelper.createSession("main",testProject);
assertNotNull(session);
source=session.getSourceManager();
assertNotNull(source);
- breaks=session.getBreakpointManager();
- assertNotNull(breaks);
- location=breaks.createLocation(null, "func1", 0);
+ cdiTarget=session.getCurrentTarget();
+ assertNotNull(cdiTarget);
+ location=cdiTarget.createLocation(null, "func1", 0);
assertNotNull(location);
- breaks.setLocationBreakpoint(0, location, null, null);
+ cdiTarget.setLocationBreakpoint(0, location, null, null, false);
session.getCurrentTarget().resume();
session.terminate();
session=null;
diff --git a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/LocationTests.java b/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/LocationTests.java
index b3bdccab083..e4cb72eae90 100644
--- a/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/LocationTests.java
+++ b/debug/org.eclipse.cdt.debug.ui.tests/core/org/eclipse/cdt/debug/core/tests/LocationTests.java
@@ -8,17 +8,15 @@ package org.eclipse.cdt.debug.core.tests;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
-
import junit.framework.TestCase;
import junit.framework.TestSuite;
-
import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.debug.core.cdi.CDIException;
-import org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager;
import org.eclipse.cdt.debug.core.cdi.ICDILocation;
import org.eclipse.cdt.debug.core.cdi.ICDISession;
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint;
import org.eclipse.cdt.debug.core.cdi.model.ICDILocationBreakpoint;
+import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.testplugin.CDebugHelper;
import org.eclipse.cdt.debug.testplugin.CProjectHelper;
@@ -116,26 +114,26 @@ public class LocationTests extends TestCase {
* A couple tests to make sure comparing Locations works as expected.
*/
public void testIsEquals() throws CoreException, MIException, IOException, CDIException {
- ICDIBreakpointManager breaks;
+ ICDITarget cdiTarget;
ICDILocation location, location2;
ICDIBreakpoint[] breakpoints;
ICDILocationBreakpoint curbreak;
session=CDebugHelper.createSession("main",testProject);
assertNotNull(session);
- breaks=session.getBreakpointManager();
- assertNotNull(breaks);
+ cdiTarget=session.getCurrentTarget();
+ assertNotNull(cdiTarget);
/**********************************************************************
* Simple test.. this should work.
**********************************************************************/
- location=breaks.createLocation("main.c", "func1", 0);
- location2=breaks.createLocation("main.c", "func1", 0);
+ location=cdiTarget.createLocation("main.c", "func1", 0);
+ location2=cdiTarget.createLocation("main.c", "func1", 0);
assertTrue(location.equals(location2));
/**********************************************************************
* Simple test.. this should work.
**********************************************************************/
- location=breaks.createLocation("main.c", null, 10);
- location2=breaks.createLocation("main.c", null, 10);
+ location=cdiTarget.createLocation("main.c", null, 10);
+ location2=cdiTarget.createLocation("main.c", null, 10);
assertTrue(location.equals(location2));
/**********************************************************************
@@ -144,11 +142,11 @@ public class LocationTests extends TestCase {
* setLocationBreakpoint is the same as the breakpoint returned from
* BreakpointManager.getBreakpoints.getLocation()
**********************************************************************/
- location=breaks.createLocation("main.c", "func1", 0);
+ location=cdiTarget.createLocation("main.c", "func1", 0);
assertNotNull(location);
- location2=breaks.setLocationBreakpoint(0, location, null, null).getLocation();
+ location2=cdiTarget.setLocationBreakpoint(0, location, null, null, false).getLocation();
- breakpoints=breaks.getBreakpoints();
+ breakpoints=cdiTarget.getBreakpoints();
assertNotNull(breakpoints);
assertTrue(breakpoints.length==1);
if (breakpoints[0] instanceof ICDILocationBreakpoint) {
@@ -158,16 +156,16 @@ public class LocationTests extends TestCase {
assertNotNull(curbreak);
assertTrue(curbreak.getLocation().equals(location2));
- breaks.deleteAllBreakpoints();
+ cdiTarget.deleteAllBreakpoints();
/* Create a break point on a generic function with a file name that
* gdb will change to the relitive path of the source file. This
* should work, but at the time of writing (Sept 25, 2002) does not.
*/
- location=breaks.createLocation("main.c", "func1", 0);
+ location=cdiTarget.createLocation("main.c", "func1", 0);
assertNotNull(location);
- breaks.setLocationBreakpoint(0, location, null, null);
+ cdiTarget.setLocationBreakpoint(0, location, null, null, false);
- breakpoints=breaks.getBreakpoints();
+ breakpoints=cdiTarget.getBreakpoints();
assertNotNull(breakpoints);
assertTrue(breakpoints.length==1);
if (breakpoints[0] instanceof ICDILocationBreakpoint) {

Back to the top