From d80ef3ecc9388e8c4214c187ba56bd70636e7cd6 Mon Sep 17 00:00:00 2001 From: Mikhail Khodjaiants Date: Wed, 23 Apr 2003 17:51:24 +0000 Subject: [PATCH] Throw DebugException when getSignals() fails. --- debug/org.eclipse.cdt.debug.core/ChangeLog | 4 ++++ .../cdt/debug/internal/core/CSignalManager.java | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/debug/org.eclipse.cdt.debug.core/ChangeLog b/debug/org.eclipse.cdt.debug.core/ChangeLog index 421c321bf3e..e49dd412494 100644 --- a/debug/org.eclipse.cdt.debug.core/ChangeLog +++ b/debug/org.eclipse.cdt.debug.core/ChangeLog @@ -1,3 +1,7 @@ +2003-04-23 Mikhail Khodjaiants + Throw DebugException when getSignals() fails. + * CSignalManager.java + 2003-04-23 Mikhail Khodjaiants Additional checks for the situation when the stack depth is not 0 and the frame array is empty. diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CSignalManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CSignalManager.java index 17737637d62..763f41adfb2 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CSignalManager.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CSignalManager.java @@ -7,6 +7,7 @@ package org.eclipse.cdt.debug.internal.core; import java.util.ArrayList; +import org.eclipse.cdt.debug.core.CDebugModel; import org.eclipse.cdt.debug.core.ICSignalManager; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.ICDIManager; @@ -14,6 +15,8 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDISignal; import org.eclipse.cdt.debug.core.model.ICSignal; import org.eclipse.cdt.debug.internal.core.model.CDebugTarget; import org.eclipse.cdt.debug.internal.core.model.CSignal; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.debug.core.DebugEvent; import org.eclipse.debug.core.DebugException; @@ -54,6 +57,7 @@ public class CSignalManager extends CUpdateManager implements ICSignalManager } catch( CDIException e ) { + throwDebugException( e.getMessage(), DebugException.TARGET_REQUEST_FAILED, e ); } } return ( fSignals != null ) ? fSignals : new ICSignal[0]; @@ -126,4 +130,17 @@ public class CSignalManager extends CUpdateManager implements ICSignalManager } return null; } + + /** + * Throws a debug exception with the given message, error code, and underlying + * exception. + */ + protected void throwDebugException( String message, int code, Throwable exception ) throws DebugException + { + throw new DebugException( new Status( IStatus.ERROR, + CDebugModel.getPluginIdentifier(), + code, + message, + exception ) ); + } }