1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

Bug 480225 - Reduce trace output for "-list-thread-groups --available"

Change-Id: Ief95bb4dc47cb76b40285cd8a809b15f3d0731bf
This commit is contained in:
Marc Khouzam 2015-10-20 11:27:22 -04:00 committed by Gerrit Code Review @ Eclipse.org
parent ca2070f258
commit 7cc28b5400

View file

@ -79,6 +79,7 @@ public abstract class AbstractMIControl extends AbstractDsfService
{
private static final String MI_TRACE_IDENTIFIER = "[MI]"; //$NON-NLS-1$
private static final int NUMBER_CONCURRENT_COMMANDS = 3;
private static final int DEVELOPMENT_TRACE_LIMIT_CHARS = 5000;
/*
* Thread control variables for the transmit and receive threads.
@ -730,9 +731,18 @@ public abstract class AbstractMIControl extends AbstractDsfService
String line;
while ((line = reader.readLine()) != null) {
if (line.length() != 0) {
//Write Gdb response to sysout or file
// Write Gdb response to sysout or file
if(GdbDebugOptions.DEBUG) {
if (line.length() < DEVELOPMENT_TRACE_LIMIT_CHARS) {
GdbDebugOptions.trace(String.format( "%s %s %s\n", GdbPlugin.getDebugTime(), MI_TRACE_IDENTIFIER, line)); //$NON-NLS-1$
} else {
// "-list-thread-groups --available" give a very large output that is not very useful but that makes
// looking at the traces much more difficult. Don't show the full output in the traces.
// If we really need to see that output, it will still be in the 'gdb traces'.
GdbDebugOptions.trace(String.format( "%s %s %s\n", GdbPlugin.getDebugTime(), MI_TRACE_IDENTIFIER, //$NON-NLS-1$
line.substring(0, DEVELOPMENT_TRACE_LIMIT_CHARS) +
" [remaining output truncated. Refer to 'gdb traces' if full output needed.]")); //$NON-NLS-1$
}
}
final String finalLine = line;