mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-13 19:25:38 +02:00
[290896] Trace checks should be lightweight
This commit is contained in:
parent
1754ae59b2
commit
1596d56719
3 changed files with 11 additions and 5 deletions
|
@ -583,7 +583,7 @@ public class MISession extends Observable {
|
||||||
*/
|
*/
|
||||||
public synchronized void postCommand0(Command cmd, long timeout) throws MIException {
|
public synchronized void postCommand0(Command cmd, long timeout) throws MIException {
|
||||||
// TRACING: print the command;
|
// TRACING: print the command;
|
||||||
if (MIPlugin.getDefault().isDebugging()) {
|
if (MIPlugin.DEBUG) {
|
||||||
MIPlugin.getDefault().debugLog(cmd.toString());
|
MIPlugin.getDefault().debugLog(cmd.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ public class RxThread extends Thread {
|
||||||
String line;
|
String line;
|
||||||
while ((line = reader.readLine()) != null) {
|
while ((line = reader.readLine()) != null) {
|
||||||
// TRACING: print the output.
|
// TRACING: print the output.
|
||||||
if (MIPlugin.getDefault().isDebugging()) {
|
if (MIPlugin.DEBUG) {
|
||||||
MIPlugin.getDefault().debugLog(line);
|
MIPlugin.getDefault().debugLog(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||||
|
import org.eclipse.core.runtime.Platform;
|
||||||
import org.eclipse.core.runtime.Plugin;
|
import org.eclipse.core.runtime.Plugin;
|
||||||
import org.eclipse.core.runtime.Preferences;
|
import org.eclipse.core.runtime.Preferences;
|
||||||
import org.eclipse.core.runtime.Status;
|
import org.eclipse.core.runtime.Status;
|
||||||
|
@ -69,6 +70,11 @@ public class MIPlugin extends Plugin {
|
||||||
|
|
||||||
private static final int INTERNAL_ERROR = 42;
|
private static final int INTERNAL_ERROR = 42;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Has tracing for this plug-in been turned on?
|
||||||
|
*/
|
||||||
|
public static final boolean DEBUG = "true".equals( //$NON-NLS-1$
|
||||||
|
Platform.getDebugOption("org.eclipse.cdt.debug.mi.core/debug")); //$NON-NLS-1$
|
||||||
/**
|
/**
|
||||||
* The singleton command factory manager.
|
* The singleton command factory manager.
|
||||||
*/
|
*/
|
||||||
|
@ -220,7 +226,7 @@ public class MIPlugin extends Plugin {
|
||||||
int launchTimeout = MIPlugin.getDefault().getPluginPreferences().getInt(IMIConstants.PREF_REQUEST_LAUNCH_TIMEOUT);
|
int launchTimeout = MIPlugin.getDefault().getPluginPreferences().getInt(IMIConstants.PREF_REQUEST_LAUNCH_TIMEOUT);
|
||||||
MIProcess pgdb = new MIProcessAdapter(args, launchTimeout, monitor);
|
MIProcess pgdb = new MIProcessAdapter(args, launchTimeout, monitor);
|
||||||
|
|
||||||
if (MIPlugin.getDefault().isDebugging()) {
|
if (MIPlugin.DEBUG) {
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
for (int i = 0; i < args.length; ++i) {
|
for (int i = 0; i < args.length; ++i) {
|
||||||
sb.append(args[i]);
|
sb.append(args[i]);
|
||||||
|
@ -287,7 +293,7 @@ public class MIPlugin extends Plugin {
|
||||||
int launchTimeout = MIPlugin.getDefault().getPluginPreferences().getInt(IMIConstants.PREF_REQUEST_LAUNCH_TIMEOUT);
|
int launchTimeout = MIPlugin.getDefault().getPluginPreferences().getInt(IMIConstants.PREF_REQUEST_LAUNCH_TIMEOUT);
|
||||||
MIProcess pgdb = new MIProcessAdapter(args, launchTimeout, monitor);
|
MIProcess pgdb = new MIProcessAdapter(args, launchTimeout, monitor);
|
||||||
|
|
||||||
if (MIPlugin.getDefault().isDebugging()) {
|
if (MIPlugin.DEBUG) {
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
for (int i = 0; i < args.length; ++i) {
|
for (int i = 0; i < args.length; ++i) {
|
||||||
sb.append(args[i]);
|
sb.append(args[i]);
|
||||||
|
@ -452,7 +458,7 @@ public class MIPlugin extends Plugin {
|
||||||
try {
|
try {
|
||||||
pgdb = factory.createMIProcess(args, launchTimeout, monitor);
|
pgdb = factory.createMIProcess(args, launchTimeout, monitor);
|
||||||
|
|
||||||
if (MIPlugin.getDefault().isDebugging()) {
|
if (MIPlugin.DEBUG) {
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
for (int i = 0; i < args.length; ++i) {
|
for (int i = 0; i < args.length; ++i) {
|
||||||
sb.append(args[i]);
|
sb.append(args[i]);
|
||||||
|
|
Loading…
Add table
Reference in a new issue