DEBUG: add an option to hide gdb warning messages
authorGun Kim <gune.kim@samsung.com>
Thu, 7 Jul 2016 08:40:11 +0000 (17:40 +0900)
committerSangho Park <sangho.p@samsung.com>
Fri, 8 Jul 2016 02:00:52 +0000 (11:00 +0900)
For users who want to hide gdb warning messages,
add an option to hide them.

Change-Id: Ie24647b69961112f43257bc4eb17a2eaeabe61d3
Signed-off-by: Gun Kim <gune.kim@samsung.com>
dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/AbstractCLIProcess.java

index 7233a2a..de42d95 100644 (file)
  *     Ericsson                        - Modified for additional features in DSF Reference implementation
  *******************************************************************************/
 
+/*
+ * 2016-07-07 Gun Kim gune.kim@samsung.com
+ * Modifications by S-Core Co., LTD.
+ * 1. Added a way of hiding warning messages in process of debugging a program.
+ */
+
 package org.eclipse.cdt.dsf.mi.service.command;
 
 import java.io.IOException;
@@ -73,6 +79,8 @@ public abstract class AbstractCLIProcess extends Process
     private PipedOutputStream fMIOutLogPipe;
 
     private boolean fDisposed = false;
+    /// Tizen
+    private static boolean canShowWarningMsg = false;
     
     /**
      * Counter for tracking console commands sent by services.  
@@ -128,7 +136,7 @@ public abstract class AbstractCLIProcess extends Process
         fMIOutConsolePipe = miOutConsolePipe;
         fMIInConsolePipe = miInConsolePipe;
         fMIOutLogPipe = miOutLogPipe;
-        fMIInLogPipe = miInLogPipe; 
+        fMIInLogPipe = miInLogPipe;
        }
     
     protected DsfSession getSession() { return fSession; }
@@ -236,20 +244,41 @@ public abstract class AbstractCLIProcess extends Process
                 } catch (IOException e) {
                 }
             } else if (oobr instanceof MILogStreamOutput) {
-               MILogStreamOutput out = (MILogStreamOutput) oobr;
-                String str = out.getString();
-                if (str != null) {
-                    try {
-                       if (fMIOutLogPipe != null) {
-                               fMIOutLogPipe.write(str.getBytes());
-                               fMIOutLogPipe.flush();
-                       }
-                    } catch (IOException e) {
+                /* Tizen */
+//             MILogStreamOutput out = (MILogStreamOutput) oobr;
+//                String str = out.getString();
+//                if (str != null) {
+//                    try {
+//                     if (fMIOutLogPipe != null) {
+//                             fMIOutLogPipe.write(str.getBytes());
+//                             fMIOutLogPipe.flush();
+//                     }
+//                    } catch (IOException e) {
+//                    }
+//                }
+                if (canShowWarningMsg) {
+                    MILogStreamOutput out = (MILogStreamOutput) oobr;
+                    String str = out.getString();
+                    if (str != null) {
+                        try {
+                            if (fMIOutLogPipe != null) {
+                                fMIOutLogPipe.write(str.getBytes());
+                                fMIOutLogPipe.flush();
+                            }
+                        } catch (IOException e) {
+                        }
                     }
                 }
+                /* ===== */
             }
         }
     }
+
+    /* Tizen */
+    public static void setShowWarningMsg(boolean canShowWarningMsg) {
+        AbstractCLIProcess.canShowWarningMsg = canShowWarningMsg;
+    }
+    /* ===== */
     
        @Override
     public void commandQueued(ICommandToken token) {