Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikhail Khodjaiants2002-08-21 22:19:12 +0000
committerMikhail Khodjaiants2002-08-21 22:19:12 +0000
commit79098bebfdcaa87b2de804f378da36c2a2fecd85 (patch)
tree91972731699dd3e690a8e269ba8c7baeec325a1f /debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt
parent2e532365b81ff2a233a634f1b9a9310d922de350 (diff)
downloadorg.eclipse.cdt-79098bebfdcaa87b2de804f378da36c2a2fecd85.tar.gz
org.eclipse.cdt-79098bebfdcaa87b2de804f378da36c2a2fecd85.tar.xz
org.eclipse.cdt-79098bebfdcaa87b2de804f378da36c2a2fecd85.zip
Added breakpoint classes.
Diffstat (limited to 'debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt')
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICAddressBreakpoint.java35
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICBreakpoint.java91
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICFunctionBreakpoint.java35
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICLineBreakpoint.java20
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CAddressBreakpoint.java74
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CBreakpoint.java132
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CFunctionBreakpoint.java73
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CLineBreakpoint.java51
8 files changed, 511 insertions, 0 deletions
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICAddressBreakpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICAddressBreakpoint.java
new file mode 100644
index 00000000000..45aecd34ef7
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICAddressBreakpoint.java
@@ -0,0 +1,35 @@
+/*
+ *(c) Copyright QNX Software Systems Ltd. 2002.
+ * All Rights Reserved.
+ *
+ */
+package org.eclipse.cdt.debug.core;
+
+import org.eclipse.core.runtime.CoreException;
+
+/**
+ *
+ * A breakpoint that suspend execution when a particular address is reached.
+ *
+ * @since Aug 21, 2002
+ */
+public interface ICAddressBreakpoint extends ICLineBreakpoint
+{
+ /**
+ * Returns the address this breakpoint suspends execution at.
+ *
+ * @return the address this breakpoint suspends execution at
+ * @exception CoreException if unable to access the property
+ * on this breakpoint's underlying marker
+ */
+ public String getAddress() throws CoreException;
+
+ /**
+ * Sets the address this breakpoint suspends execution at.
+ *
+ * @param address the address this breakpoint suspends execution at
+ * @exception CoreException if unable to access the property
+ * on this breakpoint's underlying marker
+ */
+ public void setAddress( String address ) throws CoreException;
+}
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICBreakpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICBreakpoint.java
new file mode 100644
index 00000000000..df43e3095fa
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICBreakpoint.java
@@ -0,0 +1,91 @@
+/*
+ *(c) Copyright QNX Software Systems Ltd. 2002.
+ * All Rights Reserved.
+ *
+ */
+
+package org.eclipse.cdt.debug.core;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.model.IBreakpoint;
+
+/**
+ *
+ * A breakpoint specific to the C/C++ debug model. A C/C++ breakpoint supports:
+ * <ul>
+ * <li>a condition</li>
+ * <li>an ignore count</li>
+ * <li>a thread filter to restrict a breakpoin to a specific thread</li>
+ * <li>an installed property that indicates a breakpoint was successfully
+ * installed in debug target</li>
+ * </ul>
+ *
+ * @since Aug 21, 2002
+ */
+public interface ICBreakpoint extends IBreakpoint
+{
+ /**
+ * Returns whether this breakpoint is installed in at least
+ * one debug target.
+ *
+ * @return whether this breakpoint is installed
+ * @exception CoreException if unable to access the property
+ * on this breakpoint's underlying marker
+ */
+ public boolean isInstalled() throws CoreException;
+
+ /**
+ * Returns the conditional expression associated with this breakpoint.
+ *
+ * @return this breakpoint's conditional expression
+ * @exception CoreException if unable to access the property
+ * on this breakpoint's underlying marker
+ */
+ public String getCondition() throws CoreException;
+
+ /**
+ * Sets the condition associated with this breakpoint.
+ *
+ * @param condition the conditional expression
+ * @exception CoreException if unable to access the property
+ * on this breakpoint's underlying marker
+ */
+ public void setCondition( String condition ) throws CoreException;
+
+ /**
+ * Returns the ignore count used by this breakpoint.
+ *
+ * @return the ignore count used by this breakpoint
+ * @exception CoreException if unable to access the property
+ * on this breakpoint's underlying marker
+ */
+ public int getIgnoreCount() throws CoreException;
+
+ /**
+ * Sets the ignore count attribute for this breakpoint.
+ *
+ * @param ignoreCount the new ignore count
+ * @exception CoreException if unable to access the property
+ * on this breakpoint's underlying marker
+ */
+ public void setIgnoreCount( int ignoreCount ) throws CoreException;
+
+ /**
+ * Returns the identifier of the thread this breakpoint is restricted in.
+ *
+ * @return the thread identifier
+ * @exception CoreException if unable to access the property
+ * on this breakpoint's underlying marker
+ */
+ public String getThreadId() throws CoreException;
+
+ /**
+ * Restricts this breakpoint to suspend only in the given thread
+ * when encounterd in the given thread's target.
+ *
+ * @param threadId the thread identifier
+ * @exception CoreException if unable to access the property
+ * on this breakpoint's underlying marker
+ */
+ public void setThreadId( String threadId ) throws CoreException;
+}
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICFunctionBreakpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICFunctionBreakpoint.java
new file mode 100644
index 00000000000..fd2e6bdf2e2
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICFunctionBreakpoint.java
@@ -0,0 +1,35 @@
+/*
+ *(c) Copyright QNX Software Systems Ltd. 2002.
+ * All Rights Reserved.
+ *
+ */
+package org.eclipse.cdt.debug.core;
+
+import org.eclipse.core.runtime.CoreException;
+
+/**
+ *
+ * A breakpoint that suspend execution when a function is entered.
+ *
+ * @since Aug 21, 2002
+ */
+public interface ICFunctionBreakpoint extends ICLineBreakpoint
+{
+ /**
+ * Returns the function this breakpoint suspends execution in.
+ *
+ * @return the function this breakpoint suspends execution in
+ * @exception CoreException if unable to access the property
+ * on this breakpoint's underlying marker
+ */
+ public String getFunction() throws CoreException;
+
+ /**
+ * Sets the function this breakpoint suspends execution in.
+ *
+ * @param function the function this breakpoint suspends execution in
+ * @exception CoreException if unable to access the property
+ * on this breakpoint's underlying marker
+ */
+ public void setFunction( String function ) throws CoreException;
+}
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICLineBreakpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICLineBreakpoint.java
new file mode 100644
index 00000000000..1efa30a9b3e
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/ICLineBreakpoint.java
@@ -0,0 +1,20 @@
+/*
+ *(c) Copyright QNX Software Systems Ltd. 2002.
+ * All Rights Reserved.
+ *
+ */
+
+package org.eclipse.cdt.debug.core;
+
+import org.eclipse.debug.core.model.ILineBreakpoint;
+
+/**
+ *
+ * A breakpoint that suspend execution when a particular line of code
+ * is reached.
+ *
+ * @since Aug 21, 2002
+ */
+public interface ICLineBreakpoint extends ICBreakpoint, ILineBreakpoint
+{
+}
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CAddressBreakpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CAddressBreakpoint.java
new file mode 100644
index 00000000000..a01f0f1c89a
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CAddressBreakpoint.java
@@ -0,0 +1,74 @@
+/*
+ *(c) Copyright QNX Software Systems Ltd. 2002.
+ * All Rights Reserved.
+ *
+ */
+package org.eclipse.cdt.debug.internal.core.breakpoints;
+
+import org.eclipse.cdt.debug.core.ICAddressBreakpoint;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.runtime.CoreException;
+
+/**
+ *
+ * Enter type comment.
+ *
+ * @since Aug 21, 2002
+ */
+public class CAddressBreakpoint extends CBreakpoint implements ICAddressBreakpoint
+{
+ /**
+ * Breakpoint attribute storing the address this breakpoint suspends
+ * execution at (value <code>"org.eclipse.cdt.debug.core.address"</code>).
+ * This attribute is a <code>String</code>.
+ */
+ protected static final String ADDRESS = "org.eclipse.cdt.debug.core.address"; //$NON-NLS-1$
+
+ /**
+ * Constructor for CAddressBreakpoint.
+ */
+ public CAddressBreakpoint()
+ {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.debug.core.ICAddressBreakpoint#getAddress()
+ */
+ public String getAddress() throws CoreException
+ {
+ return ensureMarker().getAttribute( ADDRESS, null );
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.debug.core.ICAddressBreakpoint#setAddress(long)
+ */
+ public void setAddress( String address ) throws CoreException
+ {
+ setAttribute( ADDRESS, address );
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.model.ILineBreakpoint#getLineNumber()
+ */
+ public int getLineNumber() throws CoreException
+ {
+ return ensureMarker().getAttribute( IMarker.LINE_NUMBER, -1 );
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.model.ILineBreakpoint#getCharStart()
+ */
+ public int getCharStart() throws CoreException
+ {
+ return ensureMarker().getAttribute( IMarker.CHAR_START, -1 );
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.model.ILineBreakpoint#getCharEnd()
+ */
+ public int getCharEnd() throws CoreException
+ {
+ return ensureMarker().getAttribute( IMarker.CHAR_END, -1 );
+ }
+}
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CBreakpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CBreakpoint.java
new file mode 100644
index 00000000000..54820fb4fe8
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CBreakpoint.java
@@ -0,0 +1,132 @@
+/*
+ *(c) Copyright QNX Software Systems Ltd. 2002.
+ * All Rights Reserved.
+ *
+ */
+
+package org.eclipse.cdt.debug.internal.core.breakpoints;
+
+import org.eclipse.cdt.debug.core.CDebugModel;
+import org.eclipse.cdt.debug.core.ICBreakpoint;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.DebugEvent;
+import org.eclipse.debug.core.IDebugEventSetListener;
+import org.eclipse.debug.core.model.Breakpoint;
+
+/**
+ *
+ * Enter type comment.
+ *
+ * @since Aug 21, 2002
+ */
+public abstract class CBreakpoint extends Breakpoint
+ implements ICBreakpoint,
+ IDebugEventSetListener
+{
+ /**
+ * Breakpoint attribute storing the number of debug targets a
+ * breakpoint is installed in (value <code>"org.eclipse.cdt.debug.core.installCount"</code>).
+ * This attribute is a <code>int</code>.
+ */
+ protected static final String INSTALL_COUNT = "org.eclipse.cdt.debug.core.installCount"; //$NON-NLS-1$
+
+ /**
+ * Breakpoint attribute storing the the conditional expression
+ * associated with this breakpoint (value <code>"org.eclipse.cdt.debug.core.condition"</code>).
+ * This attribute is a <code>String</code>.
+ */
+ protected static final String CONDITION = "org.eclipse.cdt.debug.core.condition"; //$NON-NLS-1$
+
+ /**
+ * Breakpoint attribute storing a breakpoint's ignore count value
+ * (value <code>"org.eclipse.cdt.debug.core.ignoreCount"</code>).
+ * This attribute is a <code>int</code>.
+ */
+ protected static final String IGNORE_COUNT = "org.eclipse.cdt.debug.core.ignoreCount"; //$NON-NLS-1$
+
+ /**
+ * Breakpoint attribute storing an identifier of the thread this
+ * breakpoint is restricted in (value <code>"org.eclipse.cdt.debug.core.threadId"</code>).
+ * This attribute is a <code>String</code>.
+ */
+ protected static final String THREAD_ID = "org.eclipse.cdt.debug.core.threadId"; //$NON-NLS-1$
+
+ /**
+ * Constructor for CBreakpoint.
+ */
+ public CBreakpoint()
+ {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.model.IBreakpoint#getModelIdentifier()
+ */
+ public String getModelIdentifier()
+ {
+ return CDebugModel.getPluginIdentifier();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.debug.core.ICBreakpoint#isInstalled()
+ */
+ public boolean isInstalled() throws CoreException
+ {
+ return ensureMarker().getAttribute( INSTALL_COUNT, 0 ) > 0;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.debug.core.ICBreakpoint#getCondition()
+ */
+ public String getCondition() throws CoreException
+ {
+ return ensureMarker().getAttribute( CONDITION, "" );
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.debug.core.ICBreakpoint#setCondition(String)
+ */
+ public void setCondition( String condition ) throws CoreException
+ {
+ setAttribute( CONDITION, condition );
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.debug.core.ICBreakpoint#getIgnoreCount()
+ */
+ public int getIgnoreCount() throws CoreException
+ {
+ return ensureMarker().getAttribute( IGNORE_COUNT, 0 );
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.debug.core.ICBreakpoint#setIgnoreCount(int)
+ */
+ public void setIgnoreCount( int ignoreCount ) throws CoreException
+ {
+ setAttribute( IGNORE_COUNT, ignoreCount );
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.debug.core.ICBreakpoint#getThreadId()
+ */
+ public String getThreadId() throws CoreException
+ {
+ return ensureMarker().getAttribute( THREAD_ID, null );
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.debug.core.ICBreakpoint#setThreadId(String)
+ */
+ public void setThreadId( String threadId ) throws CoreException
+ {
+ setAttribute( THREAD_ID, threadId );
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.IDebugEventSetListener#handleDebugEvents(DebugEvent[])
+ */
+ public void handleDebugEvents( DebugEvent[] events )
+ {
+ }
+}
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CFunctionBreakpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CFunctionBreakpoint.java
new file mode 100644
index 00000000000..6cda614e8aa
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CFunctionBreakpoint.java
@@ -0,0 +1,73 @@
+/*
+ *(c) Copyright QNX Software Systems Ltd. 2002.
+ * All Rights Reserved.
+ *
+ */
+package org.eclipse.cdt.debug.internal.core.breakpoints;
+
+import org.eclipse.cdt.debug.core.ICFunctionBreakpoint;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.runtime.CoreException;
+
+/**
+ *
+ * Enter type comment.
+ *
+ * @since Aug 21, 2002
+ */
+public class CFunctionBreakpoint extends CBreakpoint implements ICFunctionBreakpoint
+{
+ /**
+ * Breakpoint attribute storing the function this breakpoint suspends
+ * execution in (value <code>"org.eclipse.cdt.debug.core.function"</code>).
+ * This attribute is a <code>String</code>.
+ */
+ protected static final String FUNCTION = "org.eclipse.cdt.debug.core.function"; //$NON-NLS-1$
+
+ /**
+ * Constructor for CFunctionBreakpoint.
+ */
+ public CFunctionBreakpoint()
+ {
+ super();
+ }
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.debug.core.ICFunctionBreakpoint#getFunction()
+ */
+ public String getFunction() throws CoreException
+ {
+ return ensureMarker().getAttribute( FUNCTION, null );
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.debug.core.ICFunctionBreakpoint#setFunction(String)
+ */
+ public void setFunction( String function ) throws CoreException
+ {
+ setAttribute( FUNCTION, function );
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.model.ILineBreakpoint#getLineNumber()
+ */
+ public int getLineNumber() throws CoreException
+ {
+ return ensureMarker().getAttribute( IMarker.LINE_NUMBER, -1 );
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.model.ILineBreakpoint#getCharStart()
+ */
+ public int getCharStart() throws CoreException
+ {
+ return ensureMarker().getAttribute( IMarker.CHAR_START, -1 );
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.model.ILineBreakpoint#getCharEnd()
+ */
+ public int getCharEnd() throws CoreException
+ {
+ return ensureMarker().getAttribute( IMarker.CHAR_END, -1 );
+ }
+}
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CLineBreakpoint.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CLineBreakpoint.java
new file mode 100644
index 00000000000..e3ffa8fad62
--- /dev/null
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/breakpoints/CLineBreakpoint.java
@@ -0,0 +1,51 @@
+/*
+ *(c) Copyright QNX Software Systems Ltd. 2002.
+ * All Rights Reserved.
+ *
+ */
+package org.eclipse.cdt.debug.internal.core.breakpoints;
+
+import org.eclipse.cdt.debug.core.ICLineBreakpoint;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.runtime.CoreException;
+
+/**
+ *
+ * Enter type comment.
+ *
+ * @since Aug 21, 2002
+ */
+public class CLineBreakpoint extends CBreakpoint implements ICLineBreakpoint
+{
+ /**
+ * Constructor for CLineBreakpoint.
+ */
+ public CLineBreakpoint()
+ {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.model.ILineBreakpoint#getLineNumber()
+ */
+ public int getLineNumber() throws CoreException
+ {
+ return ensureMarker().getAttribute( IMarker.LINE_NUMBER, -1 );
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.model.ILineBreakpoint#getCharStart()
+ */
+ public int getCharStart() throws CoreException
+ {
+ return ensureMarker().getAttribute( IMarker.CHAR_START, -1 );
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.model.ILineBreakpoint#getCharEnd()
+ */
+ public int getCharEnd() throws CoreException
+ {
+ return ensureMarker().getAttribute( IMarker.CHAR_END, -1 );
+ }
+}

Back to the top