Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Khouzam2012-01-24 14:43:55 -0500
committerMarc Khouzam2012-01-24 14:43:55 -0500
commitb9a036ecdaf598b3d3a289bb1eb65c92e0a2501c (patch)
tree25ff8690e412639171e591b6cd40ca719e1fbd74
parent6733c8df4238752cfe93bc75a57f168d42fc2c42 (diff)
downloadorg.eclipse.cdt-b9a036ecdaf598b3d3a289bb1eb65c92e0a2501c.tar.gz
org.eclipse.cdt-b9a036ecdaf598b3d3a289bb1eb65c92e0a2501c.tar.xz
org.eclipse.cdt-b9a036ecdaf598b3d3a289bb1eb65c92e0a2501c.zip
Bug 369569: With GDB 7.4, breakpoints on invalid lines succeed as pending breakpoints
-rw-r--r--dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_4/MIBreakpointsTest_7_4.java39
1 files changed, 39 insertions, 0 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_4/MIBreakpointsTest_7_4.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_4/MIBreakpointsTest_7_4.java
index d6b7eba1b5..11a8a64f34 100644
--- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_4/MIBreakpointsTest_7_4.java
+++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/tests_7_4/MIBreakpointsTest_7_4.java
@@ -10,10 +10,18 @@
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_4;
+import static org.junit.Assert.assertTrue;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.cdt.dsf.debug.service.IBreakpoints.IBreakpointDMContext;
+import org.eclipse.cdt.dsf.mi.service.MIBreakpointDMData;
import org.eclipse.cdt.tests.dsf.gdb.framework.BackgroundRunner;
import org.eclipse.cdt.tests.dsf.gdb.tests.ITestConstants;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_3.MIBreakpointsTest_7_3;
import org.junit.BeforeClass;
+import org.junit.Test;
import org.junit.runner.RunWith;
@RunWith(BackgroundRunner.class)
@@ -22,4 +30,35 @@ public class MIBreakpointsTest_7_4 extends MIBreakpointsTest_7_3 {
public static void beforeClassMethod_7_4() {
setGdbProgramNamesLaunchAttributes(ITestConstants.SUFFIX_GDB_7_4);
}
+
+ /*
+ * Starting with GDB 7.4, breakpoints at invalid lines succeed and become
+ * pending breakpoints. This is because the invalid line for one file,
+ * may be valid for another file with the same name.
+ * One could argue that line 0 is an exception, but GDB does not make
+ * a difference.
+ * @see org.eclipse.cdt.tests.dsf.gdb.tests.MIBreakpointsTest#insertBreakpoint_InvalidLineNumber()
+ */
+ @Override
+ @Test
+ public void insertBreakpoint_InvalidLineNumber() throws Throwable {
+
+ // Create a line breakpoint
+ Map<String, Object> breakpoint = new HashMap<String, Object>();
+ breakpoint.put(BREAKPOINT_TYPE_TAG, BREAKPOINT_TAG);
+ breakpoint.put(FILE_NAME_TAG, SOURCE_FILE);
+ breakpoint.put(LINE_NUMBER_TAG, 0);
+
+ // Perform the test
+ IBreakpointDMContext ref = insertBreakpoint(fBreakpointsDmc, breakpoint);
+ assertTrue(fWait.getMessage(), fWait.isOK());
+
+ // Ensure that no BreakpointEvent was received
+ assertTrue("BreakpointEvent problem: expected " + 1 + " BREAKPOINT event(s), received "
+ + fBreakpointEventCount, fBreakpointEventCount == 1);
+
+ MIBreakpointDMData bpData = (MIBreakpointDMData) getBreakpoint(ref);
+ assertTrue("Breakpoint should be pending", bpData.isPending());
+ assertTrue("Breakpoint mismatch should be enabled", bpData.isEnabled());
+ }
}

Back to the top