From 66859771bec389f3e75e98334da94139e8498a74 Mon Sep 17 00:00:00 2001 From: Mikhail Khodjaiants Date: Tue, 23 Sep 2003 20:51:28 +0000 Subject: [PATCH] Changed the 'hasStackFrames' method of the 'CThread' class to return true regardless if the thread contains stack frames or not. This method is only used by UI to update the thread label. --- debug/org.eclipse.cdt.debug.core/ChangeLog | 5 ++++ .../debug/internal/core/model/CThread.java | 24 ++++++++++--------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.core/ChangeLog b/debug/org.eclipse.cdt.debug.core/ChangeLog index d30b118e329..090fa7e0991 100644 --- a/debug/org.eclipse.cdt.debug.core/ChangeLog +++ b/debug/org.eclipse.cdt.debug.core/ChangeLog @@ -1,3 +1,8 @@ +2003-10-23 Mikhail Khodjaiants + Changed the 'hasStackFrames' method of the 'CThread' class to return true regardless if + the thread contains stack frames or not. This method is only used by UI to update the thread label. + * CThread.java + 2003-10-17 Mikhail Khodjaiants Temporary fix for PR 39061: Attach source does not work for applications compiled in CygWin. * CDirectorySourceLocation.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 434f57278c5..6ddaf5bd635 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 @@ -7,6 +7,7 @@ package org.eclipse.cdt.debug.internal.core.model; import java.util.ArrayList; +import java.util.Collections; import java.util.Iterator; import java.util.List; @@ -140,7 +141,16 @@ public class CThread extends CDebugElement */ public IStackFrame[] getStackFrames() throws DebugException { - List list = computeStackFrames(); + List list = Collections.EMPTY_LIST; + try + { + list = computeStackFrames(); + } + catch( DebugException e ) + { + setStatus( ICDebugElementErrorStatus.ERROR, e.getStatus().getMessage() ); + throw e; + } return (IStackFrame[])list.toArray( new IStackFrame[list.size()] ); } @@ -149,16 +159,8 @@ public class CThread extends CDebugElement */ public boolean hasStackFrames() throws DebugException { - try - { - return computeStackFrames().size() > 0; - } - catch( DebugException e ) - { - // do not throw an exception if the thread resumed while determining - // whether stack frames are present - } - return false; + // Always return true to postpone the stack frames request + return true; } /**