mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 01:15:29 +02:00
Bug 113107: Make trace logs more readily available. Core support for the "Verbose Mode" action.
This commit is contained in:
parent
a0d3431212
commit
cb185efddb
6 changed files with 86 additions and 8 deletions
|
@ -1,3 +1,12 @@
|
|||
2006-04-13 Mikhail Khodjaiants
|
||||
Bug 113107: Make trace logs more readily available.
|
||||
Core support for the "Verbose Mode" action.
|
||||
* Target.java
|
||||
* MISession.java
|
||||
* RxThread.java
|
||||
* AbstractGDBCDIDebugger.java
|
||||
+ GDBProcess.java
|
||||
|
||||
2006-04-12 Mikhail Khodjaiants
|
||||
Write log messages to the system out instead of err.
|
||||
* MIPlugin.java
|
||||
|
|
|
@ -13,7 +13,6 @@ package org.eclipse.cdt.debug.mi.core.cdi.model;
|
|||
import java.math.BigInteger;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICDIAddressLocation;
|
||||
import org.eclipse.cdt.debug.core.cdi.ICDICondition;
|
||||
|
@ -59,6 +58,9 @@ import org.eclipse.cdt.debug.mi.core.cdi.SharedLibraryManager;
|
|||
import org.eclipse.cdt.debug.mi.core.cdi.SignalManager;
|
||||
import org.eclipse.cdt.debug.mi.core.cdi.SourceManager;
|
||||
import org.eclipse.cdt.debug.mi.core.cdi.VariableManager;
|
||||
import org.eclipse.cdt.debug.mi.core.command.CLIInfoThreads;
|
||||
import org.eclipse.cdt.debug.mi.core.command.CLIJump;
|
||||
import org.eclipse.cdt.debug.mi.core.command.CLISignal;
|
||||
import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
|
||||
import org.eclipse.cdt.debug.mi.core.command.MIDataEvaluateExpression;
|
||||
import org.eclipse.cdt.debug.mi.core.command.MIExecContinue;
|
||||
|
@ -68,20 +70,17 @@ import org.eclipse.cdt.debug.mi.core.command.MIExecRun;
|
|||
import org.eclipse.cdt.debug.mi.core.command.MIExecStep;
|
||||
import org.eclipse.cdt.debug.mi.core.command.MIExecStepInstruction;
|
||||
import org.eclipse.cdt.debug.mi.core.command.MIExecUntil;
|
||||
import org.eclipse.cdt.debug.mi.core.command.CLIInfoThreads;
|
||||
import org.eclipse.cdt.debug.mi.core.command.CLIJump;
|
||||
import org.eclipse.cdt.debug.mi.core.command.MIGDBShowEndian;
|
||||
import org.eclipse.cdt.debug.mi.core.command.CLISignal;
|
||||
import org.eclipse.cdt.debug.mi.core.command.MITargetDetach;
|
||||
import org.eclipse.cdt.debug.mi.core.command.MIThreadSelect;
|
||||
import org.eclipse.cdt.debug.mi.core.event.MIDetachedEvent;
|
||||
import org.eclipse.cdt.debug.mi.core.event.MIThreadCreatedEvent;
|
||||
import org.eclipse.cdt.debug.mi.core.event.MIThreadExitEvent;
|
||||
import org.eclipse.cdt.debug.mi.core.output.CLIInfoThreadsInfo;
|
||||
import org.eclipse.cdt.debug.mi.core.output.MIDataEvaluateExpressionInfo;
|
||||
import org.eclipse.cdt.debug.mi.core.output.MIFrame;
|
||||
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
|
||||
import org.eclipse.cdt.debug.mi.core.output.CLIInfoThreadsInfo;
|
||||
import org.eclipse.cdt.debug.mi.core.output.MIGDBShowEndianInfo;
|
||||
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
|
||||
import org.eclipse.cdt.debug.mi.core.output.MIThreadSelectInfo;
|
||||
|
||||
/**
|
||||
|
@ -110,6 +109,7 @@ public class Target extends SessionObject implements ICDITarget {
|
|||
public void setConfiguration(ICDITargetConfiguration configuration) {
|
||||
fConfiguration = configuration;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIObject#getTarget()
|
||||
*/
|
||||
|
@ -1131,4 +1131,12 @@ public class Target extends SessionObject implements ICDITarget {
|
|||
public boolean areBreakpointsDeferred() {
|
||||
return this.deferBreakpoints;
|
||||
}
|
||||
|
||||
public void enableVerboseMode(boolean enabled) {
|
||||
miSession.enableVerboseMode(enabled);
|
||||
}
|
||||
|
||||
public boolean isVerboseModeEnabled() {
|
||||
return miSession.isVerboseModeEnabled();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,6 +59,7 @@ public class MISession extends Observable {
|
|||
|
||||
boolean terminated;
|
||||
boolean useInterpreterExecConsole;
|
||||
boolean verboseMode = false;
|
||||
|
||||
// hold the type of the session(post-mortem, attach etc ..)
|
||||
int sessionType;
|
||||
|
@ -579,6 +580,9 @@ public class MISession extends Observable {
|
|||
MIPlugin.getDefault().debugLog(cmd.toString());
|
||||
}
|
||||
|
||||
if (isVerboseModeEnabled())
|
||||
writeToConsole(cmd.toString());
|
||||
|
||||
txQueue.addCommand(cmd);
|
||||
|
||||
// do not wait around the answer.
|
||||
|
@ -806,4 +810,23 @@ public class MISession extends Observable {
|
|||
}
|
||||
}
|
||||
|
||||
protected void writeToConsole(String text) {
|
||||
OutputStream console = getConsolePipe();
|
||||
if (console != null) {
|
||||
try {
|
||||
console.write(text.getBytes());
|
||||
console.flush();
|
||||
}
|
||||
catch(IOException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void enableVerboseMode(boolean enabled) {
|
||||
verboseMode = enabled;
|
||||
}
|
||||
|
||||
public boolean isVerboseModeEnabled() {
|
||||
return verboseMode;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,6 +90,10 @@ public class RxThread extends Thread {
|
|||
if (MIPlugin.getDefault().isDebugging()) {
|
||||
MIPlugin.getDefault().debugLog(line);
|
||||
}
|
||||
|
||||
if (session.isVerboseModeEnabled())
|
||||
session.writeToConsole(line + "\n"); //$NON-NLS-1$
|
||||
|
||||
setPrompt(line);
|
||||
processMIOutput(line + "\n"); //$NON-NLS-1$
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import java.io.File;
|
|||
import java.text.DateFormat;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
import org.eclipse.cdt.core.IBinaryParser.IBinaryObject;
|
||||
import org.eclipse.cdt.debug.core.ICDIDebugger2;
|
||||
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
|
||||
|
@ -33,7 +34,6 @@ import org.eclipse.core.runtime.NullProgressMonitor;
|
|||
import org.eclipse.core.runtime.OperationCanceledException;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.debug.core.DebugPlugin;
|
||||
import org.eclipse.debug.core.ILaunch;
|
||||
import org.eclipse.debug.core.ILaunchConfiguration;
|
||||
import org.eclipse.debug.core.model.IProcess;
|
||||
|
@ -69,7 +69,7 @@ abstract public class AbstractGDBCDIDebugger implements ICDIDebugger2 {
|
|||
for( int i = 0; i < targets.length; i++ ) {
|
||||
Process debugger = session.getSessionProcess( targets[i] );
|
||||
if ( debugger != null ) {
|
||||
IProcess debuggerProcess = DebugPlugin.newProcess( launch, debugger, renderDebuggerProcessLabel( launch ) );
|
||||
IProcess debuggerProcess = createGDBProcess( (Target)targets[i], launch, debugger, renderDebuggerProcessLabel( launch ), null );
|
||||
launch.addProcess( debuggerProcess );
|
||||
}
|
||||
((Target)targets[i]).getMISession().start();
|
||||
|
@ -193,4 +193,8 @@ abstract public class AbstractGDBCDIDebugger implements ICDIDebugger2 {
|
|||
status.add( new Status( IStatus.ERROR, ID, code, exception == null ? new String() : exception.getLocalizedMessage(), exception ) );
|
||||
return new CoreException( status );
|
||||
}
|
||||
|
||||
protected IProcess createGDBProcess( Target target, ILaunch launch, Process process, String label, Map attributes ) {
|
||||
return new GDBProcess( target, launch, process, label, attributes );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2004 QNX Software Systems and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* QNX Software Systems - Initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.debug.mi.core;
|
||||
|
||||
import java.util.Map;
|
||||
import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
|
||||
import org.eclipse.debug.core.ILaunch;
|
||||
import org.eclipse.debug.core.model.RuntimeProcess;
|
||||
|
||||
public class GDBProcess extends RuntimeProcess {
|
||||
|
||||
private Target fTarget;
|
||||
|
||||
public GDBProcess( Target target, ILaunch launch, Process process, String name, Map attributes ) {
|
||||
super( launch, process, name, attributes );
|
||||
fTarget = target;
|
||||
}
|
||||
|
||||
public Target getTarget() {
|
||||
return fTarget;
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue