Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikhail Khodjaiants2004-02-16 20:20:43 -0500
committerMikhail Khodjaiants2004-02-16 20:20:43 -0500
commitd542c7f1796f884f560f65d76dbb51e5939b1c8e (patch)
treeb2596c35f2fd0bc44e5c3bed922aa72fbab13205
parent0470019cbd49b6de821b255a3e627d021dfb5f4c (diff)
downloadorg.eclipse.cdt-d542c7f1796f884f560f65d76dbb51e5939b1c8e.tar.gz
org.eclipse.cdt-d542c7f1796f884f560f65d76dbb51e5939b1c8e.tar.xz
org.eclipse.cdt-d542c7f1796f884f560f65d76dbb51e5939b1c8e.zip
Fix for bug 52135: Debugger should indicate which thread triggered breakpoint.
-rw-r--r--debug/org.eclipse.cdt.debug.core/ChangeLog4
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java2
-rw-r--r--debug/org.eclipse.cdt.debug.ui/ChangeLog4
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTDebugModelPresentation.java49
4 files changed, 54 insertions, 5 deletions
diff --git a/debug/org.eclipse.cdt.debug.core/ChangeLog b/debug/org.eclipse.cdt.debug.core/ChangeLog
index 52648ee9cd..1526694a2d 100644
--- a/debug/org.eclipse.cdt.debug.core/ChangeLog
+++ b/debug/org.eclipse.cdt.debug.core/ChangeLog
@@ -1,3 +1,7 @@
+2004-02-16 Mikhail Khodjaiants
+ Fix for bug 52135: Debugger should indicate which thread triggered breakpoint.
+ * CThread.java
+
2004-02-11 Mikhail Khodjaiants
In the 'reset' method check if value is an instance of CValue before type casting.
* CVariable.java
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java
index 5f0f322176..956c65dfc5 100644
--- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java
@@ -1129,6 +1129,8 @@ public class CThread extends CDebugElement
{
if ( adapter.equals( IRunToLine.class ) )
return this;
+ if ( adapter.equals( IState.class ) )
+ return this;
return super.getAdapter(adapter);
}
diff --git a/debug/org.eclipse.cdt.debug.ui/ChangeLog b/debug/org.eclipse.cdt.debug.ui/ChangeLog
index 15987aaeb1..f150f34b80 100644
--- a/debug/org.eclipse.cdt.debug.ui/ChangeLog
+++ b/debug/org.eclipse.cdt.debug.ui/ChangeLog
@@ -1,3 +1,7 @@
+2004-02-16 Mikhail Khodjaiants
+ Fix for bug 52135: Debugger should indicate which thread triggered breakpoint.
+ * CDTDebugModelPresentation.java
+
2004-02-11 Mikhail Khodjaiants
Fix for bug 51062: Source locator oddness.
* DefualtSourceLocator.java
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTDebugModelPresentation.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTDebugModelPresentation.java
index 20f4c97de9..a0dd65da9b 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTDebugModelPresentation.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDTDebugModelPresentation.java
@@ -13,7 +13,6 @@ import org.eclipse.cdt.core.resources.FileStorage;
import org.eclipse.cdt.debug.core.CDebugUtils;
import org.eclipse.cdt.debug.core.cdi.ICDIBreakpointHit;
import org.eclipse.cdt.debug.core.cdi.ICDIExitInfo;
-import org.eclipse.cdt.debug.core.cdi.ICDISession;
import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryEvent;
import org.eclipse.cdt.debug.core.cdi.ICDISignalExitInfo;
import org.eclipse.cdt.debug.core.cdi.ICDISignalReceived;
@@ -455,6 +454,8 @@ public class CDTDebugModelPresentation extends LabelProvider
return label + ")";
}
case IState.SUSPENDED:
+ return target.getName() + " (Suspended)";
+/*
{
Object info = state.getCurrentStateInfo();
if ( info != null && info instanceof ICDISignalReceived )
@@ -490,6 +491,7 @@ public class CDTDebugModelPresentation extends LabelProvider
return target.getName() + " (Suspended)";
}
}
+*/
}
}
return target.getName();
@@ -497,23 +499,60 @@ public class CDTDebugModelPresentation extends LabelProvider
protected String getThreadText( IThread thread, boolean qualified ) throws DebugException
{
+ String threadName = getFormattedString( "Thread [{0}]", thread.getName() );
ICDebugTargetType targetType = (ICDebugTargetType)thread.getDebugTarget().getAdapter( ICDebugTargetType.class );
int type = ( targetType != null ) ? targetType.getTargetType() : ICDebugTargetType.TARGET_TYPE_UNKNOWN;
if ( type == ICDebugTargetType.TARGET_TYPE_LOCAL_CORE_DUMP )
{
- return getFormattedString( "Thread [{0}]", thread.getName() );
+ return threadName;
}
if ( thread.isTerminated() )
{
- return getFormattedString( "Thread [{0}] (Terminated)", thread.getName() );
+ return getFormattedString( "{0} (Terminated)", threadName );
}
if ( thread.isStepping() )
{
- return getFormattedString( "Thread [{0}] (Stepping)", thread.getName());
+ return getFormattedString( "{0} (Stepping)", threadName );
}
if ( !thread.isSuspended() )
{
- return getFormattedString( "Thread [{0}] (Running)", thread.getName() );
+ return getFormattedString( "{0} (Running)", threadName );
+ }
+ if ( thread.isSuspended() )
+ {
+ IState state = (IState)thread.getAdapter( IState.class );
+ if ( state != null )
+ {
+ Object info = state.getCurrentStateInfo();
+ if ( info != null && info instanceof ICDISignalReceived )
+ {
+ ICDISignal signal = ((ICDISignalReceived)info).getSignal();
+ String label = threadName +
+ MessageFormat.format( " (Suspended: Signal ''{0}'' received. Description: {1})",
+ new String[] { signal.getName(), signal.getDescription() } );
+ return label;
+ }
+ if ( info != null && info instanceof ICDIWatchpointTrigger )
+ {
+ String label = threadName +
+ MessageFormat.format( " (Suspended: Watchpoint triggered. Old value: ''{0}''. New value: ''{1}'')",
+ new String[] { ((ICDIWatchpointTrigger)info).getOldValue(),
+ ((ICDIWatchpointTrigger)info).getNewValue() } );
+ return label;
+ }
+ if ( info != null && info instanceof ICDIWatchpointScope )
+ {
+ return threadName + " (Suspended: Watchpoint is out of scope)";
+ }
+ if ( info != null && info instanceof ICDIBreakpointHit )
+ {
+ return threadName + " (Suspended: Breakpoint hit)";
+ }
+ if ( info != null && info instanceof ICDISharedLibraryEvent )
+ {
+ return threadName + " (Suspended: Shared library event)";
+ }
+ }
}
return getFormattedString( "Thread [{0}] (Suspended)", thread.getName() );
}

Back to the top