Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Split the detail message of ICDIErrorInfo into tokens

Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.core/ChangeLog,v
retrieving revision 1.72
diff -u -r1.72 ChangeLog
--- ChangeLog 9 Dec 2002 00:55:42 -0000 1.72
+++ ChangeLog 10 Dec 2002 03:45:56 -0000
@@ -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
Index: src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java,v
retrieving revision 1.60
diff -u -r1.60 CDebugTarget.java
--- src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java 9 Dec 2002 00:55:42 -0000 1.60
+++ src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java 10 Dec 2002 03:45:59 -0000
@@ -9,6 +9,7 @@
 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 @@
               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 );
   }
  }

Back to the top