From 0d40090288f02eb2caff5fd2dc53094d15cd82c7 Mon Sep 17 00:00:00 2001 From: Mikhail Khodjaiants Date: Tue, 10 Dec 2002 03:46:46 +0000 Subject: [PATCH] Split the detail message of ICDIErrorInfo into tokens and trancate aech token if it is too long. --- debug/org.eclipse.cdt.debug.core/ChangeLog | 4 ++++ .../internal/core/model/CDebugTarget.java | 20 ++++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.core/ChangeLog b/debug/org.eclipse.cdt.debug.core/ChangeLog index 3be2e7559c9..d6c46b6a32e 100644 --- a/debug/org.eclipse.cdt.debug.core/ChangeLog +++ b/debug/org.eclipse.cdt.debug.core/ChangeLog @@ -1,3 +1,7 @@ +2002-12-09 Mikhail Khodjaiants + Split the detail message of ICDIErrorInfo into tokens and trancate aech token if it is too long. + * CDebugTarget.java + 2002-12-08 Mikhail Khodjaiants Display the error message with details when program is suspended because of ICDIErrorInfo. * CDebugTarget.java diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java index 5c346498669..b335709208f 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java @@ -9,6 +9,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; +import java.util.StringTokenizer; import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.model.CoreModel; @@ -1345,11 +1346,20 @@ public class CDebugTarget extends CDebugElement ICDebugInternalConstants.STATUS_CODE_ERROR, "The execution of program is suspended because of error.", null ); - status.add( new Status( IStatus.ERROR, - status.getPlugin(), - ICDebugInternalConstants.STATUS_CODE_ERROR, - info.getDetailMessage(), - null ) ); + StringTokenizer st = new StringTokenizer( info.getDetailMessage(), "\n\r" ); + while( st.hasMoreTokens() ) + { + String token = st.nextToken(); + if ( token.length() > 200 ) + { + token = token.substring( 0, 200 ); + } + status.add( new Status( IStatus.ERROR, + status.getPlugin(), + ICDebugInternalConstants.STATUS_CODE_ERROR, + token, + null ) ); + } CDebugUtils.error( status, this ); } }