1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 01:15:29 +02:00

2004-10-31 Alain Magloire

Refactor ICDIVariableObject --> ICDIVariableDescriptor
	Refactor ICDIArgumentObject --> ICDIArgumentDescriptor
	Refactor ICDIRegisterObject --> ICDIRegisterDescriptor
	Addition ICDIThreadStorageDescriptor, ICDIThreadStorage
	Addition ICDILocalVariableDescriptor, ICDILocalVariable
	Addition ICDIGlobalVariableDescriptor, ICDIGlovalVariable

	Adjust the classes to the changes.
This commit is contained in:
Alain Magloire 2004-10-31 20:57:40 +00:00
parent 2a6c0b8c16
commit 8edc6b4de2
89 changed files with 1347 additions and 1068 deletions

View file

@ -1,3 +1,13 @@
2004-10-31 Alain Magloire
Refactor ICDIVariableObject --> ICDIVariableDescriptor
Refactor ICDIArgumentObject --> ICDIArgumentDescriptor
Refactor ICDIRegisterObject --> ICDIRegisterDescriptor
Addition ICDIThreadStorageDescriptor, ICDIThreadStorage
Addition ICDILocalVariableDescriptor, ICDILocalVariable
Addition ICDIGlobalVariableDescriptor, ICDIGlovalVariable
Adjust the classes to the changes.
2004-10-29 Mikhail Khodjaiants
Use the new expression API of CDI.
* CDebugModel.java

View file

@ -1,43 +0,0 @@
/*******************************************************************************
* Copyright (c) 2000, 2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.debug.core.cdi;
import org.eclipse.cdt.debug.core.cdi.model.*;
import org.eclipse.cdt.debug.core.cdi.model.ICDIRegister;
/**
* The default behaviour of the register is autoupdate on.
*/
public interface ICDIRegisterManager extends ICDIManager {
/**
* Method getRegisterObjects.
* @return ICDIRegisterObject[]
* @throws CDIException
*/
ICDIRegisterObject[] getRegisterObjects() throws CDIException;
/**
* Method createRegister.
* @param stack
* @param reg
* @return ICDIRegister
* @throws CDIException
*/
ICDIRegister createRegister(ICDIRegisterObject reg) throws CDIException;
/**
* Method removeRegister, remove register from the manager list.
* @param reg
*/
void destroyRegister(ICDIRegister reg);
}

View file

@ -45,20 +45,6 @@ public interface ICDISession {
*/
String getAttribute(String key);
/**
* Returns the variable manager of this debug session.
*
* @return the variable manager
*/
ICDIVariableManager getVariableManager();
/**
* Returns the register manager of this debug session.
*
* @return the register manager
*/
ICDIRegisterManager getRegisterManager();
/**
* Returns the event manager of this debug session.
*

View file

@ -1,126 +0,0 @@
/*******************************************************************************
* Copyright (c) 2000, 2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.debug.core.cdi;
import org.eclipse.cdt.debug.core.cdi.model.*;
import org.eclipse.cdt.debug.core.cdi.model.ICDIArgument;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable;
/**
* Auto update is on by default.
*/
public interface ICDIVariableManager extends ICDIManager {
/**
* Method getVariableObject.
* you can specify a static/global variable in a particular function or file,
* filename or/and function is the context for the static ICDIVariableObject.
* <pre>
* hello.c:
* int bar;
* int main() {
* static int bar;
* }
* file.c:
* int foo() {
* static int bar;
* }
* getVariableObject(null, null, "bar");
* getVariableObject(null, "main", "bar");
* getVariableObject("file.c", "foo", "bar");
* </pre>
* @param filename
* @param function
* @param name
* @return ICDIVariableObject
* @throws CDIException
*/
ICDIVariableObject getGlobalVariableObject(String filename, String function, String name) throws CDIException;
/**
* Consider the variable object as an Array of type and range[start, start + length - 1]
* @param stack
* @param name
* @return ICDIVariableObject
* @throws CDIException
*/
ICDIVariableObject getVariableObjectAsArray(ICDIVariableObject var, int start, int length) throws CDIException;
/**
* Consider the variable object as type.
* @param stack
* @param name
* @return ICDIVariableObject
* @throws CDIException
*/
ICDIVariableObject getVariableObjectAsType(ICDIVariableObject var, String type) throws CDIException;
/**
* Method getVariableObjects.
* Returns all the local variable objects of that stackframe.
* @param stack
* @return ICDIVariableObject[]
* @throws CDIException
*/
ICDIVariableObject[] getLocalVariableObjects(ICDIStackFrame stack) throws CDIException;
/**
* Method getVariableObjects.
* Returns all the local variable objects of that stackframe.
* @param stack
* @return ICDIVariableObject[]
* @throws CDIException
*/
ICDIVariableObject[] getVariableObjects(ICDIStackFrame stack) throws CDIException;
/**
* Method createVariable.
* Create a Variable for evaluation. A CreatedEvent will be trigger and
* ChangedEvent will also be trigger when the variable is assign a new value.
* DestroyedEvent is fired when the variable is out of scope and automatically
* removed from the manager list.
* @param var
* @return ICDIVariable
* @throws CDIException
*/
ICDIVariable createVariable(ICDIVariableObject var) throws CDIException;
/**
* Method getArgumentObjects.
* Returns all the local arguments of that stackframe.
* @param stack
* @return ICDIArgumentObject[]
* @throws CDIException
*/
ICDIArgumentObject[] getArgumentObjects(ICDIStackFrame stack) throws CDIException;
/**
* Method createArgument.
* Create a Variable for evaluation. CreatedEvent will be trigger and
* ChangedEvent will also be trigger when the variable is assign a new value.
* DestroyedEvent is fired when the variable is out of scope and automatically
* from th manager list.
* @param var
* @return ICDIArgument
* @throws CDIException
*/
ICDIArgument createArgument(ICDIArgumentObject var) throws CDIException;
/**
* Remove the variable from the manager list.
* @param var
* @return ICDIArgument
* @throws CDIException
*/
void destroyVariable(ICDIVariable var) throws CDIException;
}

View file

@ -17,5 +17,5 @@ package org.eclipse.cdt.debug.core.cdi.model;
*
* @since Jul 22, 2002
*/
public interface ICDIArgument extends ICDIVariable, ICDIArgumentObject {
public interface ICDIArgument extends ICDIVariable, ICDIArgumentDescriptor {
}

View file

@ -13,5 +13,5 @@ package org.eclipse.cdt.debug.core.cdi.model;
/**
*/
public interface ICDIArgumentObject extends ICDIVariableObject {
public interface ICDIArgumentDescriptor extends ICDILocalVariableDescriptor {
}

View file

@ -12,7 +12,6 @@
package org.eclipse.cdt.debug.core.cdi.model;
import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType;
/**
* An expression is a snippet of code that can be evaluated to
@ -47,4 +46,13 @@ public interface ICDIExpression extends ICDIObject {
*/
ICDIValue getValue(ICDIStackFrame context) throws CDIException;
/**
* Remove the expression from the manager list.
*
* @param var
* @return ICDIArgument
* @throws CDIException
*/
void dispose() throws CDIException;
}

View file

@ -0,0 +1,19 @@
/**********************************************************************
* Copyright (c) 2002,2003,2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.debug.core.cdi.model;
/**
* ICDIGlobalVariable
*/
public interface ICDIGlobalVariable extends ICDIVariable {
}

View file

@ -0,0 +1,19 @@
/**********************************************************************
* Copyright (c) 2002,2003,2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.debug.core.cdi.model;
/**
* ICDIGlobalVariableDescriptor
*/
public interface ICDIGlobalVariableDescriptor extends ICDIVariableDescriptor {
}

View file

@ -0,0 +1,26 @@
/**********************************************************************
* Copyright (c) 2002,2003,2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.debug.core.cdi.model;
import org.eclipse.cdt.debug.core.cdi.CDIException;
/**
* ICDILocalVariable
*/
public interface ICDILocalVariable extends ICDIVariable {
/**
*
* @return ICDIStackFrame
*/
ICDIStackFrame getStackFrame() throws CDIException;
}

View file

@ -0,0 +1,28 @@
/**********************************************************************
* Copyright (c) 2002,2003,2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.debug.core.cdi.model;
import org.eclipse.cdt.debug.core.cdi.CDIException;
/**
* ICDILocalVariableDescriptor
*/
public interface ICDILocalVariableDescriptor extends ICDIVariableDescriptor {
/**
* Return the stackframe.
*
* @return ICDIStackFrame
* @throws CDIException
*/
ICDIStackFrame getStackFrame() throws CDIException;
}

View file

@ -18,5 +18,5 @@ package org.eclipse.cdt.debug.core.cdi.model;
*
* @since Jul 9, 2002
*/
public interface ICDIRegister extends ICDIVariable, ICDIRegisterObject {
public interface ICDIRegister extends ICDIVariable, ICDIRegisterDescriptor {
}

View file

@ -17,5 +17,5 @@ package org.eclipse.cdt.debug.core.cdi.model;
*
* @since Jul 9, 2002
*/
public interface ICDIRegisterObject extends ICDIVariableObject {
public interface ICDIRegisterDescriptor extends ICDIVariableDescriptor {
}

View file

@ -20,11 +20,19 @@ import org.eclipse.cdt.debug.core.cdi.CDIException;
* @since Jul 9, 2002
*/
public interface ICDIRegisterGroup extends ICDIObject {
/**
* Returns the registers in this register group.
* The name of the group.
*
* @return the registers in this register group
* @return String name
*/
String getName();
/**
* Returns the register descriptors in this register group.
*
* @return ICDIRegisterDescriptor[] in this register group
* @throws CDIException if this method fails. Reasons include:
*/
ICDIRegister[] getRegisters() throws CDIException;
ICDIRegisterDescriptor[] getRegisterDescriptors() throws CDIException;
}

View file

@ -23,6 +23,7 @@ import org.eclipse.cdt.debug.core.cdi.ICDILocation;
* @since Jul 8, 2002
*/
public interface ICDIStackFrame extends ICDIExecuteStepReturn, ICDIObject {
/**
* Returns the location of the instruction pointer in this
* stack frame.
@ -38,7 +39,7 @@ public interface ICDIStackFrame extends ICDIExecuteStepReturn, ICDIObject {
* @return a collection of visible variables
* @throws CDIException if this method fails. Reasons include:
*/
ICDIVariable[] getLocalVariables() throws CDIException;
ICDILocalVariableDescriptor[] getLocalVariableDescriptors() throws CDIException;
/**
* Returns the arguments in this stack frame. An empty collection
@ -47,7 +48,7 @@ public interface ICDIStackFrame extends ICDIExecuteStepReturn, ICDIObject {
* @return a collection of arguments
* @throws CDIException if this method fails. Reasons include:
*/
ICDIArgument[] getArguments() throws CDIException;
ICDIArgumentDescriptor[] getArgumentDescriptors() throws CDIException;
/**
* Returns the thread this stackframe is contained in.

View file

@ -1,21 +0,0 @@
/*******************************************************************************
* Copyright (c) 2000, 2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.debug.core.cdi.model;
/**
*
* Represents a static data structure in the program.
*
* @since Jul 9, 2002
*/
public interface ICDIStaticVariable extends ICDIVariable {
}

View file

@ -47,6 +47,38 @@ public interface ICDITarget extends ICDIThreadGroup, ICDIExpressionManagement,
String evaluateExpressionToString(ICDIStackFrame context, String expressionText)
throws CDIException;
/**
* A static/global variable in a particular function or file,
* filename or/and function is the context for the static ICDIVariableDescriptor.
* <pre>
* hello.c:
* int bar;
* int main() {
* static int bar;
* }
* file.c:
* int foo() {
* static int bar;
* }
* getVariableObject(null, null, "bar");
* getVariableObject(null, "main", "bar");
* getVariableObject("file.c", "foo", "bar");
* </pre>
* @param filename
* @param function
* @param name
* @return ICDIVariableDescriptor
* @throws CDIException
*/
ICDIVariableDescriptor getGlobalVariableDescriptors(String filename, String function, String name) throws CDIException;
/**
* Return the register groups.
*
* @return ICDIRegisterGroup[]
*/
ICDIRegisterGroup[] getRegisterGroups() throws CDIException;
/**
* Returns whether this target is terminated.
*

View file

@ -48,37 +48,20 @@ public interface ICDIThread extends ICDIExecuteStep, ICDIExecuteResume, ICDISusp
ICDIStackFrame[] getStackFrames(int lowFrame, int highFrame) throws CDIException;
/**
* Returns the depth of the stack frames
* Returns the depth of the stack frames.
*
* @return depth of stack frames
* @throws CDIException if this method fails. Reasons include:
*/
int getStackFrameCount() throws CDIException;
/**
* Set the current Stack for the thread.
* Return thread local storage variables descriptor.
*
* @deprecated
* @param - ICDIStackFrame
* @return
* @throws CDIException
*/
void setCurrentStackFrame(ICDIStackFrame current) throws CDIException;
/**
* Set the current frame whithout generation any events, for example
* registers changed events.
*
* @deprecated
* @param frame
* @param b
*/
void setCurrentStackFrame(ICDIStackFrame frame, boolean doUpdate) throws CDIException;
/**
* Set the current stackframe.
*
* @deprecated
* @return ICDIStackFrame
*/
ICDIStackFrame getCurrentStackFrame() throws CDIException;
ICDIThreadStorageDescriptor[] getThreadStorageDescriptors() throws CDIException;
/**
* Equivalent to resume(false)

View file

@ -0,0 +1,25 @@
/**********************************************************************
* Copyright (c) 2002,2003,2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.debug.core.cdi.model;
import org.eclipse.cdt.debug.core.cdi.CDIException;
/**
* ICDIThreadStorage
*/
public interface ICDIThreadStorage extends ICDIVariable {
/**
* @return ICDIThread
*/
ICDIThread getThread() throws CDIException;
}

View file

@ -0,0 +1,29 @@
/**********************************************************************
* Copyright (c) 2002,2003,2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.debug.core.cdi.model;
import org.eclipse.cdt.debug.core.cdi.CDIException;
/**
* ICDIThreadStorageDescriptor
*/
public interface ICDIThreadStorageDescriptor extends
ICDIVariableDescriptor {
/**
* Return the thread.
*
* @return ICDIThread
* @throws CDIException
*/
ICDIThread getThread() throws CDIException;
}

View file

@ -20,8 +20,15 @@ import org.eclipse.cdt.debug.core.cdi.CDIException;
*
* @since Jul 9, 2002
*/
public interface ICDIVariable extends ICDIVariableObject {
public interface ICDIVariable extends ICDIVariableDescriptor {
/**
* Returns true if the value of this variable could be changed.
*
* @return true if the value of this variable could be changed
* @throws CDIException if this method fails. Reasons include:
*/
boolean isEditable() throws CDIException;
/**
* Returns the value of this variable.
@ -56,4 +63,13 @@ public interface ICDIVariable extends ICDIVariableObject {
*/
void setFormat(int format) throws CDIException;
/**
* Remove the variable from the manager list.
*
* @param var
* @return ICDIArgument
* @throws CDIException
*/
void dispose() throws CDIException;
}

View file

@ -18,7 +18,7 @@ import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType;
/**
*
*/
public interface ICDIVariableObject extends ICDIObject {
public interface ICDIVariableDescriptor extends ICDIObject {
/**
* Returns the name of this variable.
@ -28,16 +28,7 @@ public interface ICDIVariableObject extends ICDIObject {
String getName();
/**
* Returns the stackframe where the variable was found
* may return null.
*
* @return the stackframe
* @throws CDIException if this method fails. Reasons include:
*/
ICDIStackFrame getStackFrame() throws CDIException;
/**
* Returns the type of data this variable is declared.
* Returns the type of this variable descriptor.
*
* @return the type of data this variable is declared
* @throws CDIException if this method fails. Reasons include:
@ -45,7 +36,7 @@ public interface ICDIVariableObject extends ICDIObject {
ICDIType getType() throws CDIException;
/**
* Returns the type of data this variable is declared.
* Returns the type name of this variable descriptor.
*
* @return the type of data this variable is declared
* @throws CDIException if this method fails. Reasons include:
@ -53,21 +44,13 @@ public interface ICDIVariableObject extends ICDIObject {
String getTypeName() throws CDIException;
/**
* Returns the size of this variable.
* Returns the size of this variable descriptor.
*
* @return the size of this variable
* @throws CDIException if this method fails. Reasons include:
*/
int sizeof() throws CDIException;
/**
* Returns true if the value of this variable could be changed.
*
* @return true if the value of this variable could be changed
* @throws CDIException if this method fails. Reasons include:
*/
boolean isEditable() throws CDIException;
/**
* Returns the qualified name of this variable.
*
@ -76,12 +59,42 @@ public interface ICDIVariableObject extends ICDIObject {
*/
String getQualifiedName() throws CDIException;
/**
* Consider the variable object as an Array of type and range[start, start + length - 1]
* @param stack
* @param name
* @return ICDIVariableDescriptor
* @throws CDIException
*/
ICDIVariableDescriptor getVariableDescriptorAsArray(int start, int length) throws CDIException;
/**
* Consider the variable descritor as type.
*
* @param stack
* @param name
* @return ICDIVariableDescriptor
* @throws CDIException
*/
ICDIVariableDescriptor getVariableDescriptorAsType(String type) throws CDIException;
/**
* Create a Variable for evaluation. A CreatedEvent will be trigger and
* ChangedEvent will also be trigger when the variable is assign a new value.
* DestroyedEvent is fired when the variable is out of scope and automatically
* removed from the manager list.
* @param var
* @return ICDIVariable
* @throws CDIException
*/
ICDIVariable createVariable() throws CDIException;
/**
* Returns true if the variable Object are the same,
* For example event if the name is the same because of
* casting this may return false;
* @return true if the same
*/
boolean equals(ICDIVariableObject varObject);
boolean equals(ICDIVariableDescriptor varDesc);
}

View file

@ -18,7 +18,7 @@ import org.eclipse.cdt.debug.core.ICDebugConstants;
import org.eclipse.cdt.debug.core.ICRegisterManager;
import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.ICDIManager;
import org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterObject;
import org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterGroup;
import org.eclipse.cdt.debug.internal.core.model.CDebugTarget;
import org.eclipse.cdt.debug.internal.core.model.CRegisterGroup;
import org.eclipse.cdt.debug.internal.core.model.CStackFrame;
@ -103,22 +103,19 @@ public class CRegisterManager extends CUpdateManager implements ICRegisterManage
}
private void createMainRegisterGroup() {
ICDIRegisterObject[] regObjects = null;
ICDIRegisterGroup[] groups = null;
try {
regObjects = getDebugTarget().getCDISession().getRegisterManager().getRegisterObjects();
groups = getDebugTarget().getCDITarget().getRegisterGroups();
}
catch( CDIException e ) {
CDebugCorePlugin.log( e );
}
if ( regObjects != null ) {
fRegisterGroups.add( new CRegisterGroup( getDebugTarget(), "Main", regObjects ) ); //$NON-NLS-1$
for (int i = 0; i < groups.length; ++i) {
fRegisterGroups.add( new CRegisterGroup( getDebugTarget(), groups[i] ) ); //$NON-NLS-1$
}
}
protected ICDIManager getCDIManager() {
if ( getDebugTarget() != null ) {
return getDebugTarget().getCDISession().getRegisterManager();
}
return null;
}

View file

@ -15,7 +15,7 @@ import java.util.List;
import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.model.ICDIValue;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableDescriptor;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIArrayValue;
import org.eclipse.cdt.debug.core.model.CVariableFormat;
import org.eclipse.cdt.debug.core.model.ICType;
@ -34,7 +34,7 @@ public class CArrayPartition extends AbstractCVariable {
private int fEnd;
private ICDIVariableObject fCDIVariableObject;
private ICDIVariableDescriptor fCDIVariableObject;
private ICDIVariable fCDIVariable;
@ -63,7 +63,7 @@ public class CArrayPartition extends AbstractCVariable {
public ICType getType() throws DebugException {
if ( fType == null ) {
try {
ICDIVariableObject varObject = getVariableObject();
ICDIVariableDescriptor varObject = getVariableObject();
if ( varObject != null )
fType = new CType( varObject.getType() );
}
@ -238,9 +238,10 @@ public class CArrayPartition extends AbstractCVariable {
return false;
}
private ICDIVariableObject getVariableObject() throws CDIException {
private ICDIVariableDescriptor getVariableObject() throws CDIException {
if ( fCDIVariableObject == null ) {
fCDIVariableObject = getCDISession().getVariableManager().getVariableObjectAsArray( getCDIVariable(), getStart(), getEnd() - getStart() + 1 );
fCDIVariableObject = getCDIVariable().getVariableDescriptorAsArray(getStart(), getEnd() - getStart() + 1 );
//fCDIVariableObject = getCDISession().getVariableManager().getVariableObjectAsArray( getCDIVariable(), getStart(), getEnd() - getStart() + 1 );
}
return fCDIVariableObject;
}

View file

@ -59,7 +59,7 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary;
import org.eclipse.cdt.debug.core.cdi.model.ICDISignal;
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
import org.eclipse.cdt.debug.core.cdi.model.ICDIThread;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableDescriptor;
import org.eclipse.cdt.debug.core.model.CDebugElementState;
import org.eclipse.cdt.debug.core.model.IBreakpointTarget;
import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint;
@ -1872,9 +1872,9 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
}
public ICGlobalVariable createGlobalVariable( IGlobalVariableDescriptor info ) throws DebugException {
ICDIVariableObject vo = null;
ICDIVariableDescriptor vo = null;
try {
vo = getCDISession().getVariableManager().getGlobalVariableObject( info.getPath().lastSegment(), null, info.getName() );
vo = getCDITarget().getGlobalVariableDescriptors(info.getPath().lastSegment(), null, info.getName());
}
catch( CDIException e ) {
throw new DebugException( new Status( IStatus.ERROR, CDIDebugModel.getPluginIdentifier(), DebugException.TARGET_REQUEST_FAILED, (vo != null) ? vo.getName() + ": " + e.getMessage() : e.getMessage(), null ) ); //$NON-NLS-1$

View file

@ -19,7 +19,7 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDIExpression;
import org.eclipse.cdt.debug.core.cdi.model.ICDIObject;
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
import org.eclipse.cdt.debug.core.cdi.model.ICDIValue;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableDescriptor;
import org.eclipse.cdt.debug.core.model.CVariableFormat;
import org.eclipse.cdt.debug.core.model.ICStackFrame;
import org.eclipse.debug.core.DebugException;
@ -40,7 +40,7 @@ public class CExpression extends CVariable implements IExpression {
/**
* Constructor for CExpression.
*/
public CExpression( CStackFrame frame, ICDIExpression cdiExpression, ICDIVariableObject varObject ) {
public CExpression( CStackFrame frame, ICDIExpression cdiExpression, ICDIVariableDescriptor varObject ) {
super( frame, varObject );
setFormat( CVariableFormat.getFormat( CDebugCorePlugin.getDefault().getPluginPreferences().getInt( ICDebugConstants.PREF_DEFAULT_EXPRESSION_FORMAT ))) ;
fCDIExpression = cdiExpression;
@ -146,7 +146,7 @@ public class CExpression extends CVariable implements IExpression {
public void dispose() {
if ( fCDIExpression != null ) {
try {
getCDITarget().destroyExpressions( new ICDIExpression[] { fCDIExpression } );
fCDIExpression.dispose();
fCDIExpression = null;
}
catch( CDIException e ) {

View file

@ -385,8 +385,7 @@ public class CFormattedMemoryBlock extends CDebugElement
{
try
{
ICDIExpression[] expressions = { fAddressExpression };
((CDebugTarget)getDebugTarget()).getCDITarget().destroyExpressions( expressions );
fAddressExpression.dispose();
}
catch( CDIException e )
{

View file

@ -14,7 +14,7 @@ import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent;
import org.eclipse.cdt.debug.core.cdi.event.ICDIResumedEvent;
import org.eclipse.cdt.debug.core.cdi.model.ICDIObject;
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableDescriptor;
import org.eclipse.cdt.debug.core.model.ICGlobalVariable;
import org.eclipse.cdt.debug.core.model.IGlobalVariableDescriptor;
@ -28,7 +28,7 @@ public class CGlobalVariable extends CVariable implements ICGlobalVariable {
/**
* Constructor for CGlobalVariable.
*/
protected CGlobalVariable( CDebugElement parent, IGlobalVariableDescriptor descriptor, ICDIVariableObject cdiVariableObject ) {
protected CGlobalVariable( CDebugElement parent, IGlobalVariableDescriptor descriptor, ICDIVariableDescriptor cdiVariableObject ) {
super( parent, cdiVariableObject );
fDescriptor = descriptor;
}
@ -36,7 +36,7 @@ public class CGlobalVariable extends CVariable implements ICGlobalVariable {
/**
* Constructor for CGlobalVariable.
*/
protected CGlobalVariable( CDebugElement parent, IGlobalVariableDescriptor descriptor, ICDIVariableObject cdiVariableObject, String message ) {
protected CGlobalVariable( CDebugElement parent, IGlobalVariableDescriptor descriptor, ICDIVariableDescriptor cdiVariableObject, String message ) {
super( parent, cdiVariableObject, message );
fDescriptor = descriptor;
}

View file

@ -13,8 +13,7 @@ package org.eclipse.cdt.debug.internal.core.model;
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.debug.core.ICDebugConstants;
import org.eclipse.cdt.debug.core.cdi.model.ICDIRegister;
import org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterObject;
import org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterDescriptor;
import org.eclipse.cdt.debug.core.model.CVariableFormat;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugException;
@ -29,15 +28,15 @@ public class CRegister extends CGlobalVariable implements IRegister {
/**
* Constructor for CRegister.
*/
protected CRegister( CRegisterGroup parent, ICDIRegister cdiRegister ) {
super( parent, null, cdiRegister );
protected CRegister( CRegisterGroup parent, ICDIRegisterDescriptor cdiRegisterDescriptor ) {
super( parent, null, cdiRegisterDescriptor );
setFormat( CVariableFormat.getFormat( CDebugCorePlugin.getDefault().getPluginPreferences().getInt( ICDebugConstants.PREF_DEFAULT_REGISTER_FORMAT ) ) );
}
/**
* Constructor for CRegister.
*/
protected CRegister( CRegisterGroup parent, ICDIRegisterObject registerObject, String message ) {
protected CRegister( CRegisterGroup parent, ICDIRegisterDescriptor registerObject, String message ) {
super( parent, null, registerObject, message );
setFormat( CVariableFormat.getFormat( CDebugCorePlugin.getDefault().getPluginPreferences().getInt( ICDebugConstants.PREF_DEFAULT_REGISTER_FORMAT ) ) );
}

View file

@ -11,8 +11,8 @@
package org.eclipse.cdt.debug.internal.core.model;
import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.model.ICDIRegister;
import org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterObject;
import org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterDescriptor;
import org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterGroup;
import org.eclipse.cdt.debug.core.model.IEnableDisableTarget;
import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugException;
@ -24,9 +24,7 @@ import org.eclipse.debug.core.model.IRegisterGroup;
*/
public class CRegisterGroup extends CDebugElement implements IRegisterGroup, IEnableDisableTarget {
private String fName;
private ICDIRegisterObject[] fRegisterObjects;
private ICDIRegisterGroup fCDIRegisterGroup;
private IRegister[] fRegisters;
@ -35,35 +33,34 @@ public class CRegisterGroup extends CDebugElement implements IRegisterGroup, IEn
/**
* Constructor for CRegisterGroup.
*/
public CRegisterGroup( CDebugTarget target, String name, ICDIRegisterObject[] regObjects ) {
public CRegisterGroup( CDebugTarget target, ICDIRegisterGroup regGroup ) {
super( target );
fName = name;
fRegisterObjects = regObjects;
fRegisters = new IRegister[regObjects.length];
fCDIRegisterGroup = regGroup;
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IRegisterGroup#getName()
*/
public String getName() throws DebugException {
return fName;
return fCDIRegisterGroup.getName();
}
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.IRegisterGroup#getRegisters()
*/
public IRegister[] getRegisters() throws DebugException {
for ( int i = 0; i < fRegisters.length; ++i ) {
if ( fRegisters[i] == null ) {
try {
fRegisters[i] = new CRegister( this, getCDIRegister( fRegisterObjects[i] ) );
}
catch( DebugException e ) {
fRegisters[i] = new CRegister( this, fRegisterObjects[i], e.getMessage() );
}
if ( ((CRegister)fRegisters[i]).isEnabled() ) {
((CRegister)fRegisters[i]).setEnabled( isEnabled() );
if (fRegisters == null) {
try {
ICDIRegisterDescriptor[] regDescs = fCDIRegisterGroup.getRegisterDescriptors();
fRegisters = new IRegister[regDescs.length];
for ( int i = 0; i < fRegisters.length; ++i ) {
fRegisters[i] = new CRegister( this, regDescs[i] );
if ( ((CRegister)fRegisters[i]).isEnabled() ) {
((CRegister)fRegisters[i]).setEnabled( isEnabled() );
}
}
} catch (CDIException e) {
requestFailed( e.getMessage(), null );
}
}
return fRegisters;
@ -73,10 +70,13 @@ public class CRegisterGroup extends CDebugElement implements IRegisterGroup, IEn
* @see org.eclipse.debug.core.model.IRegisterGroup#hasRegisters()
*/
public boolean hasRegisters() throws DebugException {
return fRegisterObjects.length > 0;
return getRegisters().length > 0;
}
public void dispose() {
if (fRegisters == null) {
return;
}
for ( int i = 0; i < fRegisters.length; ++i ) {
if ( fRegisters[i] != null ) {
((CRegister)fRegisters[i]).dispose();
@ -85,18 +85,10 @@ public class CRegisterGroup extends CDebugElement implements IRegisterGroup, IEn
}
}
private ICDIRegister getCDIRegister( ICDIRegisterObject ro ) throws DebugException {
ICDIRegister register = null;
try {
register = ((CDebugTarget)getDebugTarget()).getCDISession().getRegisterManager().createRegister( ro );
}
catch( CDIException e ) {
requestFailed( e.getMessage(), null );
}
return register;
}
public void targetSuspended() {
if (fRegisters == null) {
return;
}
for ( int i = 0; i < fRegisters.length; ++i ) {
if ( fRegisters[i] != null && ((CRegister)fRegisters[i]).hasErrors() ) {
((CRegister)fRegisters[i]).dispose();

View file

@ -25,7 +25,7 @@ import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent;
import org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener;
import org.eclipse.cdt.debug.core.cdi.model.ICDIExpression;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableDescriptor;
import org.eclipse.cdt.debug.core.model.ICGlobalVariable;
import org.eclipse.cdt.debug.core.model.ICStackFrame;
import org.eclipse.cdt.debug.core.model.IRestart;
@ -116,7 +116,7 @@ public class CStackFrame extends CDebugElement implements ICStackFrame, IRestart
fVariables = new ArrayList( vars.size() );
Iterator it = vars.iterator();
while( it.hasNext() ) {
fVariables.add( CVariableFactory.createVariable( this, (ICDIVariableObject)it.next() ) );
fVariables.add( CVariableFactory.createVariable( this, (ICDIVariableDescriptor)it.next() ) );
}
}
else if ( refreshVariables() ) {
@ -134,7 +134,7 @@ public class CStackFrame extends CDebugElement implements ICStackFrame, IRestart
List locals = getAllCDIVariableObjects();
int index = 0;
while( index < fVariables.size() ) {
ICDIVariableObject varObject = findVariable( locals, (CVariable)fVariables.get( index ) );
ICDIVariableDescriptor varObject = findVariable( locals, (CVariable)fVariables.get( index ) );
if ( varObject != null ) {
locals.remove( varObject );
index++;
@ -147,7 +147,7 @@ public class CStackFrame extends CDebugElement implements ICStackFrame, IRestart
// add any new locals
Iterator newOnes = locals.iterator();
while( newOnes.hasNext() ) {
fVariables.add( CVariableFactory.createVariable( this, (ICDIVariableObject)newOnes.next() ) );
fVariables.add( CVariableFactory.createVariable( this, (ICDIVariableDescriptor)newOnes.next() ) );
}
}
@ -489,7 +489,7 @@ public class CStackFrame extends CDebugElement implements ICStackFrame, IRestart
protected List getCDILocalVariableObjects() throws DebugException {
List list = new ArrayList();
try {
list.addAll( Arrays.asList( getCDISession().getVariableManager().getLocalVariableObjects( getCDIStackFrame() ) ) );
list.addAll( Arrays.asList( getCDIStackFrame().getLocalVariableDescriptors( ) ) );
}
catch( CDIException e ) {
targetRequestFailed( e.getMessage(), null );
@ -504,7 +504,7 @@ public class CStackFrame extends CDebugElement implements ICStackFrame, IRestart
protected List getCDIArgumentObjects() throws DebugException {
List list = new ArrayList();
try {
list.addAll( Arrays.asList( getCDISession().getVariableManager().getArgumentObjects( getCDIStackFrame() ) ) );
list.addAll( Arrays.asList( getCDIStackFrame().getArgumentDescriptors() ) );
}
catch( CDIException e ) {
targetRequestFailed( e.getMessage(), null );
@ -607,10 +607,10 @@ public class CStackFrame extends CDebugElement implements ICStackFrame, IRestart
}
}
protected ICDIVariableObject findVariable( List list, CVariable var ) {
protected ICDIVariableDescriptor findVariable( List list, CVariable var ) {
Iterator it = list.iterator();
while( it.hasNext() ) {
ICDIVariableObject newVarObject = (ICDIVariableObject)it.next();
ICDIVariableDescriptor newVarObject = (ICDIVariableDescriptor)it.next();
if ( var.sameVariable( newVarObject ) )
return newVarObject;
}

View file

@ -33,6 +33,7 @@ import org.eclipse.cdt.debug.core.cdi.model.type.ICDIShortValue;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIWCharValue;
import org.eclipse.cdt.debug.core.model.CVariableFormat;
import org.eclipse.cdt.debug.core.model.ICDebugElementStatus;
import org.eclipse.cdt.debug.core.model.ICStackFrame;
import org.eclipse.cdt.debug.core.model.ICType;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IVariable;
@ -85,7 +86,9 @@ public class CValue extends AbstractCValue {
public String getValueString() throws DebugException {
if ( fValueString == null && getUnderlyingValue() != null ) {
resetStatus();
if ( getParentVariable().getStackFrame().isSuspended() ) {
ICStackFrame cframe = getParentVariable().getStackFrame();
boolean isSuspended = (cframe == null) ? getCDITarget().isSuspended() : cframe.isSuspended();
if ( isSuspended ) {
try {
fValueString = processUnderlyingValue( getUnderlyingValue() );
}

View file

@ -19,12 +19,12 @@ import org.eclipse.cdt.debug.core.cdi.event.ICDIChangedEvent;
import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent;
import org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener;
import org.eclipse.cdt.debug.core.cdi.event.ICDIResumedEvent;
import org.eclipse.cdt.debug.core.cdi.model.ICDIArgumentObject;
import org.eclipse.cdt.debug.core.cdi.model.ICDIArgumentDescriptor;
import org.eclipse.cdt.debug.core.cdi.model.ICDIObject;
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
import org.eclipse.cdt.debug.core.cdi.model.ICDIValue;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableDescriptor;
import org.eclipse.cdt.debug.core.model.CVariableFormat;
import org.eclipse.cdt.debug.core.model.ICDebugElementStatus;
import org.eclipse.cdt.debug.core.model.ICType;
@ -52,7 +52,7 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
/**
* The CDI variable object this variable is based on.
*/
private ICDIVariableObject fCDIVariableObject;
private ICDIVariableDescriptor fCDIVariableObject;
/**
* The underlying CDI variable.
@ -82,7 +82,7 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
/**
* Constructor for InternalVariable.
*/
InternalVariable( CVariable var, ICDIVariableObject varObject ) {
InternalVariable( CVariable var, ICDIVariableDescriptor varObject ) {
setVariable( var );
setCDIVariableObject( varObject );
setCDIVariable( (varObject instanceof ICDIVariable) ? (ICDIVariable)varObject : null );
@ -91,7 +91,7 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
InternalVariable createShadow( int start, int length ) throws DebugException {
InternalVariable iv = null;
try {
iv = new InternalVariable( getVariable(), getCDISession().getVariableManager().getVariableObjectAsArray( getCDIVariableObject(), start, length ) );
iv = new InternalVariable( getVariable(), getCDIVariableObject().getVariableDescriptorAsArray( start, length ) );
}
catch( CDIException e ) {
requestFailed( e.getMessage(), null );
@ -102,7 +102,7 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
InternalVariable createShadow( String type ) throws DebugException {
InternalVariable iv = null;
try {
iv = new InternalVariable( getVariable(), getCDISession().getVariableManager().getVariableObjectAsType( getCDIVariableObject(), type ) );
iv = new InternalVariable( getVariable(), getCDIVariableObject().getVariableDescriptorAsType( type ) );
}
catch( CDIException e ) {
requestFailed( e.getMessage(), null );
@ -113,10 +113,7 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
private synchronized ICDIVariable getCDIVariable() throws DebugException {
if ( fCDIVariable == null ) {
try {
if ( getCDIVariableObject() instanceof ICDIArgumentObject )
fCDIVariable = getCDISession().getVariableManager().createArgument( (ICDIArgumentObject)getCDIVariableObject() );
else
fCDIVariable = getCDISession().getVariableManager().createVariable( getCDIVariableObject() );
fCDIVariable = getCDIVariableObject().createVariable( );
}
catch( CDIException e ) {
requestFailed( e.getMessage(), null );
@ -129,11 +126,11 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
fCDIVariable = variable;
}
private ICDIVariableObject getCDIVariableObject() {
private ICDIVariableDescriptor getCDIVariableObject() {
return fCDIVariableObject;
}
private void setCDIVariableObject( ICDIVariableObject variableObject ) {
private void setCDIVariableObject( ICDIVariableDescriptor variableObject ) {
fCDIVariableObject = variableObject;
}
@ -151,7 +148,7 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
CType getType() throws DebugException {
if ( fType == null ) {
ICDIVariableObject varObject = getCDIVariableObject();
ICDIVariableDescriptor varObject = getCDIVariableObject();
if ( varObject != null ) {
synchronized( this ) {
if ( fType == null ) {
@ -171,7 +168,7 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
synchronized void invalidate() {
try {
if ( fCDIVariable != null )
getCDISession().getVariableManager().destroyVariable( fCDIVariable );
fCDIVariable.dispose();
}
catch( CDIException e ) {
logError( e.getMessage() );
@ -203,7 +200,7 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
}
boolean isArgument() {
return ( getCDIVariableObject() instanceof ICDIArgumentObject );
return ( getCDIVariableObject() instanceof ICDIArgumentDescriptor );
}
void setValue( String expression ) throws DebugException {
@ -308,7 +305,7 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
return false;
}
boolean sameVariable( ICDIVariableObject vo ) {
boolean sameVariable( ICDIVariableDescriptor vo ) {
return getCDIVariableObject().equals( vo );
}
}
@ -341,7 +338,7 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
/**
* Constructor for CVariable.
*/
protected CVariable( CDebugElement parent, ICDIVariableObject cdiVariableObject ) {
protected CVariable( CDebugElement parent, ICDIVariableDescriptor cdiVariableObject ) {
super( parent );
if ( cdiVariableObject != null ) {
fName = cdiVariableObject.getName();
@ -354,7 +351,7 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
/**
* Constructor for CVariable.
*/
protected CVariable( CDebugElement parent, ICDIVariableObject cdiVariableObject, String errorMessage ) {
protected CVariable( CDebugElement parent, ICDIVariableDescriptor cdiVariableObject, String errorMessage ) {
super( parent );
if ( cdiVariableObject != null ) {
fName = cdiVariableObject.getName();
@ -724,7 +721,7 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
return result;
}
private void createOriginal( ICDIVariableObject vo ) {
private void createOriginal( ICDIVariableDescriptor vo ) {
if ( vo != null )
fName = vo.getName();
setOriginal( new InternalVariable( this, vo ) );
@ -784,7 +781,7 @@ public class CVariable extends AbstractCVariable implements ICDIEventListener {
return false;
}
protected boolean sameVariable( ICDIVariableObject vo ) {
protected boolean sameVariable( ICDIVariableDescriptor vo ) {
InternalVariable iv = getOriginal();
return ( iv != null && iv.sameVariable( vo ) );
}

View file

@ -16,7 +16,7 @@ import org.eclipse.cdt.core.IBinaryParser.IBinaryObject;
import org.eclipse.cdt.core.IBinaryParser.ISymbol;
import org.eclipse.cdt.core.model.IBinaryModule;
import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableDescriptor;
import org.eclipse.cdt.debug.core.model.IGlobalVariableDescriptor;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
@ -26,11 +26,11 @@ import org.eclipse.core.runtime.Path;
*/
public class CVariableFactory {
public static CVariable createVariable( CDebugElement parent, ICDIVariableObject cdiVariableObject ) {
public static CVariable createVariable( CDebugElement parent, ICDIVariableDescriptor cdiVariableObject ) {
return new CVariable( parent, cdiVariableObject );
}
public static CVariable createVariableWithError( CDebugElement parent, ICDIVariableObject cdiVariableObject, String message ) {
public static CVariable createVariableWithError( CDebugElement parent, ICDIVariableDescriptor cdiVariableObject, String message ) {
return new CVariable( parent, cdiVariableObject, message );
}
@ -69,7 +69,7 @@ public class CVariableFactory {
}
public static CGlobalVariable createGlobalVariable( CDebugElement parent, IGlobalVariableDescriptor descriptor, ICDIVariableObject cdiVariableObject ) {
public static CGlobalVariable createGlobalVariable( CDebugElement parent, IGlobalVariableDescriptor descriptor, ICDIVariableDescriptor cdiVariableObject ) {
return new CGlobalVariable( parent, descriptor, cdiVariableObject );
}
}

View file

@ -1,3 +1,13 @@
2004-10-31 Alain Magloire
Refactor ICDIVariableObject --> ICDIVariableDescriptor
Refactor ICDIArgumentObject --> ICDIArgumentDescriptor
Refactor ICDIRegisterObject --> ICDIRegisterDescriptor
Addition ICDIThreadStorageDescriptor, ICDIThreadStorage
Addition ICDILocalVariableDescriptor, ICDILocalVariable
Addition ICDIGlobalVariableDescriptor, ICDIGlovalVariable
Adjust the classes to the changes.
2004-10-29 Alain Magloire
Remove of ICDISharedLibraryManager
* cdi/org/eclipse/cdt/debug/core/cdi/Session.java

View file

@ -23,7 +23,6 @@ import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent;
import org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener;
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.ICDIThread;
import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.cdi.event.ChangedEvent;
@ -149,7 +148,7 @@ public class EventManager extends SessionObject implements ICDIEventManager, Obs
// Something change we do not know what
// Let the signal manager handle it with an update().
try {
SignalManager sMgr = (SignalManager)session.getSignalManager();
SignalManager sMgr = session.getSignalManager();
sMgr.update(currentTarget);
} catch (CDIException e) {
}
@ -265,12 +264,6 @@ public class EventManager extends SessionObject implements ICDIEventManager, Obs
Session session = (Session)getSession();
MISession miSession = stopped.getMISession();
Target currentTarget = session.getTarget(miSession);
try {
session.setCurrentTarget(currentTarget);
} catch (CDIException e) {
//TODO: Should not ignore this.
}
if (processSharedLibEvent(stopped)) {
// Event was consumed by the shared lib processing bailout
return false;
@ -284,7 +277,7 @@ public class EventManager extends SessionObject implements ICDIEventManager, Obs
int threadId = threadId = stopped.getThreadId();
currentTarget.updateState(threadId);
try {
ICDIThread cthread = currentTarget.getCurrentThread();
Thread cthread = (Thread)currentTarget.getCurrentThread();
if (cthread != null) {
cthread.getCurrentStackFrame();
} else {
@ -297,14 +290,14 @@ public class EventManager extends SessionObject implements ICDIEventManager, Obs
// Update the managers.
// For the Variable/Expression Managers call only the updateManager.
VariableManager varMgr = (VariableManager)session.getVariableManager();
VariableManager varMgr = session.getVariableManager();
ExpressionManager expMgr = session.getExpressionManager();
RegisterManager regMgr = (RegisterManager)session.getRegisterManager();
RegisterManager regMgr = session.getRegisterManager();
MemoryManager memMgr = session.getMemoryManager();
BreakpointManager bpMgr = session.getBreakpointManager();
SignalManager sigMgr = (SignalManager)session.getSignalManager();
SourceManager srcMgr = (SourceManager)session.getSourceManager();
SharedLibraryManager libMgr = (SharedLibraryManager)session.getSharedLibraryManager();
SignalManager sigMgr = session.getSignalManager();
SourceManager srcMgr = session.getSourceManager();
SharedLibraryManager libMgr = session.getSharedLibraryManager();
try {
if (varMgr.isAutoUpdate()) {
varMgr.update(currentTarget);
@ -434,14 +427,12 @@ public class EventManager extends SessionObject implements ICDIEventManager, Obs
int miLevel = 0;
int tid = 0;
ICDIThread currentThread = null;
Thread currentThread = null;
try {
currentThread = currentTarget.getCurrentThread();
currentThread = (Thread)currentTarget.getCurrentThread();
} catch (CDIException e1) {
}
if (currentThread instanceof Thread) {
tid = ((Thread)currentThread).getId();
}
tid = currentThread.getId();
// Select the old thread now.
if (tid > 0) {
MIThreadSelect selectThread = factory.createMIThreadSelect(tid);

View file

@ -18,14 +18,14 @@ import java.util.Map;
import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.model.ICDIExpression;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.ICDIThread;
import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.cdi.model.Expression;
import org.eclipse.cdt.debug.mi.core.cdi.model.LocalVariable;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame;
import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
import org.eclipse.cdt.debug.mi.core.cdi.model.Thread;
import org.eclipse.cdt.debug.mi.core.cdi.model.Variable;
import org.eclipse.cdt.debug.mi.core.cdi.model.VariableObject;
import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
import org.eclipse.cdt.debug.mi.core.command.MIVarCreate;
import org.eclipse.cdt.debug.mi.core.command.MIVarDelete;
@ -151,12 +151,12 @@ public class ExpressionManager extends Manager {
return null;
}
public Variable createVariable(ICDIStackFrame frame, String code) throws CDIException {
public Variable createVariable(StackFrame frame, String code) throws CDIException {
Target target = (Target)frame.getTarget();
ICDIThread currentThread = target.getCurrentThread();
ICDIStackFrame currentFrame = currentThread.getCurrentStackFrame();
Thread currentThread = (Thread)target.getCurrentThread();
StackFrame currentFrame = currentThread.getCurrentStackFrame();
target.setCurrentThread(frame.getThread(), false);
frame.getThread().setCurrentStackFrame(frame, false);
((Thread)frame.getThread()).setCurrentStackFrame(frame, false);
try {
MISession mi = target.getMISession();
CommandFactory factory = mi.getCommandFactory();
@ -166,8 +166,7 @@ public class ExpressionManager extends Manager {
if (info == null) {
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
VariableObject varObj = new VariableObject(target, code, frame, 0, 0);
Variable variable = new Variable(varObj, info.getMIVar());
Variable variable = new LocalVariable(target, null, frame, code, null, 0, 0, info.getMIVar());
variableList.add(variable);
return variable;
} catch (MIException e) {

View file

@ -12,7 +12,6 @@
package org.eclipse.cdt.debug.mi.core.cdi;
import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.ICDIManager;
import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent;
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
@ -21,7 +20,7 @@ import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
* Manager
*
*/
public abstract class Manager extends SessionObject implements ICDIManager {
public abstract class Manager extends SessionObject {
boolean autoUpdate;

View file

@ -19,7 +19,6 @@ public class ProcessManager extends Manager {
static final Target[] EMPTY_TARGETS = new Target[0];
Vector debugTargetList;
Target currentTarget;
public ProcessManager(Session session) {
super(session, true);
@ -37,7 +36,7 @@ public class ProcessManager extends Manager {
return (ICDITarget[]) debugTargetList.toArray(new ICDITarget[debugTargetList.size()]);
}
public void addTargets(Target[] targets, Target current) {
public void addTargets(Target[] targets) {
EventManager eventManager = (EventManager)getSession().getEventManager();
for (int i = 0; i < targets.length; ++i) {
Target target = targets[i];
@ -50,9 +49,6 @@ public class ProcessManager extends Manager {
}
}
}
if (current != null && debugTargetList.contains(current)) {
currentTarget = current;
}
debugTargetList.trimToSize();
}
@ -64,9 +60,6 @@ public class ProcessManager extends Manager {
if (miSession != null) {
miSession.deleteObserver(eventManager);
}
if (currentTarget != null && currentTarget.equals(target)) {
currentTarget = null;
}
debugTargetList.remove(target);
}
debugTargetList.trimToSize();
@ -86,20 +79,6 @@ public class ProcessManager extends Manager {
return null;
}
/**
* @return
*/
public Target getCurrentTarget() {
return currentTarget;
}
/**
* @param current
*/
public void setCurrentTarget(Target current) {
currentTarget = current;
}
public void update(Target target) throws CDIException {
}

View file

@ -17,13 +17,13 @@ import java.util.List;
import java.util.Map;
import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.ICDIRegisterManager;
import org.eclipse.cdt.debug.core.cdi.model.ICDIRegister;
import org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterObject;
import org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterDescriptor;
import org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterGroup;
import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.cdi.model.Register;
import org.eclipse.cdt.debug.mi.core.cdi.model.RegisterObject;
import org.eclipse.cdt.debug.mi.core.cdi.model.RegisterDescriptor;
import org.eclipse.cdt.debug.mi.core.cdi.model.RegisterGroup;
import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
import org.eclipse.cdt.debug.mi.core.command.MIDataListChangedRegisters;
@ -35,14 +35,13 @@ import org.eclipse.cdt.debug.mi.core.event.MIRegisterChangedEvent;
import org.eclipse.cdt.debug.mi.core.event.MIVarChangedEvent;
import org.eclipse.cdt.debug.mi.core.output.MIDataListChangedRegistersInfo;
import org.eclipse.cdt.debug.mi.core.output.MIDataListRegisterNamesInfo;
import org.eclipse.cdt.debug.mi.core.output.MIVar;
import org.eclipse.cdt.debug.mi.core.output.MIVarChange;
import org.eclipse.cdt.debug.mi.core.output.MIVarCreateInfo;
import org.eclipse.cdt.debug.mi.core.output.MIVarUpdateInfo;
/**
*/
public class RegisterManager extends Manager implements ICDIRegisterManager {
public class RegisterManager extends Manager {
Map regsMap;
MIVarChange[] noChanges = new MIVarChange[0];
@ -60,14 +59,17 @@ public class RegisterManager extends Manager implements ICDIRegisterManager {
}
return regsList;
}
/**
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#getRegisterObjects()
*/
public ICDIRegisterObject[] getRegisterObjects() throws CDIException {
Target target = ((Session)getSession()).getCurrentTarget();
return getRegisterObjects(target);
public ICDIRegisterGroup[] getRegisterGroups(Target target) throws CDIException {
RegisterGroup group = new RegisterGroup(target, "Main"); //$NON-NLS-1$
return new ICDIRegisterGroup[] { group };
}
public ICDIRegisterObject[] getRegisterObjects(Target target) throws CDIException {
public ICDIRegisterDescriptor[] getRegisterDescriptors(RegisterGroup group) throws CDIException {
Target target = (Target)group.getTarget();
return getRegisterDescriptors(target);
}
public ICDIRegisterDescriptor[] getRegisterDescriptors(Target target) throws CDIException {
Session session = (Session)getSession();
MISession mi = target.getMISession();
CommandFactory factory = mi.getCommandFactory();
@ -83,66 +85,42 @@ public class RegisterManager extends Manager implements ICDIRegisterManager {
List regsList = new ArrayList(names.length);
for (int i = 0; i < names.length; i++) {
if (names[i].length() > 0) {
regsList.add(new RegisterObject(target, names[i], i));
regsList.add(new RegisterDescriptor(target, null, null, names[i], null, i, 0));
}
}
return (ICDIRegisterObject[])regsList.toArray(new ICDIRegisterObject[0]);
return (ICDIRegisterDescriptor[])regsList.toArray(new ICDIRegisterDescriptor[0]);
} catch (MIException e) {
throw new MI2CDIException(e);
} finally {
}
}
/**
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#createRegister()
*/
public ICDIRegister createRegister(ICDIRegisterObject regObject) throws CDIException {
RegisterObject regObj = null;
if (regObject instanceof RegisterObject) {
regObj = (RegisterObject)regObject;
}
if (regObj != null) {
Register reg = getRegister(regObject);
if (reg == null) {
try {
String name = "$" + regObj.getName(); //$NON-NLS-1$
Target target = (Target)regObj.getTarget();
MISession mi = target.getMISession();
CommandFactory factory = mi.getCommandFactory();
MIVarCreate var = factory.createMIVarCreate(name);
mi.postCommand(var);
MIVarCreateInfo info = var.getMIVarCreateInfo();
if (info == null) {
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
reg = new Register(regObj, info.getMIVar());
List regList = getRegistersList(target);
regList.add(reg);
} catch (MIException e) {
throw new MI2CDIException(e);
public Register createRegister(RegisterDescriptor regDesc) throws CDIException {
Register reg = getRegister(regDesc);
if (reg == null) {
try {
String name = "$" + regDesc.getName(); //$NON-NLS-1$
Target target = (Target)regDesc.getTarget();
MISession mi = target.getMISession();
CommandFactory factory = mi.getCommandFactory();
MIVarCreate var = factory.createMIVarCreate(name);
mi.postCommand(var);
MIVarCreateInfo info = var.getMIVarCreateInfo();
if (info == null) {
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
reg = new Register(regDesc, info.getMIVar());
List regList = getRegistersList(target);
regList.add(reg);
} catch (MIException e) {
throw new MI2CDIException(e);
}
return reg;
}
throw new CDIException(CdiResources.getString("cdi.RegisterManager.Wrong_register_type")); //$NON-NLS-1$
}
public Register createRegister(RegisterObject v, MIVar mivar) throws CDIException {
Register reg = new Register(v, mivar);
Target target = (Target)v.getTarget();
List regList = (List) regsMap.get(target);
if (regList == null) {
regList = Collections.synchronizedList(new ArrayList());
regsMap.put(target, regList);
}
regList.add(reg);
return reg;
//throw new CDIException(CdiResources.getString("cdi.RegisterManager.Wrong_register_type")); //$NON-NLS-1$
}
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDIRegisterManager#destroyRegister(ICDIRegister)
*/
public void destroyRegister(ICDIRegister reg) {
public void destroyRegister(Register reg) {
Target target = (Target)reg.getTarget();
List regList = (List)regsMap.get(target);
if (regList != null) {
@ -248,13 +226,11 @@ public class RegisterManager extends Manager implements ICDIRegisterManager {
}
return new Register[0];
}
private Register getRegister(ICDIRegisterObject regObject) throws CDIException {
Register[] regs = getRegisters((Target)regObject.getTarget());
private Register getRegister(RegisterDescriptor regDesc) throws CDIException {
Register[] regs = getRegisters((Target)regDesc.getTarget());
for (int i = 0; i < regs.length; i++) {
if (regObject.getName().equals(regs[i].getName())) {
if (regDesc.getName().equals(regs[i].getName())) {
return regs[i];
}
}

View file

@ -16,10 +16,8 @@ import java.util.Properties;
import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.ICDIConfiguration;
import org.eclipse.cdt.debug.core.cdi.ICDIEventManager;
import org.eclipse.cdt.debug.core.cdi.ICDIRegisterManager;
import org.eclipse.cdt.debug.core.cdi.ICDISession;
import org.eclipse.cdt.debug.core.cdi.ICDISessionObject;
import org.eclipse.cdt.debug.core.cdi.ICDIVariableManager;
import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent;
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
import org.eclipse.cdt.debug.mi.core.MIException;
@ -53,7 +51,7 @@ public class Session implements ICDISession, ICDISessionObject {
setConfiguration(new Configuration(miSession, attach));
Target target = new Target(this, miSession);
addTargets(new Target[] { target }, target);
addTargets(new Target[] { target });
}
public Session(MISession miSession) {
@ -61,7 +59,7 @@ public class Session implements ICDISession, ICDISessionObject {
setConfiguration(new CoreFileConfiguration());
Target target = new Target(this, miSession);
addTargets(new Target[] { target }, target);
addTargets(new Target[] { target });
}
public Session() {
@ -84,9 +82,9 @@ public class Session implements ICDISession, ICDISessionObject {
sharedLibraryManager = new SharedLibraryManager(this);
}
public void addTargets(Target[] targets, Target current) {
public void addTargets(Target[] targets) {
ProcessManager pMgr = getProcessManager();
pMgr.addTargets(targets, current);
pMgr.addTargets(targets);
}
public void removeTargets(Target[] targets) {
@ -99,15 +97,6 @@ public class Session implements ICDISession, ICDISessionObject {
return pMgr.getTarget(miSession);
}
/**
* @deprecated
* @return
*/
public Target getCurrentTarget() {
ProcessManager pMgr = getProcessManager();
return pMgr.getCurrentTarget();
}
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDISession#getAttribute(String)
*/
@ -119,9 +108,6 @@ public class Session implements ICDISession, ICDISessionObject {
return processManager;
}
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDISession#getBreakpointManager()
*/
public BreakpointManager getBreakpointManager() {
return breakpointManager;
}
@ -133,24 +119,15 @@ public class Session implements ICDISession, ICDISessionObject {
return eventManager;
}
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDISession#getExpressionManager()
*/
public ExpressionManager getExpressionManager() {
return expressionManager;
}
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDISession#getVariableManager()
*/
public ICDIVariableManager getVariableManager() {
public VariableManager getVariableManager() {
return variableManager;
}
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDISession#getRegisterManager()
*/
public ICDIRegisterManager getRegisterManager() {
public RegisterManager getRegisterManager() {
return registerManager;
}
@ -179,15 +156,6 @@ public class Session implements ICDISession, ICDISessionObject {
}
/**
* @deprecated
* @see org.eclipse.cdt.debug.core.cdi.ICDISession#setCurrentTarget()
*/
public void setCurrentTarget(Target target) throws CDIException {
ProcessManager pMgr = getProcessManager();
pMgr.setCurrentTarget(target);
}
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDISession#setAttribute(String, String)
*/
public void setAttribute(String key, String value) {
@ -262,7 +230,11 @@ public class Session implements ICDISession, ICDISessionObject {
* @see org.eclipse.cdt.debug.core.cdi.ICDISession#getSessionProcess()
*/
public Process getSessionProcess() throws CDIException {
return getSessionProcess(getCurrentTarget());
ICDITarget[] targets = getTargets();
if (targets != null && targets.length > 0) {
return getSessionProcess(targets[0]);
}
return null;
}
public Process getSessionProcess(ICDITarget target) {

View file

@ -16,8 +16,6 @@ import java.util.StringTokenizer;
import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction;
import org.eclipse.cdt.debug.core.cdi.model.ICDIMixedInstruction;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.ICDIThread;
import org.eclipse.cdt.debug.mi.core.GDBTypeParser;
import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.MISession;
@ -25,7 +23,9 @@ import org.eclipse.cdt.debug.mi.core.GDBTypeParser.GDBDerivedType;
import org.eclipse.cdt.debug.mi.core.GDBTypeParser.GDBType;
import org.eclipse.cdt.debug.mi.core.cdi.model.Instruction;
import org.eclipse.cdt.debug.mi.core.cdi.model.MixedInstruction;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame;
import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
import org.eclipse.cdt.debug.mi.core.cdi.model.Thread;
import org.eclipse.cdt.debug.mi.core.cdi.model.type.ArrayType;
import org.eclipse.cdt.debug.mi.core.cdi.model.type.BoolType;
import org.eclipse.cdt.debug.mi.core.cdi.model.type.CharType;
@ -184,7 +184,7 @@ public class SourceManager extends Manager {
public void update(Target target) throws CDIException {
}
public Type getType(ICDIStackFrame frame, String name) throws CDIException {
public Type getType(StackFrame frame, String name) throws CDIException {
if (name == null) {
name = new String();
}
@ -234,7 +234,7 @@ public class SourceManager extends Manager {
throw new CDIException(CdiResources.getString("cdi.SourceManager.Unknown_type")); //$NON-NLS-1$
}
Type toCDIType(ICDIStackFrame frame, String name) throws CDIException {
Type toCDIType(StackFrame frame, String name) throws CDIException {
// Check the derived types and agregate types
if (name == null) {
name = new String();
@ -399,13 +399,13 @@ public class SourceManager extends Manager {
throw new CDIException(CdiResources.getString("cdi.SourceManager.Unknown_type")); //$NON-NLS-1$
}
public String getDetailTypeName(ICDIStackFrame frame, String typename) throws CDIException {
public String getDetailTypeName(StackFrame frame, String typename) throws CDIException {
Session session = (Session)getSession();
Target target = (Target)frame.getTarget();
ICDIThread currentThread = target.getCurrentThread();
ICDIStackFrame currentFrame = currentThread.getCurrentStackFrame();
Thread currentThread = (Thread)target.getCurrentThread();
StackFrame currentFrame = currentThread.getCurrentStackFrame();
target.setCurrentThread(frame.getThread(), false);
frame.getThread().setCurrentStackFrame(frame, false);
((Thread)frame.getThread()).setCurrentStackFrame(frame, false);
try {
MISession mi = target.getMISession();
CommandFactory factory = mi.getCommandFactory();
@ -424,16 +424,16 @@ public class SourceManager extends Manager {
}
}
public String getTypeName(ICDIStackFrame frame, String variable) throws CDIException {
public String getTypeName(StackFrame frame, String variable) throws CDIException {
Session session = (Session)getSession();
Target target = (Target)frame.getTarget();
ICDIThread currentThread = null;
ICDIStackFrame currentFrame = null;
Thread currentThread = null;
StackFrame currentFrame = null;
if (frame != null) {
currentThread = target.getCurrentThread();
currentThread = (Thread)target.getCurrentThread();
currentFrame = currentThread.getCurrentStackFrame();
target.setCurrentThread(frame.getThread(), false);
frame.getThread().setCurrentStackFrame(frame, false);
((Thread)frame.getThread()).setCurrentStackFrame(frame, false);
}
try {
MISession mi = target.getMISession();

View file

@ -17,21 +17,29 @@ import java.util.List;
import java.util.Map;
import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.ICDIVariableManager;
import org.eclipse.cdt.debug.core.cdi.model.ICDIArgument;
import org.eclipse.cdt.debug.core.cdi.model.ICDIArgumentObject;
import org.eclipse.cdt.debug.core.cdi.model.ICDIArgumentDescriptor;
import org.eclipse.cdt.debug.core.cdi.model.ICDILocalVariableDescriptor;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.ICDIThread;
import org.eclipse.cdt.debug.core.cdi.model.ICDIThreadStorageDescriptor;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject;
import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.cdi.model.Argument;
import org.eclipse.cdt.debug.mi.core.cdi.model.ArgumentObject;
import org.eclipse.cdt.debug.mi.core.cdi.model.ArgumentDescriptor;
import org.eclipse.cdt.debug.mi.core.cdi.model.GlobalVariable;
import org.eclipse.cdt.debug.mi.core.cdi.model.GlobalVariableDescriptor;
import org.eclipse.cdt.debug.mi.core.cdi.model.LocalVariable;
import org.eclipse.cdt.debug.mi.core.cdi.model.LocalVariableDescriptor;
import org.eclipse.cdt.debug.mi.core.cdi.model.Register;
import org.eclipse.cdt.debug.mi.core.cdi.model.RegisterDescriptor;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame;
import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
import org.eclipse.cdt.debug.mi.core.cdi.model.Thread;
import org.eclipse.cdt.debug.mi.core.cdi.model.ThreadStorage;
import org.eclipse.cdt.debug.mi.core.cdi.model.ThreadStorageDescriptor;
import org.eclipse.cdt.debug.mi.core.cdi.model.Variable;
import org.eclipse.cdt.debug.mi.core.cdi.model.VariableObject;
import org.eclipse.cdt.debug.mi.core.cdi.model.VariableDescriptor;
import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
import org.eclipse.cdt.debug.mi.core.command.MIPType;
import org.eclipse.cdt.debug.mi.core.command.MIStackListArguments;
@ -54,7 +62,7 @@ import org.eclipse.cdt.debug.mi.core.output.MIVarUpdateInfo;
/**
*/
public class VariableManager extends Manager implements ICDIVariableManager {
public class VariableManager extends Manager {
static final ICDIVariable[] EMPTY_VARIABLES = {};
// We put a restriction on how deep we want to
@ -101,12 +109,13 @@ public class VariableManager extends Manager implements ICDIVariableManager {
}
/**
* Return the Element with this stackframe, and with this name.
* Return the Element with this thread/stackframe, and with this name.
* null is return if the element is not in the cache.
*/
Variable findVariable(VariableObject v) throws CDIException {
Variable findVariable(VariableDescriptor v) throws CDIException {
Target target = (Target)v.getTarget();
ICDIStackFrame stack = v.getStackFrame();
ICDIStackFrame vstack = v.getStackFrame();
ICDIThread vthread = v.getThread();
String name = v.getName();
int position = v.getPosition();
int depth = v.getStackDepth();
@ -119,13 +128,19 @@ public class VariableManager extends Manager implements ICDIVariableManager {
|| (vars[i].getCastingType() != null
&& v.getCastingType() != null
&& vars[i].getCastingType().equals(v.getCastingType())))) {
ICDIStackFrame frame = vars[i].getStackFrame();
if (stack == null && frame == null) {
return vars[i];
} else if (frame != null && stack != null && frame.equals(stack)) {
if (vars[i].getPosition() == position) {
if (vars[i].getStackDepth() == depth) {
return vars[i];
// check threads
ICDIThread thread = vars[i].getThread();
if ((vthread == null && thread == null) ||
(vthread != null && thread != null && thread.equals(vthread))) {
// check stackframes
ICDIStackFrame frame = vars[i].getStackFrame();
if (vstack == null && frame == null) {
return vars[i];
} else if (frame != null && vstack != null && frame.equals(vstack)) {
if (vars[i].getPosition() == position) {
if (vars[i].getStackDepth() == depth) {
return vars[i];
}
}
}
}
@ -152,10 +167,10 @@ public class VariableManager extends Manager implements ICDIVariableManager {
if (type != null && type.length() > 0) {
Session session = (Session)getSession();
Target target = (Target)frame.getTarget();
ICDIThread currentThread = target.getCurrentThread();
ICDIStackFrame currentFrame = currentThread.getCurrentStackFrame();
Thread currentThread = (Thread)target.getCurrentThread();
StackFrame currentFrame = currentThread.getCurrentStackFrame();
target.setCurrentThread(frame.getThread(), false);
frame.getThread().setCurrentStackFrame(frame, false);
((Thread)frame.getThread()).setCurrentStackFrame(frame, false);
try {
MISession miSession = target.getMISession();
CommandFactory factory = miSession.getCommandFactory();
@ -212,76 +227,138 @@ public class VariableManager extends Manager implements ICDIVariableManager {
}
}
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#createArgument(ICDIArgumentObject)
*/
public ICDIArgument createArgument(ICDIArgumentObject a) throws CDIException {
ArgumentObject argObj = null;
if (a instanceof ArgumentObject) {
argObj = (ArgumentObject) a;
public VariableDescriptor getVariableDescriptorAsArray(VariableDescriptor varDesc, int start, int length)
throws CDIException {
Target target = (Target)varDesc.getTarget();
Thread thread = (Thread)varDesc.getThread();
StackFrame frame = (StackFrame)varDesc.getStackFrame();
String name = varDesc.getName();
String fullName = varDesc.getFullName();
int pos = varDesc.getPosition();
int depth = varDesc.getStackDepth();
VariableDescriptor vo = null;
if (varDesc instanceof ArgumentDescriptor || varDesc instanceof Argument) {
vo = new ArgumentDescriptor(target, thread, frame, name, fullName, pos, depth);
} else if (varDesc instanceof LocalVariableDescriptor || varDesc instanceof LocalVariable) {
vo = new LocalVariableDescriptor(target, thread, frame, name, fullName, pos, depth);
} else if (varDesc instanceof GlobalVariableDescriptor || varDesc instanceof GlobalVariable) {
vo = new GlobalVariableDescriptor(target, thread, frame, name, fullName, pos, depth);
} else if (varDesc instanceof RegisterDescriptor || varDesc instanceof Register) {
vo = new RegisterDescriptor(target, thread, frame, name, fullName, pos, depth);
} else if (varDesc instanceof ThreadStorageDescriptor || varDesc instanceof ThreadStorage) {
vo = new ThreadStorageDescriptor(target, thread, frame, name, fullName, pos, depth);
} else {
throw new CDIException(CdiResources.getString("cdi.VariableManager.Unknown_variable_object")); //$NON-NLS-1$
}
if (argObj != null) {
Variable variable = findVariable(argObj);
Argument argument = null;
if (variable != null && variable instanceof Argument) {
argument = (Argument) variable;
}
if (argument == null) {
String name = argObj.getQualifiedName();
ICDIStackFrame stack = argObj.getStackFrame();
Session session = (Session) getSession();
ICDIThread currentThread = null;
ICDIStackFrame currentFrame = null;
Target target = (Target)argObj.getTarget();
if (stack != null) {
currentThread = target.getCurrentThread();
currentFrame = currentThread.getCurrentStackFrame();
target.setCurrentThread(stack.getThread(), false);
stack.getThread().setCurrentStackFrame(stack, false);
}
try {
MISession mi = target.getMISession();
CommandFactory factory = mi.getCommandFactory();
MIVarCreate var = factory.createMIVarCreate(name);
mi.postCommand(var);
MIVarCreateInfo info = var.getMIVarCreateInfo();
if (info == null) {
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
argument = new Argument(argObj, info.getMIVar());
List variablesList = getVariablesList(target);
variablesList.add(argument);
} catch (MIException e) {
throw new MI2CDIException(e);
} finally {
if (currentThread != null) {
target.setCurrentThread(currentThread, false);
currentThread.setCurrentStackFrame(currentFrame, false);
}
}
}
return argument;
}
throw new CDIException(CdiResources.getString("cdi.VariableManager.Wrong_variable_type")); //$NON-NLS-1$
vo.setCastingArrayStart(varDesc.getCastingArrayStart() + start);
vo.setCastingArrayEnd(length);
return vo;
}
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#getArgumentObjects(ICDIStackFrame)
*/
public ICDIArgumentObject[] getArgumentObjects(ICDIStackFrame frame) throws CDIException {
public VariableDescriptor getVariableDescriptorAsType(VariableDescriptor varDesc, String type) throws CDIException {
// throw an exception if not a good type.
Target target = (Target)varDesc.getTarget();
Thread thread = (Thread)varDesc.getThread();
StackFrame frame = (StackFrame)varDesc.getStackFrame();
String name = varDesc.getName();
String fullName = varDesc.getFullName();
int pos = varDesc.getPosition();
int depth = varDesc.getStackDepth();
checkType(frame, type);
VariableDescriptor vo = null;
if (varDesc instanceof ArgumentDescriptor || varDesc instanceof Argument) {
vo = new ArgumentDescriptor(target, thread, frame, name, fullName, pos, depth);
} else if (varDesc instanceof LocalVariableDescriptor || varDesc instanceof LocalVariable) {
vo = new LocalVariableDescriptor(target, thread, frame, name, fullName, pos, depth);
} else if (varDesc instanceof GlobalVariableDescriptor || varDesc instanceof GlobalVariable) {
vo = new GlobalVariableDescriptor(target, thread, frame, name, fullName, pos, depth);
} else if (varDesc instanceof ThreadStorageDescriptor || varDesc instanceof ThreadStorage) {
vo = new ThreadStorageDescriptor(target, thread, frame, name, fullName, pos, depth);
} else if (varDesc instanceof RegisterDescriptor || varDesc instanceof Register) {
vo = new RegisterDescriptor(target, thread, frame, name, fullName, pos, depth);
} else {
throw new CDIException(CdiResources.getString("cdi.VariableManager.Unknown_variable_object")); //$NON-NLS-1$
}
String casting = varDesc.getCastingType();
if (casting != null && casting.length() > 0) {
type = "(" + type + ")" + "(" + casting + " )"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
}
vo.setCastingType(type);
return vo;
}
public ICDIVariable createVariable(VariableDescriptor varDesc) throws CDIException {
if (varDesc instanceof ArgumentDescriptor) {
return createArgument((ArgumentDescriptor)varDesc);
} else if (varDesc instanceof LocalVariableDescriptor) {
return createLocalVariable((LocalVariableDescriptor)varDesc);
} else if (varDesc instanceof GlobalVariableDescriptor) {
return createGlobalVariable((GlobalVariableDescriptor)varDesc);
} else if (varDesc instanceof RegisterDescriptor) {
RegisterManager regMgr = ((Session)getSession()).getRegisterManager();
return regMgr.createRegister((RegisterDescriptor)varDesc);
} else if (varDesc instanceof ThreadStorageDescriptor) {
return createThreadStorage((ThreadStorageDescriptor)varDesc);
}
throw new CDIException(CdiResources.getString("cdi.VariableManager.Unknown_variable_object")); //$NON-NLS-1$
}
public Argument createArgument(ArgumentDescriptor argDesc) throws CDIException {
Variable variable = findVariable(argDesc);
Argument argument = null;
if (variable != null && variable instanceof Argument) {
argument = (Argument) variable;
}
if (argument == null) {
String name = argDesc.getQualifiedName();
StackFrame stack = (StackFrame)argDesc.getStackFrame();
Session session = (Session) getSession();
Target target = (Target)argDesc.getTarget();
Thread currentThread = (Thread)target.getCurrentThread();
StackFrame currentFrame = currentThread.getCurrentStackFrame();
target.setCurrentThread(stack.getThread(), false);
((Thread)stack.getThread()).setCurrentStackFrame(stack, false);
try {
MISession mi = target.getMISession();
CommandFactory factory = mi.getCommandFactory();
MIVarCreate var = factory.createMIVarCreate(name);
mi.postCommand(var);
MIVarCreateInfo info = var.getMIVarCreateInfo();
if (info == null) {
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
argument = new Argument(argDesc, info.getMIVar());
List variablesList = getVariablesList(target);
variablesList.add(argument);
} catch (MIException e) {
throw new MI2CDIException(e);
} finally {
target.setCurrentThread(currentThread, false);
currentThread.setCurrentStackFrame(currentFrame, false);
}
}
return argument;
}
public ICDIArgumentDescriptor[] getArgumentDescriptors(StackFrame frame) throws CDIException {
List argObjects = new ArrayList();
Session session = (Session) getSession();
Target target = (Target)frame.getTarget();
ICDIThread currentThread = target.getCurrentThread();
ICDIStackFrame currentFrame = currentThread.getCurrentStackFrame();
Thread currentThread = (Thread)target.getCurrentThread();
StackFrame currentFrame = currentThread.getCurrentStackFrame();
target.setCurrentThread(frame.getThread(), false);
frame.getThread().setCurrentStackFrame(frame, false);
((Thread)frame.getThread()).setCurrentStackFrame(frame, false);
try {
MISession mi = target.getMISession();
CommandFactory factory = mi.getCommandFactory();
int depth = frame.getThread().getStackFrameCount();
int level = frame.getLevel();
// Need the GDB/MI view of leve which the reverse i.e. Highest frame is 0
// Need the GDB/MI view of level which the reverse i.e. Highest frame is 0
int miLevel = depth - level;
MIStackListArguments listArgs = factory.createMIStackListArguments(false, miLevel, miLevel);
MIArg[] args = null;
@ -296,7 +373,7 @@ public class VariableManager extends Manager implements ICDIVariableManager {
}
if (args != null) {
for (int i = 0; i < args.length; i++) {
ArgumentObject arg = new ArgumentObject(target, args[i].getName(), frame, args.length - i, level);
ArgumentDescriptor arg = new ArgumentDescriptor(target, null, frame, args[i].getName(), null, args.length - i, level);
argObjects.add(arg);
}
}
@ -306,18 +383,10 @@ public class VariableManager extends Manager implements ICDIVariableManager {
target.setCurrentThread(currentThread, false);
currentThread.setCurrentStackFrame(currentFrame, false);
}
return (ICDIArgumentObject[]) argObjects.toArray(new ICDIArgumentObject[0]);
return (ICDIArgumentDescriptor[]) argObjects.toArray(new ICDIArgumentDescriptor[0]);
}
/**
* @deprecated
* @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#getGlobalVariableObject(String, String, String)
*/
public ICDIVariableObject getGlobalVariableObject(String filename, String function, String name) throws CDIException {
Target target = ((Session)getSession()).getCurrentTarget();
return getGlobalVariableObject(target, filename, function, name);
}
public ICDIVariableObject getGlobalVariableObject(Target target, String filename, String function, String name) throws CDIException {
public GlobalVariableDescriptor getGlobalVariableDescriptor(Target target, String filename, String function, String name) throws CDIException {
if (filename == null) {
filename = new String();
}
@ -335,75 +404,46 @@ public class VariableManager extends Manager implements ICDIVariableManager {
buffer.append(function).append("::"); //$NON-NLS-1$
}
buffer.append(name);
return new VariableObject(target, buffer.toString(), null, 0, 0);
return new GlobalVariableDescriptor(target, null, null, buffer.toString(), null, 0, 0);
}
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#getVariableObjectAsArray(ICDIVariableObject, int, int)
*/
public ICDIVariableObject getVariableObjectAsArray(ICDIVariableObject object, int start, int length)
throws CDIException {
VariableObject obj = null;
if (object instanceof VariableObject) {
obj = (VariableObject) object;
public GlobalVariable createGlobalVariable(GlobalVariableDescriptor varDesc) throws CDIException {
Variable variable = findVariable(varDesc);
GlobalVariable global = null;
if (variable instanceof GlobalVariable) {
global = (GlobalVariable)variable;
}
if (obj != null) {
VariableObject vo =
new VariableObject(
(Target)obj.getTarget(),
obj.getName(),
obj.getFullName(),
obj.getStackFrame(),
obj.getPosition(),
obj.getStackDepth());
vo.setCastingArrayStart(obj.getCastingArrayStart() + start);
vo.setCastingArrayEnd(length);
return vo;
}
throw new CDIException(CdiResources.getString("cdi.VariableManager.Unknown_variable_object")); //$NON-NLS-1$
}
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#getVariableObjectAsArray(ICDIVariableObject, String, int, int)
*/
public ICDIVariableObject getVariableObjectAsType(ICDIVariableObject object, String type) throws CDIException {
VariableObject obj = null;
if (object instanceof VariableObject) {
obj = (VariableObject) object;
}
if (obj != null) {
// throw an exception if not a good type.
Target target = (Target)obj.getTarget();
checkType((StackFrame)obj.getStackFrame(), type);
VariableObject vo =
new VariableObject(
target,
obj.getName(),
obj.getFullName(),
obj.getStackFrame(),
obj.getPosition(),
obj.getStackDepth());
String casting = obj.getCastingType();
if (casting != null && casting.length() > 0) {
type = "(" + type + ")" + "(" + casting + " )"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
if (global == null) {
String name = varDesc.getQualifiedName();
Session session = (Session) getSession();
Target target = (Target)varDesc.getTarget();
try {
MISession mi = target.getMISession();
CommandFactory factory = mi.getCommandFactory();
MIVarCreate var = factory.createMIVarCreate(name);
mi.postCommand(var);
MIVarCreateInfo info = var.getMIVarCreateInfo();
if (info == null) {
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
global = new GlobalVariable(varDesc, info.getMIVar());
List variablesList = getVariablesList(target);
variablesList.add(global);
} catch (MIException e) {
throw new MI2CDIException(e);
}
vo.setCastingType(type);
return vo;
}
throw new CDIException(CdiResources.getString("cdi.VariableManager.Unknown_variable_object")); //$NON-NLS-1$
return global;
}
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#getVariableObjects(ICDIStackFrame)
*/
public ICDIVariableObject[] getLocalVariableObjects(ICDIStackFrame frame) throws CDIException {
public ICDILocalVariableDescriptor[] getLocalVariableDescriptors(StackFrame frame) throws CDIException {
List varObjects = new ArrayList();
Session session = (Session) getSession();
Target target = (Target)frame.getTarget();
ICDIThread currentThread = target.getCurrentThread();
ICDIStackFrame currentFrame = currentThread.getCurrentStackFrame();
Thread currentThread = (Thread)target.getCurrentThread();
StackFrame currentFrame = currentThread.getCurrentStackFrame();
target.setCurrentThread(frame.getThread(), false);
frame.getThread().setCurrentStackFrame(frame, false);
((Thread)frame.getThread()).setCurrentStackFrame(frame, false);
try {
MISession mi = target.getMISession();
CommandFactory factory = mi.getCommandFactory();
@ -418,7 +458,7 @@ public class VariableManager extends Manager implements ICDIVariableManager {
args = info.getLocals();
if (args != null) {
for (int i = 0; i < args.length; i++) {
VariableObject varObj = new VariableObject(target, args[i].getName(), frame, args.length - i, level);
LocalVariableDescriptor varObj = new LocalVariableDescriptor(target, null, frame, args[i].getName(), null, args.length - i, level);
varObjects.add(varObj);
}
}
@ -428,82 +468,60 @@ public class VariableManager extends Manager implements ICDIVariableManager {
target.setCurrentThread(currentThread, false);
currentThread.setCurrentStackFrame(currentFrame, false);
}
return (ICDIVariableObject[]) varObjects.toArray(new ICDIVariableObject[0]);
return (ICDILocalVariableDescriptor[]) varObjects.toArray(new ICDILocalVariableDescriptor[0]);
}
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#getVariableObjects(ICDIStackFrame)
*/
public ICDIVariableObject[] getVariableObjects(ICDIStackFrame frame) throws CDIException {
ICDIVariableObject[] locals = getLocalVariableObjects(frame);
ICDIVariableObject[] args = getArgumentObjects(frame);
ICDIVariableObject[] vars = new ICDIVariableObject[locals.length + args.length];
System.arraycopy(locals, 0, vars, 0, locals.length);
System.arraycopy(args, 0, vars, locals.length, args.length);
return vars;
}
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#createVariable(ICDIVariableObject)
*/
public ICDIVariable createVariable(ICDIVariableObject v) throws CDIException {
VariableObject varObj = null;
if (v instanceof VariableObject) {
varObj = (VariableObject) v;
public LocalVariable createLocalVariable(LocalVariableDescriptor varDesc) throws CDIException {
Variable variable = findVariable(varDesc);
LocalVariable local = null;
if (variable instanceof LocalVariable) {
local = (LocalVariable)variable;
}
if (varObj != null) {
Variable variable = findVariable(varObj);
if (variable == null) {
String name = varObj.getQualifiedName();
Session session = (Session) getSession();
ICDIStackFrame stack = varObj.getStackFrame();
ICDIThread currentThread = null;
ICDIStackFrame currentFrame = null;
Target target = (Target)varObj.getTarget();
if (stack != null) {
currentThread = target.getCurrentThread();
currentFrame = currentThread.getCurrentStackFrame();
target.setCurrentThread(stack.getThread(), false);
stack.getThread().setCurrentStackFrame(stack, false);
}
try {
MISession mi = target.getMISession();
CommandFactory factory = mi.getCommandFactory();
MIVarCreate var = factory.createMIVarCreate(name);
mi.postCommand(var);
MIVarCreateInfo info = var.getMIVarCreateInfo();
if (info == null) {
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
variable = new Variable(varObj, info.getMIVar());
List variablesList = getVariablesList(target);
variablesList.add(variable);
} catch (MIException e) {
throw new MI2CDIException(e);
} finally {
if (currentThread != null) {
target.setCurrentThread(currentThread, false);
currentThread.setCurrentStackFrame(currentFrame, false);
}
if (local == null) {
String name = varDesc.getQualifiedName();
Session session = (Session) getSession();
StackFrame stack = (StackFrame)varDesc.getStackFrame();
Target target = (Target)varDesc.getTarget();
Thread currentThread = (Thread)target.getCurrentThread();
StackFrame currentFrame = currentThread.getCurrentStackFrame();
target.setCurrentThread(stack.getThread(), false);
((Thread)stack.getThread()).setCurrentStackFrame(stack, false);
try {
MISession mi = target.getMISession();
CommandFactory factory = mi.getCommandFactory();
MIVarCreate var = factory.createMIVarCreate(name);
mi.postCommand(var);
MIVarCreateInfo info = var.getMIVarCreateInfo();
if (info == null) {
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
local = new LocalVariable(varDesc, info.getMIVar());
List variablesList = getVariablesList(target);
variablesList.add(local);
} catch (MIException e) {
throw new MI2CDIException(e);
} finally {
target.setCurrentThread(currentThread, false);
currentThread.setCurrentStackFrame(currentFrame, false);
}
return variable;
}
throw new CDIException(CdiResources.getString("cdi.VariableManager.Wrong_variable_type")); //$NON-NLS-1$
return local;
}
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDIVariableManager#destroyVariable(ICDIVariable)
*/
public void destroyVariable(ICDIVariable var) throws CDIException {
if (var instanceof Variable) {
// Fire a destroyEvent ?
Variable variable = (Variable) var;
Target target = (Target)variable.getTarget();
MISession mi = target.getMISession();
MIVarDeletedEvent del = new MIVarDeletedEvent(mi, variable.getMIVar().getVarName());
mi.fireEvent(del);
}
public ICDIThreadStorageDescriptor[] getThreadStorageDescriptors(Thread thread) throws CDIException {
return new ICDIThreadStorageDescriptor[0];
}
public ThreadStorage createThreadStorage(ThreadStorageDescriptor desc) throws CDIException {
throw new CDIException(CdiResources.getString("cdi.VariableManager.Unknown_variable_object")); //$NON-NLS-1$
}
public void destroyVariable(Variable variable) throws CDIException {
// Fire a destroyEvent ?
Target target = (Target)variable.getTarget();
MISession mi = target.getMISession();
MIVarDeletedEvent del = new MIVarDeletedEvent(mi, variable.getMIVar().getVarName());
mi.fireEvent(del);
}
/**
@ -524,8 +542,8 @@ public class VariableManager extends Manager implements ICDIVariableManager {
CommandFactory factory = mi.getCommandFactory();
Variable[] vars = getVariables(target);
ICDIStackFrame[] frames = null;
ICDIStackFrame currentStack = null;
ICDIThread currentThread = target.getCurrentThread();
StackFrame currentStack = null;
Thread currentThread = (Thread)target.getCurrentThread();
if (currentThread != null) {
currentStack = currentThread.getCurrentStackFrame();
if (currentStack != null) {
@ -614,4 +632,5 @@ public class VariableManager extends Manager implements ICDIVariableManager {
// need to call -var-delete.
return !inScope;
}
}

View file

@ -42,7 +42,7 @@ public class ChangedEvent implements ICDIChangedEvent {
session = s;
// Try the Variable manager.
VariableManager mgr = (VariableManager)session.getVariableManager();
VariableManager mgr = session.getVariableManager();
String varName = var.getVarName();
MISession miSession = var.getMISession();
source = mgr.getVariable(miSession, varName);
@ -55,7 +55,7 @@ public class ChangedEvent implements ICDIChangedEvent {
// Try the Register manager
if (source == null) {
RegisterManager regMgr = (RegisterManager)session.getRegisterManager();
RegisterManager regMgr = session.getRegisterManager();
source = regMgr.getRegister(miSession, varName);
}
@ -68,7 +68,7 @@ public class ChangedEvent implements ICDIChangedEvent {
public ChangedEvent(Session s, MIRegisterChangedEvent reg) {
session = s;
RegisterManager mgr = (RegisterManager)session.getRegisterManager();
RegisterManager mgr = session.getRegisterManager();
MISession miSession = reg.getMISession();
int regno = reg.getNumber();
source = mgr.getRegister(miSession, regno);

View file

@ -51,7 +51,7 @@ public class CreatedEvent implements ICDICreatedEvent {
public CreatedEvent(Session s, MIVarCreatedEvent var) {
session = s;
VariableManager mgr = (VariableManager)session.getVariableManager();
VariableManager mgr = session.getVariableManager();
MISession miSession = var.getMISession();
String varName = var.getVarName();
source = mgr.getVariable(miSession, varName);
@ -63,7 +63,7 @@ public class CreatedEvent implements ICDICreatedEvent {
public CreatedEvent(Session s, MIRegisterCreatedEvent reg) {
session = s;
RegisterManager mgr = (RegisterManager)session.getRegisterManager();
RegisterManager mgr = session.getRegisterManager();
MISession miSession = reg.getMISession();
int regno = reg.getNumber();
source = mgr.getRegister(miSession, regno);

View file

@ -45,7 +45,7 @@ public class DestroyedEvent implements ICDIDestroyedEvent {
public DestroyedEvent(Session s, MIVarDeletedEvent var) {
session = s;
VariableManager varMgr = (VariableManager)session.getVariableManager();
VariableManager varMgr = session.getVariableManager();
MISession miSession = var.getMISession();
String varName = var.getVarName();
Variable variable = varMgr.getVariable(miSession, varName);

View file

@ -17,8 +17,20 @@ import org.eclipse.cdt.debug.mi.core.output.MIVar;
*/
public class Argument extends Variable implements ICDIArgument {
public Argument(ArgumentObject obj, MIVar var) {
public Argument(Target target, Thread thread, StackFrame frame,
String n, String q, int pos, int depth, MIVar v) {
super(target, thread, frame, n, q, pos, depth, v);
}
public Argument(ArgumentDescriptor obj, MIVar var) {
super(obj, var);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.mi.core.cdi.model.Variable#createVariable(org.eclipse.cdt.debug.mi.core.cdi.model.Target, org.eclipse.cdt.debug.core.cdi.model.ICDIThread, org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame, java.lang.String, java.lang.String, int, int, org.eclipse.cdt.debug.mi.core.output.MIVar)
*/
protected Variable createVariable(Target target, Thread thread, StackFrame frame, String name, String fullName, int pos, int depth, MIVar miVar) {
return new Argument(target, thread, frame, name, fullName, pos, depth, miVar);
}
}

View file

@ -11,15 +11,15 @@
package org.eclipse.cdt.debug.mi.core.cdi.model;
import org.eclipse.cdt.debug.core.cdi.model.ICDIArgumentObject;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.ICDIArgumentDescriptor;
/**
*/
public class ArgumentObject extends VariableObject implements ICDIArgumentObject {
public class ArgumentDescriptor extends LocalVariableDescriptor implements ICDIArgumentDescriptor {
public ArgumentObject(Target target, String name, ICDIStackFrame frame, int pos, int depth) {
super(target, name, frame, pos, depth);
public ArgumentDescriptor(Target target, Thread thread, StackFrame frame, String n, String fn,
int pos, int depth) {
super(target, thread, frame, n, fn, pos, depth);
}
}

View file

@ -63,28 +63,28 @@ public class Expression extends CObject implements ICDIExpression {
Target target = (Target)getTarget();
Session session = (Session) (target.getSession());
SourceManager sourceMgr = session.getSourceManager();
String nametype = sourceMgr.getTypeName(frame, getExpressionText());
String nametype = sourceMgr.getTypeName((StackFrame)frame, getExpressionText());
try {
type = sourceMgr.getType(frame, nametype);
type = sourceMgr.getType((StackFrame)frame, nametype);
} catch (CDIException e) {
// Try with ptype.
try {
String ptype = sourceMgr.getDetailTypeName(frame, nametype);
type = sourceMgr.getType(frame, ptype);
String ptype = sourceMgr.getDetailTypeName((StackFrame)frame, nametype);
type = sourceMgr.getType((StackFrame)frame, ptype);
} catch (CDIException ex) {
// Some version of gdb does not work with the name of the class
// ex: class data foo --> ptype data --> fails
// ex: class data foo --> ptype foo --> succeed
try {
String ptype = sourceMgr.getDetailTypeName(frame, getExpressionText());
type = sourceMgr.getType(frame, ptype);
String ptype = sourceMgr.getDetailTypeName((StackFrame)frame, getExpressionText());
type = sourceMgr.getType((StackFrame)frame, ptype);
} catch (CDIException e2) {
// give up.
}
}
}
if (type == null) {
type = new IncompleteType(frame, nametype);
type = new IncompleteType((StackFrame)frame, nametype);
}
return type;
@ -96,8 +96,17 @@ public class Expression extends CObject implements ICDIExpression {
public ICDIValue getValue(ICDIStackFrame context) throws CDIException {
Session session = (Session)getTarget().getSession();
ExpressionManager mgr = session.getExpressionManager();
Variable var = mgr.createVariable(context, getExpressionText());
Variable var = mgr.createVariable((StackFrame)context, getExpressionText());
return var.getValue();
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIExpression#dispose()
*/
public void dispose() throws CDIException {
Session session = (Session)getTarget().getSession();
ExpressionManager mgr = session.getExpressionManager();
mgr.destroyExpressions((Target)getTarget(), new Expression[] {this});
}
}

View file

@ -0,0 +1,51 @@
/**********************************************************************
* Copyright (c) 2002,2003,2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.debug.mi.core.cdi.model;
import org.eclipse.cdt.debug.core.cdi.model.ICDIGlobalVariable;
import org.eclipse.cdt.debug.mi.core.output.MIVar;
/**
* GlobalVariable
*/
public class GlobalVariable extends Variable implements ICDIGlobalVariable {
/**
* @param obj
* @param v
*/
public GlobalVariable(VariableDescriptor obj, MIVar v) {
super(obj, v);
}
/**
* @param target
* @param n
* @param q
* @param thread
* @param stack
* @param pos
* @param depth
* @param v
*/
public GlobalVariable(Target target, Thread thread, StackFrame frame, String n, String q, int pos, int depth, MIVar v) {
super(target, thread, frame, n, q, pos, depth, v);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.mi.core.cdi.model.Variable#createVariable(org.eclipse.cdt.debug.mi.core.cdi.model.Target, java.lang.String, java.lang.String, org.eclipse.cdt.debug.core.cdi.model.ICDIThread, org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame, int, int, org.eclipse.cdt.debug.mi.core.output.MIVar)
*/
protected Variable createVariable(Target target, Thread thread, StackFrame frame, String name, String fullName, int pos, int depth, MIVar miVar) {
return new GlobalVariable(target, thread, frame, name, fullName, pos, depth, miVar);
}
}

View file

@ -0,0 +1,35 @@
/**********************************************************************
* Copyright (c) 2002,2003,2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.debug.mi.core.cdi.model;
import org.eclipse.cdt.debug.core.cdi.model.ICDIGlobalVariableDescriptor;
/**
* GlobalVariableDescriptor
*/
public class GlobalVariableDescriptor extends VariableDescriptor implements ICDIGlobalVariableDescriptor {
/**
* @param target
* @param thread
* @param stack
* @param n
* @param fn
* @param pos
* @param depth
*/
public GlobalVariableDescriptor(Target target, Thread thread,
StackFrame stack, String n, String fn, int pos, int depth) {
super(target, thread, stack, n, fn, pos, depth);
}
}

View file

@ -0,0 +1,45 @@
/**********************************************************************
* Copyright (c) 2002,2003,2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.debug.mi.core.cdi.model;
import org.eclipse.cdt.debug.core.cdi.model.ICDILocalVariable;
import org.eclipse.cdt.debug.mi.core.output.MIVar;
/**
* LocalVariable
*/
public class LocalVariable extends Variable implements ICDILocalVariable {
/**
* @param obj
* @param v
*/
public LocalVariable(LocalVariableDescriptor obj, MIVar v) {
super(obj, v);
}
/**
*/
public LocalVariable(Target target, Thread thread, StackFrame frame, String n, String q,
int pos, int depth, MIVar v) {
super(target, thread, frame, n, q, pos, depth, v);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.mi.core.cdi.model.Variable#createVariable(org.eclipse.cdt.debug.mi.core.cdi.model.Target, java.lang.String, java.lang.String, org.eclipse.cdt.debug.core.cdi.model.ICDIThread, org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame, int, int, org.eclipse.cdt.debug.mi.core.output.MIVar)
*/
protected Variable createVariable(Target target, Thread thread, StackFrame frame, String name,
String fullName, int pos, int depth, MIVar miVar) {
return new LocalVariable(target, thread, frame, name, fullName, pos, depth, miVar);
}
}

View file

@ -0,0 +1,34 @@
/**********************************************************************
* Copyright (c) 2002,2003,2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.debug.mi.core.cdi.model;
import org.eclipse.cdt.debug.core.cdi.model.ICDILocalVariableDescriptor;
/**
* LocalVariableDescriptor
*/
public class LocalVariableDescriptor extends VariableDescriptor implements
ICDILocalVariableDescriptor {
/**
* @param target
* @param n
* @param fn
* @param stack
* @param pos
* @param depth
*/
public LocalVariableDescriptor(Target target, Thread thread, StackFrame frame, String n, String fn, int pos, int depth) {
super(target, thread, frame, n, fn, pos, depth);
}
}

View file

@ -10,29 +10,34 @@
*******************************************************************************/
package org.eclipse.cdt.debug.mi.core.cdi.model;
import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.model.ICDIRegister;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable;
import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.cdi.CdiResources;
import org.eclipse.cdt.debug.mi.core.cdi.MI2CDIException;
import org.eclipse.cdt.debug.mi.core.cdi.RegisterManager;
import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
import org.eclipse.cdt.debug.mi.core.command.MIVarListChildren;
import org.eclipse.cdt.debug.mi.core.output.MIVar;
import org.eclipse.cdt.debug.mi.core.output.MIVarListChildrenInfo;
/**
*/
public class Register extends Variable implements ICDIRegister {
public Register(RegisterObject obj, MIVar var) {
/**
* @param target
* @param thread
* @param frame
* @param n
* @param q
* @param pos
* @param depth
* @param v
*/
public Register(Target target, Thread thread, StackFrame frame,
String n, String q, int pos, int depth, MIVar v) {
super(target, thread, frame, n, q, pos, depth, v);
}
public Register(RegisterDescriptor obj, MIVar var) {
super(obj, var);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.mi.core.cdi.model.VariableObject#getFullName()
* @see org.eclipse.cdt.debug.mi.core.cdi.model.VariableDescriptor#getFullName()
*/
public String getFullName() {
if (fullName == null) {
@ -44,40 +49,8 @@ public class Register extends Variable implements ICDIRegister {
return fullName;
}
public ICDIVariable[] getChildren() throws CDIException {
Target target = (Target)getTarget();
MISession miSession = target.getMISession();
RegisterManager mgr = (RegisterManager)target.getSession().getRegisterManager();
CommandFactory factory = miSession.getCommandFactory();
MIVarListChildren var =
factory.createMIVarListChildren(getMIVar().getVarName());
try {
miSession.postCommand(var);
MIVarListChildrenInfo info = var.getMIVarListChildrenInfo();
if (info == null) {
throw new CDIException(CdiResources.getString("cdi.Common.No_answer")); //$NON-NLS-1$
}
MIVar[] vars = info.getMIVars();
children = new Register[vars.length];
for (int i = 0; i < vars.length; i++) {
String fn;
String exp = vars[i].getExp();
if (isCPPLanguage()) {
if ((exp.equals("private") || exp.equals("public") || exp.equals("protected"))) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
fn = getFullName();
} else {
fn = getFullName() + "." + exp; //$NON-NLS-1$
}
} else {
fn = getFullName() + "." + exp; //$NON-NLS-1$
}
RegisterObject regObj = new RegisterObject(target, exp, fn, getPosition());
children[i] = mgr.createRegister(regObj, vars[i]);
}
} catch (MIException e) {
throw new MI2CDIException(e);
}
return children;
protected Variable createVariable(Target target, Thread thread, StackFrame frame, String name, String fullName, int pos, int depth, MIVar miVar) {
return new Register(target, thread, frame, name, fullName, pos, depth, miVar);
}
}

View file

@ -11,22 +11,19 @@
package org.eclipse.cdt.debug.mi.core.cdi.model;
import org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterObject;
import org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterDescriptor;
/**
*/
public class RegisterObject extends VariableObject implements ICDIRegisterObject {
public class RegisterDescriptor extends VariableDescriptor implements ICDIRegisterDescriptor {
public RegisterObject(Target target, String name, int i) {
super(target, name, null, i, 0);
}
public RegisterObject(Target target, String name, String fn, int i) {
super(target, name, fn, null, i, 0);
public RegisterDescriptor(Target target, Thread thread, StackFrame frame, String name, String fn, int pos, int depth) {
super(target, thread, frame, name, fn, pos, depth);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.mi.core.cdi.model.VariableObject#getFullName()
* @see org.eclipse.cdt.debug.mi.core.cdi.model.VariableDescriptor#getFullName()
*/
public String getFullName() {
if (fullName == null) {

View file

@ -0,0 +1,52 @@
/**********************************************************************
* Copyright (c) 2002,2003,2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.debug.mi.core.cdi.model;
import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterDescriptor;
import org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterGroup;
import org.eclipse.cdt.debug.mi.core.cdi.RegisterManager;
import org.eclipse.cdt.debug.mi.core.cdi.Session;
/**
* RegisterGroup
*/
public class RegisterGroup extends CObject implements ICDIRegisterGroup {
String fName;
/**
* @param t
*/
public RegisterGroup(Target t, String name) {
super(t);
fName = name;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterGroup#getRegisterDescriptors()
*/
public ICDIRegisterDescriptor[] getRegisterDescriptors() throws CDIException {
Target target = (Target)getTarget();
Session session = (Session)target.getSession();
RegisterManager regMgr = session.getRegisterManager();
return regMgr.getRegisterDescriptors(this);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterGroup#getName()
*/
public String getName() {
return fName;
}
}

View file

@ -73,7 +73,7 @@ public class SharedLibrary extends CObject implements ICDISharedLibrary {
*/
public void loadSymbols() throws CDIException {
Target target = (Target)getTarget();
SharedLibraryManager mgr = (SharedLibraryManager)((Session)target.getSession()).getSharedLibraryManager();
SharedLibraryManager mgr = ((Session)target.getSession()).getSharedLibraryManager();
mgr.loadSymbols(target, new ICDISharedLibrary[] { this });
}

View file

@ -14,13 +14,11 @@ import java.math.BigInteger;
import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.ICDILocation;
import org.eclipse.cdt.debug.core.cdi.model.ICDIArgument;
import org.eclipse.cdt.debug.core.cdi.model.ICDIArgumentObject;
import org.eclipse.cdt.debug.core.cdi.model.ICDIArgumentDescriptor;
import org.eclipse.cdt.debug.core.cdi.model.ICDILocalVariableDescriptor;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.ICDIThread;
import org.eclipse.cdt.debug.core.cdi.model.ICDIValue;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject;
import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.MIFormat;
import org.eclipse.cdt.debug.mi.core.MISession;
@ -42,8 +40,8 @@ public class StackFrame extends CObject implements ICDIStackFrame {
MIFrame frame;
Thread cthread;
int level;
ICDIArgument[] args;
ICDIVariable[] locals;
ICDIArgumentDescriptor[] argDescs;
ICDILocalVariableDescriptor[] localDescs;
Location fLocation;
/*
@ -88,45 +86,27 @@ public class StackFrame extends CObject implements ICDIStackFrame {
}
/**
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame#getArguments()
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame#getArgumentDescriptors()
*/
public ICDIArgument[] getArguments() throws CDIException {
if (args == null) {
public ICDIArgumentDescriptor[] getArgumentDescriptors() throws CDIException {
if (argDescs == null) {
Session session = (Session)getTarget().getSession();
VariableManager mgr = (VariableManager)session.getVariableManager();
ICDIArgumentObject[] argObjs = mgr.getArgumentObjects(this);
args = new ICDIArgument[argObjs.length];
for (int i = 0; i < args.length; i++) {
try {
args[i] = mgr.createArgument(argObjs[i]);
} catch (CDIException e) {
args = null;
throw e;
}
}
VariableManager mgr = session.getVariableManager();
argDescs = mgr.getArgumentDescriptors(this);
}
return args;
return argDescs;
}
/**
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame#getLocalVariables()
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame#getLocalVariableDescriptors()
*/
public ICDIVariable[] getLocalVariables() throws CDIException {
if (locals == null) {
public ICDILocalVariableDescriptor[] getLocalVariableDescriptors() throws CDIException {
if (localDescs == null) {
Session session = (Session)getTarget().getSession();
VariableManager mgr = (VariableManager)session.getVariableManager();
ICDIVariableObject[] varObjs = mgr.getLocalVariableObjects(this);
locals = new ICDIVariable[varObjs.length];
for (int i = 0; i < locals.length; i++) {
try {
locals[i] = mgr.createVariable(varObjs[i]);
} catch (CDIException e) {
locals = null;
throw e;
}
}
VariableManager mgr = session.getVariableManager();
localDescs = mgr.getLocalVariableDescriptors(this);
}
return locals;
return localDescs;
}
/**

View file

@ -17,19 +17,20 @@ import java.util.List;
import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.ICDICondition;
import org.eclipse.cdt.debug.core.cdi.ICDILocation;
import org.eclipse.cdt.debug.core.cdi.ICDISession;
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint;
import org.eclipse.cdt.debug.core.cdi.model.ICDIExpression;
import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction;
import org.eclipse.cdt.debug.core.cdi.model.ICDILocationBreakpoint;
import org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock;
import org.eclipse.cdt.debug.core.cdi.model.ICDIMixedInstruction;
import org.eclipse.cdt.debug.core.cdi.model.ICDIRegisterGroup;
import org.eclipse.cdt.debug.core.cdi.model.ICDIRuntimeOptions;
import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary;
import org.eclipse.cdt.debug.core.cdi.model.ICDISignal;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
import org.eclipse.cdt.debug.core.cdi.model.ICDIThread;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableDescriptor;
import org.eclipse.cdt.debug.core.cdi.model.ICDIWatchpoint;
import org.eclipse.cdt.debug.mi.core.CoreProcess;
import org.eclipse.cdt.debug.mi.core.MIException;
@ -41,6 +42,7 @@ import org.eclipse.cdt.debug.mi.core.cdi.MI2CDIException;
import org.eclipse.cdt.debug.mi.core.cdi.MemoryManager;
import org.eclipse.cdt.debug.mi.core.cdi.RegisterManager;
import org.eclipse.cdt.debug.mi.core.cdi.Session;
import org.eclipse.cdt.debug.mi.core.cdi.SessionObject;
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;
@ -70,16 +72,15 @@ import org.eclipse.cdt.debug.mi.core.output.MIThreadSelectInfo;
/**
*/
public class Target implements ICDITarget {
public class Target extends SessionObject implements ICDITarget {
Session session;
MISession miSession;
Thread[] noThreads = new Thread[0];
Thread[] currentThreads;
int currentThreadId;
public Target(Session s, MISession mi) {
session = s;
super(s);
miSession = mi;
currentThreads = noThreads;
}
@ -88,13 +89,6 @@ public class Target implements ICDITarget {
return miSession;
}
/**
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#getSession()
*/
public ICDISession getSession() {
return session;
}
/**
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIObject#getTarget()
*/
@ -154,15 +148,16 @@ public class Target implements ICDITarget {
throw new MI2CDIException(e);
}
Session session = (Session)getSession();
// Resetting threads may change the value of
// some variables like Register. Call an update()
// To generate changeEvents.
if (doUpdate) {
RegisterManager regMgr = (RegisterManager)session.getRegisterManager();
RegisterManager regMgr = session.getRegisterManager();
if (regMgr.isAutoUpdate()) {
regMgr.update(this);
}
VariableManager varMgr = (VariableManager)session.getVariableManager();
VariableManager varMgr = session.getVariableManager();
if (varMgr.isAutoUpdate()) {
varMgr.update(this);
}
@ -636,10 +631,10 @@ public class Target implements ICDITarget {
public String evaluateExpressionToString(ICDIStackFrame frame, String expressionText) throws CDIException {
Session session = (Session)getSession();
Target target = (Target)frame.getTarget();
ICDIThread currentThread = target.getCurrentThread();
ICDIStackFrame currentFrame = currentThread.getCurrentStackFrame();
Thread currentThread = (Thread)target.getCurrentThread();
StackFrame currentFrame = currentThread.getCurrentStackFrame();
target.setCurrentThread(frame.getThread(), false);
frame.getThread().setCurrentStackFrame(frame, false);
((Thread)frame.getThread()).setCurrentStackFrame((StackFrame)frame, false);
try {
CommandFactory factory = miSession.getCommandFactory();
MIDataEvaluateExpression evaluate =
@ -933,4 +928,20 @@ public class Target implements ICDITarget {
return sharedMgr.getSharedLibraries(this);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#getGlobalVariableDescriptors(java.lang.String, java.lang.String, java.lang.String)
*/
public ICDIVariableDescriptor getGlobalVariableDescriptors(String filename, String function, String name) throws CDIException {
VariableManager varMgr = ((Session)getSession()).getVariableManager();
return varMgr.getGlobalVariableDescriptor(this, filename, function, name);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#getRegisterGroups()
*/
public ICDIRegisterGroup[] getRegisterGroups() throws CDIException {
RegisterManager regMgr = ((Session)getSession()).getRegisterManager();
return regMgr.getRegisterGroups(this);
}
}

View file

@ -21,6 +21,7 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDILocationBreakpoint;
import org.eclipse.cdt.debug.core.cdi.model.ICDISignal;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.ICDIThread;
import org.eclipse.cdt.debug.core.cdi.model.ICDIThreadStorageDescriptor;
import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.cdi.BreakpointManager;
@ -45,7 +46,7 @@ public class Thread extends CObject implements ICDIThread {
static ICDIStackFrame[] noStack = new ICDIStackFrame[0];
int id;
String name;
ICDIStackFrame currentFrame;
StackFrame currentFrame;
List currentFrames;
int stackdepth = 0;
@ -86,11 +87,11 @@ public class Thread extends CObject implements ICDIThread {
}
}
public ICDIStackFrame getCurrentStackFrame() throws CDIException {
public StackFrame getCurrentStackFrame() throws CDIException {
if (currentFrame == null) {
ICDIStackFrame[] frames = getStackFrames(0, 0);
if (frames.length > 0) {
currentFrame = frames[0];
currentFrame = (StackFrame)frames[0];
}
}
return currentFrame;
@ -137,7 +138,7 @@ public class Thread extends CObject implements ICDIThread {
for (int i = 0; i < currentFrames.size(); i++) {
ICDIStackFrame stack = (ICDIStackFrame) currentFrames.get(i);
if (stack.getLevel() == depth) {
currentFrame = stack;
currentFrame = (StackFrame)stack;
}
}
}
@ -244,17 +245,10 @@ public class Thread extends CObject implements ICDIThread {
return (ICDIStackFrame[])list.toArray(noStack);
}
/**
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#setCurrentStackFrame(ICDIStackFrame)
*/
public void setCurrentStackFrame(ICDIStackFrame stackframe) throws CDIException {
setCurrentStackFrame(stackframe, true);
}
/**
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#setCurrentStackFrame(ICDIStackFrame, boolean)
*/
public void setCurrentStackFrame(ICDIStackFrame stackframe, boolean doUpdate) throws CDIException {
public void setCurrentStackFrame(StackFrame stackframe, boolean doUpdate) throws CDIException {
// Assert we should assert that the stackframe is one of our frames.
@ -295,11 +289,11 @@ public class Thread extends CObject implements ICDIThread {
// To generate changeEvents.
if (doUpdate) {
Session session = (Session) target.getSession();
RegisterManager regMgr = (RegisterManager) session.getRegisterManager();
RegisterManager regMgr = session.getRegisterManager();
if (regMgr.isAutoUpdate()) {
regMgr.update(target);
}
VariableManager varMgr = (VariableManager) session.getVariableManager();
VariableManager varMgr = session.getVariableManager();
if (varMgr.isAutoUpdate()) {
varMgr.update(target);
}
@ -520,4 +514,13 @@ public class Thread extends CObject implements ICDIThread {
return target.setLocationBreakpoint(type, location, newCondition, deferred);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIThread#getThreadStorageDescriptors()
*/
public ICDIThreadStorageDescriptor[] getThreadStorageDescriptors() throws CDIException {
Session session = (Session)getTarget().getSession();
VariableManager varMgr = session.getVariableManager();
return varMgr.getThreadStorageDescriptors(this);
}
}

View file

@ -0,0 +1,54 @@
/**********************************************************************
* Copyright (c) 2002,2003,2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.debug.mi.core.cdi.model;
import org.eclipse.cdt.debug.core.cdi.model.ICDIThreadStorage;
import org.eclipse.cdt.debug.mi.core.output.MIVar;
/**
* ThreadStorage
*/
public class ThreadStorage extends Variable implements ICDIThreadStorage {
/**
* @param obj
* @param v
*/
public ThreadStorage(VariableDescriptor obj, MIVar v) {
super(obj, v);
}
/**
* @param target
* @param thread
* @param frame
* @param n
* @param q
* @param pos
* @param depth
* @param v
*/
public ThreadStorage(Target target, Thread thread, StackFrame frame,
String n, String q, int pos, int depth, MIVar v) {
super(target, thread, frame, n, q, pos, depth, v);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.mi.core.cdi.model.Variable#createVariable(org.eclipse.cdt.debug.mi.core.cdi.model.Target, org.eclipse.cdt.debug.mi.core.cdi.model.Thread, org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame, java.lang.String, java.lang.String, int, int, org.eclipse.cdt.debug.mi.core.output.MIVar)
*/
protected Variable createVariable(Target target, Thread thread,
StackFrame frame, String name, String fullName, int pos, int depth,
MIVar miVar) {
return null;
}
}

View file

@ -0,0 +1,36 @@
/**********************************************************************
* Copyright (c) 2002,2003,2004 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* QNX Software Systems - Initial API and implementation
***********************************************************************/
package org.eclipse.cdt.debug.mi.core.cdi.model;
import org.eclipse.cdt.debug.core.cdi.model.ICDIThreadStorageDescriptor;
/**
* ThreadStorageDescriptor
*/
public class ThreadStorageDescriptor extends VariableDescriptor implements
ICDIThreadStorageDescriptor {
/**
* @param target
* @param thread
* @param stack
* @param n
* @param fn
* @param pos
* @param depth
*/
public ThreadStorageDescriptor(Target target, Thread thread,
StackFrame stack, String n, String fn, int pos, int depth) {
super(target, thread, stack, n, fn, pos, depth);
}
}

View file

@ -11,7 +11,7 @@
package org.eclipse.cdt.debug.mi.core.cdi.model;
import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
import org.eclipse.cdt.debug.core.cdi.model.ICDIValue;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIArrayType;
@ -69,7 +69,7 @@ import org.eclipse.cdt.debug.mi.core.output.MIVarShowAttributesInfo;
/**
*/
public class Variable extends VariableObject implements ICDIVariable {
public abstract class Variable extends VariableDescriptor implements ICDIVariable {
MIVar miVar;
Value value;
@ -78,13 +78,13 @@ public class Variable extends VariableObject implements ICDIVariable {
String language;
boolean isFake = false;
public Variable(VariableObject obj, MIVar v) {
public Variable(VariableDescriptor obj, MIVar v) {
super(obj);
miVar = v;
}
public Variable(Target target, String n, String q, ICDIStackFrame stack, int pos, int depth, MIVar v) {
super(target, n, q, stack, pos, depth);
public Variable(Target target, Thread thread, StackFrame frame, String n, String q, int pos, int depth, MIVar v) {
super(target, thread, frame, n, q, pos, depth);
miVar = v;
}
@ -220,7 +220,8 @@ public class Variable extends VariableObject implements ICDIVariable {
fn = "(" + fn + ")." + vars[i].getExp(); //$NON-NLS-1$ //$NON-NLS-2$
}
}
Variable v = new Variable((Target)getTarget(), childName, fn, getStackFrame(), getPosition(), getStackDepth(), vars[i]);
Variable v = createVariable((Target)getTarget(), (Thread)getThread(), (StackFrame)getStackFrame(),
childName, fn, getPosition(), getStackDepth(), vars[i]);
if (childType != null) {
// Hack to reset the typename to a known value
v.type = childType;
@ -234,6 +235,9 @@ public class Variable extends VariableObject implements ICDIVariable {
return children;
}
protected abstract Variable createVariable(Target target, Thread thread, StackFrame frame,
String name, String fullName, int pos, int depth, MIVar miVar);
public int getChildrenNumber() throws CDIException {
return miVar.getNumChild();
}
@ -314,31 +318,29 @@ public class Variable extends VariableObject implements ICDIVariable {
// Changing values may have side effects i.e. affecting other variables
// if the manager is on autoupdate check all the other variables.
// Note: This maybe very costly.
if (this instanceof Register) {
// If register was on autoupdate, update all the other registers
// assigning may have side effects i.e. affecting other registers.
RegisterManager mgr = (RegisterManager)target.getSession().getRegisterManager();
if (mgr.isAutoUpdate()) {
mgr.update(target);
}
} else {
// If expression was on autoupdate, update all the other expression
// assigning may have side effects i.e. affecting other expressions.
ExpressionManager expMgr = ((Session)target.getSession()).getExpressionManager();
if (expMgr.isAutoUpdate()) {
expMgr.update(target);
}
// assigning may have side effects i.e. affecting other registers.
// FIXME: Should we always call the Variable Manager ?
VariableManager varMgr = (VariableManager)target.getSession().getVariableManager();
if (varMgr.isAutoUpdate()) {
varMgr.update(target);
}
// If register was on autoupdate, update all the other registers
RegisterManager regMgr = ((Session)target.getSession()).getRegisterManager();
if (regMgr.isAutoUpdate()) {
regMgr.update(target);
}
// If expression was on autoupdate, update all the other expression
ExpressionManager expMgr = ((Session)target.getSession()).getExpressionManager();
if (expMgr.isAutoUpdate()) {
expMgr.update(target);
}
// If variable was on autoupdate, update all the variables.
VariableManager varMgr = ((Session)target.getSession()).getVariableManager();
if (varMgr.isAutoUpdate()) {
varMgr.update(target);
}
}
/**
* Overload the implementation of VariableObject and let gdb
* Overload the implementation of VariableDescriptor and let gdb
* handle it.
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariable#isEditable()
*/
@ -391,4 +393,13 @@ public class Variable extends VariableObject implements ICDIVariable {
return super.equals(var);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariable#dispose()
*/
public void dispose() throws CDIException {
ICDITarget target = getTarget();
VariableManager varMgr = ((Session)target.getSession()).getVariableManager();
varMgr.destroyVariable(this);
}
}

View file

@ -12,19 +12,16 @@ package org.eclipse.cdt.debug.mi.core.cdi.model;
import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIArrayType;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIFunctionType;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIPointerType;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIReferenceType;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIStructType;
import org.eclipse.cdt.debug.core.cdi.model.ICDIThread;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableDescriptor;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIVoidType;
import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.cdi.MI2CDIException;
import org.eclipse.cdt.debug.mi.core.cdi.Session;
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.cdi.model.type.IncompleteType;
import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
import org.eclipse.cdt.debug.mi.core.command.MIDataEvaluateExpression;
@ -33,7 +30,7 @@ import org.eclipse.cdt.debug.mi.core.cdi.CdiResources;
/**
*/
public class VariableObject extends CObject implements ICDIVariableObject {
public abstract class VariableDescriptor extends CObject implements ICDIVariableDescriptor {
// Casting info.
String castingType;
@ -42,7 +39,8 @@ public class VariableObject extends CObject implements ICDIVariableObject {
String name;
int position;
ICDIStackFrame frame;
StackFrame fStackFrame;
Thread fThread;
int stackdepth;
String qualifiedName = null;
@ -53,34 +51,32 @@ public class VariableObject extends CObject implements ICDIVariableObject {
/**
* Copy constructor.
* @param obj
* @param desc
*/
public VariableObject(VariableObject obj) {
super((Target)obj.getTarget());
name = obj.getName();
fullName = obj.fullName;
sizeof = obj.sizeof;
type = obj.type;
public VariableDescriptor(VariableDescriptor desc) {
super((Target)desc.getTarget());
name = desc.getName();
fullName = desc.fullName;
sizeof = desc.sizeof;
type = desc.type;
try {
frame = obj.getStackFrame();
fStackFrame = (StackFrame)desc.getStackFrame();
fThread = (Thread)desc.getThread();
} catch (CDIException e) {
}
position = obj.getPosition();
stackdepth = obj.getStackDepth();
castingIndex = obj.getCastingArrayStart();
castingLength = obj.getCastingArrayEnd();
castingType = obj.getCastingType();
position = desc.getPosition();
stackdepth = desc.getStackDepth();
castingIndex = desc.getCastingArrayStart();
castingLength = desc.getCastingArrayEnd();
castingType = desc.getCastingType();
}
public VariableObject(Target target, String n, ICDIStackFrame stack, int pos, int depth) {
this(target, n, null, stack, pos, depth);
}
public VariableObject(Target target, String n, String fn, ICDIStackFrame stack, int pos, int depth) {
public VariableDescriptor(Target target, Thread thread, StackFrame stack, String n, String fn, int pos, int depth) {
super(target);
name = n;
fullName = fn;
frame = stack;
fStackFrame = stack;
fThread = thread;
position = pos;
stackdepth = depth;
}
@ -149,7 +145,7 @@ public class VariableObject extends CObject implements ICDIVariableObject {
}
/**
* @see org.eclipse.cdt.debug.core.cdi.ICDIVariableObject#getName()
* @see org.eclipse.cdt.debug.core.cdi.ICDIVariableDescriptor#getName()
*/
public String getName() {
return name;
@ -162,9 +158,14 @@ public class VariableObject extends CObject implements ICDIVariableObject {
if (type == null) {
Target target = (Target)getTarget();
Session session = (Session) (target.getSession());
ICDIStackFrame frame = getStackFrame();
StackFrame frame = (StackFrame)getStackFrame();
if (frame == null) {
frame = target.getCurrentThread().getCurrentStackFrame();
Thread thread = (Thread)getThread();
if (thread != null) {
frame = thread.getCurrentStackFrame();
} else {
frame = ((Thread)target.getCurrentThread()).getCurrentStackFrame();
}
}
SourceManager sourceMgr = session.getSourceManager();
String nametype = sourceMgr.getTypeName(frame, getQualifiedName());
@ -195,12 +196,22 @@ public class VariableObject extends CObject implements ICDIVariableObject {
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject#sizeof()
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableDescriptor#sizeof()
*/
public int sizeof() throws CDIException {
if (sizeof == null) {
Target target = (Target) getTarget();
Session session = (Session) (target.getSession());
Thread currentThread = (Thread)target.getCurrentThread();
StackFrame currentFrame = currentThread.getCurrentStackFrame();
StackFrame frame = (StackFrame)getStackFrame();
Thread thread = (Thread)getThread();
if (frame != null) {
target.setCurrentThread(frame.getThread(), false);
((Thread)frame.getThread()).setCurrentStackFrame(frame, false);
} else if (thread != null) {
target.setCurrentThread(thread, false);
}
MISession mi = target.getMISession();
CommandFactory factory = mi.getCommandFactory();
String exp = "sizeof(" + getTypeName() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
@ -209,11 +220,18 @@ public class VariableObject extends CObject implements ICDIVariableObject {
mi.postCommand(evaluate);
MIDataEvaluateExpressionInfo info = evaluate.getMIDataEvaluateExpressionInfo();
if (info == null) {
throw new CDIException(CdiResources.getString("cdi.model.VariableObject.Target_not_responding")); //$NON-NLS-1$
throw new CDIException(CdiResources.getString("cdi.model.VariableDescriptor.Target_not_responding")); //$NON-NLS-1$
}
sizeof = info.getExpression();
} catch (MIException e) {
throw new MI2CDIException(e);
} finally {
if (frame != null) {
target.setCurrentThread(currentThread, false);
currentThread.setCurrentStackFrame(currentFrame, false);
} else if (thread != null) {
target.setCurrentThread(currentThread, false);
}
}
}
@ -228,28 +246,18 @@ public class VariableObject extends CObject implements ICDIVariableObject {
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject#isEdiTable()
*/
public boolean isEditable() throws CDIException {
ICDIType t = getType();
if (t instanceof ICDIArrayType
|| t instanceof ICDIStructType
|| t instanceof ICDIVoidType
|| t instanceof ICDIFunctionType) {
return false;
}
return true;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject#getStackFrame()
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableDescriptor#getStackFrame()
*/
public ICDIStackFrame getStackFrame() throws CDIException {
return frame;
return fStackFrame;
}
public ICDIThread getThread() throws CDIException {
return fThread;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject#getTypeName()
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableDescriptor#getTypeName()
*/
public String getTypeName() throws CDIException {
if (typename == null) {
@ -260,31 +268,7 @@ public class VariableObject extends CObject implements ICDIVariableObject {
}
/**
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject#hasChildren()
*/
public boolean hasChildren() throws CDIException {
ICDIType t = getType();
// For reference we need to get the referenced type
// to make a decision.
if (t instanceof ICDIReferenceType) {
t = ((ICDIReferenceType) t).getComponentType();
}
if (t instanceof ICDIArrayType || t instanceof ICDIStructType) {
return true;
} else if (t instanceof ICDIPointerType) {
ICDIType sub = ((ICDIPointerType) t).getComponentType();
if (sub instanceof ICDIVoidType) {
return false;
}
return true;
}
return false;
}
/**
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject#getQualifiedName()
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableDescriptor#getQualifiedName()
*/
public String getQualifiedName() throws CDIException {
if (qualifiedName == null) {
@ -294,34 +278,78 @@ public class VariableObject extends CObject implements ICDIVariableObject {
}
/**
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject#equals(ICDIVariableObject)
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableDescriptor#equals(ICDIVariableDescriptor)
*/
public boolean equals(ICDIVariableObject varObj) {
if (varObj instanceof VariableObject) {
VariableObject var = (VariableObject) varObj;
if (var.getName().equals(getName())
&& var.getCastingArrayStart() == getCastingArrayStart()
&& var.getCastingArrayEnd() == getCastingArrayEnd()
&& ((var.getCastingType() == null && getCastingType() == null)
|| (var.getCastingType() != null && getCastingType() != null && var.getCastingType().equals(getCastingType())))) {
ICDIStackFrame varFrame = null;
ICDIStackFrame ourFrame = null;
public boolean equals(ICDIVariableDescriptor varDesc) {
if (varDesc instanceof VariableDescriptor) {
VariableDescriptor desc = (VariableDescriptor) varDesc;
if (desc.getName().equals(getName())
&& desc.getCastingArrayStart() == getCastingArrayStart()
&& desc.getCastingArrayEnd() == getCastingArrayEnd()
&& ((desc.getCastingType() == null && getCastingType() == null)
|| (desc.getCastingType() != null && getCastingType() != null && desc.getCastingType().equals(getCastingType())))) {
// Check the threads
ICDIThread varThread = null;
ICDIThread ourThread = null;
try {
varFrame = var.getStackFrame();
ourFrame = getStackFrame();
varThread = desc.getThread();
ourThread = getThread();
} catch (CDIException e) {
// ignore
}
if (ourFrame == null && varFrame == null) {
return true;
} else if (varFrame != null && ourFrame != null && varFrame.equals(ourFrame)) {
if (var.getStackDepth() == getStackDepth()) {
if (var.getPosition() == getPosition()) {
return true;
if ((ourThread == null && varThread == null) ||
(varThread != null && ourThread != null && varThread.equals(ourThread))) {
// check the stackFrames
ICDIStackFrame varFrame = null;
ICDIStackFrame ourFrame = null;
try {
varFrame = desc.getStackFrame();
ourFrame = getStackFrame();
} catch (CDIException e) {
// ignore
}
if (ourFrame == null && varFrame == null) {
return true;
} else if (varFrame != null && ourFrame != null && varFrame.equals(ourFrame)) {
if (desc.getStackDepth() == getStackDepth()) {
if (desc.getPosition() == getPosition()) {
return true;
}
}
}
}
return false;
}
}
return super.equals(varObj);
return super.equals(varDesc);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableDescriptor#getVariableDescriptorAsArray(org.eclipse.cdt.debug.core.cdi.model.ICDIVariableDescriptor, int, int)
*/
public ICDIVariableDescriptor getVariableDescriptorAsArray(int start, int length) throws CDIException {
Session session = (Session)getTarget().getSession();
VariableManager mgr = session.getVariableManager();
return mgr.getVariableDescriptorAsArray(this, start, length);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableDescriptor#getVariableDescriptorAsType(org.eclipse.cdt.debug.core.cdi.model.ICDIVariableDescriptor, java.lang.String)
*/
public ICDIVariableDescriptor getVariableDescriptorAsType(String type) throws CDIException {
Session session = (Session)getTarget().getSession();
VariableManager mgr = session.getVariableManager();
return mgr.getVariableDescriptorAsType(this, type);
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.cdi.model.ICDIVariableDescriptor#createVariable()
*/
public ICDIVariable createVariable() throws CDIException {
Session session = (Session)getTarget().getSession();
VariableManager mgr = session.getVariableManager();
return mgr.createVariable(this);
}
}

View file

@ -11,14 +11,14 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIAggregateType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame;
/**
*/
public abstract class AggregateType extends Type implements ICDIAggregateType {
public AggregateType(ICDIStackFrame frame, String typename) {
public AggregateType(StackFrame frame, String typename) {
super(frame, typename);
}
}

View file

@ -11,9 +11,9 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIArrayType;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame;
/**
*/
@ -24,7 +24,7 @@ public class ArrayType extends DerivedType implements ICDIArrayType {
/**
* @param typename
*/
public ArrayType(ICDIStackFrame frame, String typename,int dim) {
public ArrayType(StackFrame frame, String typename,int dim) {
super(frame, typename);
dimension = dim;
}

View file

@ -12,14 +12,15 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.ICDIVariableManager;
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableDescriptor;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIArrayValue;
import org.eclipse.cdt.debug.mi.core.cdi.Session;
import org.eclipse.cdt.debug.mi.core.cdi.VariableManager;
import org.eclipse.cdt.debug.mi.core.cdi.model.Register;
import org.eclipse.cdt.debug.mi.core.cdi.model.Variable;
import org.eclipse.cdt.debug.mi.core.cdi.model.VariableDescriptor;
/**
* Enter type comment.
@ -72,8 +73,8 @@ public class ArrayValue extends DerivedValue implements ICDIArrayValue {
//String subarray = "*(" + variable.getName() + "+" + index + ")@" + length;
ICDITarget target = getTarget();
Session session = (Session) (target.getSession());
ICDIVariableManager mgr = session.getVariableManager();
ICDIVariableObject vo = mgr.getVariableObjectAsArray(variable, index, length);
return mgr.createVariable(vo).getValue().getVariables();
VariableManager mgr = session.getVariableManager();
ICDIVariableDescriptor vo = mgr.getVariableDescriptorAsArray(variable, index, length);
return mgr.createVariable((VariableDescriptor)vo).getValue().getVariables();
}
}

View file

@ -11,8 +11,8 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIBoolType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame;
/**
*/
@ -21,11 +21,11 @@ public class BoolType extends IntegralType implements ICDIBoolType {
/**
* @param typename
*/
public BoolType(ICDIStackFrame frame, String typename) {
public BoolType(StackFrame frame, String typename) {
this(frame, typename, false);
}
public BoolType(ICDIStackFrame frame, String typename, boolean usigned) {
public BoolType(StackFrame frame, String typename, boolean usigned) {
super(frame, typename, usigned);
}

View file

@ -11,8 +11,8 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDICharType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame;
/**
*/
@ -21,11 +21,11 @@ public class CharType extends IntegralType implements ICDICharType {
/**
* @param typename
*/
public CharType(ICDIStackFrame frame, String typename) {
public CharType(StackFrame frame, String typename) {
this(frame, typename, false);
}
public CharType(ICDIStackFrame frame, String typename, boolean usigned) {
public CharType(StackFrame frame, String typename, boolean usigned) {
super(frame, typename, usigned);
}
}

View file

@ -12,11 +12,11 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIDerivedType;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType;
import org.eclipse.cdt.debug.mi.core.cdi.Session;
import org.eclipse.cdt.debug.mi.core.cdi.SourceManager;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame;
import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
/**
@ -25,7 +25,7 @@ public abstract class DerivedType extends Type implements ICDIDerivedType {
ICDIType derivedType;
public DerivedType(ICDIStackFrame frame, String typename) {
public DerivedType(StackFrame frame, String typename) {
super(frame, typename);
}
@ -38,17 +38,17 @@ public abstract class DerivedType extends Type implements ICDIDerivedType {
Session session = (Session)target.getSession();
SourceManager sourceMgr = session.getSourceManager();
try {
derivedType = sourceMgr.getType(getStackFrame(), name);
derivedType = sourceMgr.getType((StackFrame)getStackFrame(), name);
} catch (CDIException e) {
// Try after ptype.
try {
String ptype = sourceMgr.getDetailTypeName(getStackFrame(), name);
derivedType = sourceMgr.getType(getStackFrame(), ptype);
String ptype = sourceMgr.getDetailTypeName((StackFrame)getStackFrame(), name);
derivedType = sourceMgr.getType((StackFrame)getStackFrame(), ptype);
} catch (CDIException ex) {
}
}
if (derivedType == null) {
derivedType = new IncompleteType(getStackFrame(), name);
derivedType = new IncompleteType((StackFrame)getStackFrame(), name);
}
}
}

View file

@ -11,8 +11,8 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIDoubleType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame;
/**
*/
@ -21,11 +21,11 @@ public class DoubleType extends FloatingPointType implements ICDIDoubleType {
/**
* @param typename
*/
public DoubleType(ICDIStackFrame frame, String typename) {
public DoubleType(StackFrame frame, String typename) {
this(frame, typename, false, false, false);
}
public DoubleType(ICDIStackFrame frame, String typename, boolean isComplex, boolean isImg, boolean isLong) {
public DoubleType(StackFrame frame, String typename, boolean isComplex, boolean isImg, boolean isLong) {
super(frame, typename, isComplex, isImg, isLong);
}
}

View file

@ -11,8 +11,8 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIEnumType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame;
/**
*/
@ -21,11 +21,11 @@ public class EnumType extends IntegralType implements ICDIEnumType {
/**
* @param typename
*/
public EnumType(ICDIStackFrame frame, String typename) {
public EnumType(StackFrame frame, String typename) {
this(frame, typename, false);
}
public EnumType(ICDIStackFrame frame, String typename, boolean usigned) {
public EnumType(StackFrame frame, String typename, boolean usigned) {
super(frame, typename, usigned);
}
}

View file

@ -11,8 +11,8 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIFloatType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame;
/**
*/
@ -21,11 +21,11 @@ public class FloatType extends FloatingPointType implements ICDIFloatType {
/**
* @param typename
*/
public FloatType(ICDIStackFrame frame, String typename) {
public FloatType(StackFrame frame, String typename) {
this(frame, typename, false, false);
}
public FloatType(ICDIStackFrame frame, String typename, boolean isComplex, boolean isImg) {
public FloatType(StackFrame frame, String typename, boolean isComplex, boolean isImg) {
super(frame, typename, isComplex, isImg, false);
}
}

View file

@ -11,8 +11,8 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIFloatingPointType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame;
/**
*/
@ -22,7 +22,7 @@ public abstract class FloatingPointType extends Type implements ICDIFloatingPoin
boolean imaginary;
boolean islong;
public FloatingPointType(ICDIStackFrame frame, String typename, boolean comp, boolean img, boolean l) {
public FloatingPointType(StackFrame frame, String typename, boolean comp, boolean img, boolean l) {
super(frame, typename);
complex = comp;
imaginary = img;

View file

@ -11,9 +11,9 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIFunctionType;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame;
/**
*/
@ -21,7 +21,7 @@ public class FunctionType extends DerivedType implements ICDIFunctionType {
String params = ""; //$NON-NLS-1$
public FunctionType(ICDIStackFrame frame, String typename) {
public FunctionType(StackFrame frame, String typename) {
super(frame, typename);
}

View file

@ -11,7 +11,7 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame;
/**
*/
@ -20,7 +20,7 @@ public class IncompleteType extends Type {
/**
* @param name
*/
public IncompleteType(ICDIStackFrame frame, String name) {
public IncompleteType(StackFrame frame, String name) {
super(frame, name);
}

View file

@ -11,8 +11,8 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIIntType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame;
/**
*/
@ -21,11 +21,11 @@ public class IntType extends IntegralType implements ICDIIntType {
/**
* @param typename
*/
public IntType(ICDIStackFrame frame, String typename) {
public IntType(StackFrame frame, String typename) {
this(frame, typename, false);
}
public IntType(ICDIStackFrame frame, String typename, boolean isUnsigned) {
public IntType(StackFrame frame, String typename, boolean isUnsigned) {
super(frame, typename, isUnsigned);
}

View file

@ -11,8 +11,8 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIIntegralType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame;
/**
*/
@ -20,7 +20,7 @@ public abstract class IntegralType extends Type implements ICDIIntegralType {
boolean unSigned;
public IntegralType(ICDIStackFrame frame, String typename, boolean isUnsigned) {
public IntegralType(StackFrame frame, String typename, boolean isUnsigned) {
super(frame, typename);
unSigned = isUnsigned;
}

View file

@ -11,8 +11,8 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDILongLongType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame;
/**
*/
@ -21,11 +21,11 @@ public class LongLongType extends IntegralType implements ICDILongLongType {
/**
* @param typename
*/
public LongLongType(ICDIStackFrame frame, String typename) {
public LongLongType(StackFrame frame, String typename) {
this(frame, typename, false);
}
public LongLongType(ICDIStackFrame frame, String typename, boolean usigned) {
public LongLongType(StackFrame frame, String typename, boolean usigned) {
super(frame, typename, usigned);
}
}

View file

@ -11,8 +11,8 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDILongType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame;
/**
*/
@ -21,11 +21,11 @@ public class LongType extends IntegralType implements ICDILongType {
/**
* @param typename
*/
public LongType(ICDIStackFrame frame, String typename) {
public LongType(StackFrame frame, String typename) {
this(frame, typename, false);
}
public LongType(ICDIStackFrame frame, String typename, boolean usigned) {
public LongType(StackFrame frame, String typename, boolean usigned) {
super(frame, typename, usigned);
}
}

View file

@ -11,15 +11,15 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIPointerType;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame;
/**
*/
public class PointerType extends DerivedType implements ICDIPointerType {
public PointerType(ICDIStackFrame frame, String typename) {
public PointerType(StackFrame frame, String typename) {
super(frame, typename);
}

View file

@ -11,9 +11,9 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIReferenceType;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame;
/**
*/
@ -22,7 +22,7 @@ public class ReferenceType extends DerivedType implements ICDIReferenceType {
/**
* @param name
*/
public ReferenceType(ICDIStackFrame frame, String name) {
public ReferenceType(StackFrame frame, String name) {
super(frame, name);
}

View file

@ -11,8 +11,8 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIShortType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame;
/**
*/
@ -21,11 +21,11 @@ public class ShortType extends IntegralType implements ICDIShortType {
/**
* @param typename
*/
public ShortType(ICDIStackFrame frame, String typename) {
public ShortType(StackFrame frame, String typename) {
this(frame, typename, false);
}
public ShortType(ICDIStackFrame frame, String typename, boolean usigned) {
public ShortType(StackFrame frame, String typename, boolean usigned) {
super(frame, typename, usigned);
}
}

View file

@ -11,8 +11,8 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIStructType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame;
/**
*/
@ -21,7 +21,7 @@ public class StructType extends AggregateType implements ICDIStructType {
/**
* @param typename
*/
public StructType(ICDIStackFrame frame, String typename) {
public StructType(StackFrame frame, String typename) {
super(frame, typename);
}

View file

@ -14,17 +14,18 @@ package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIType;
import org.eclipse.cdt.debug.mi.core.cdi.model.CObject;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame;
import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
/**
*/
public abstract class Type extends CObject implements ICDIType {
ICDIStackFrame fStackFrame;
StackFrame fStackFrame;
String typename;
String detailName;
public Type(ICDIStackFrame frame, String name) {
public Type(StackFrame frame, String name) {
super((Target)frame.getTarget());
typename = name;
fStackFrame = frame;

View file

@ -11,14 +11,14 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIVoidType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame;
/**
*/
public class VoidType extends Type implements ICDIVoidType {
public VoidType(ICDIStackFrame frame, String typename) {
public VoidType(StackFrame frame, String typename) {
super(frame, typename);
}
}

View file

@ -12,8 +12,8 @@
package org.eclipse.cdt.debug.mi.core.cdi.model.type;
import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame;
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIWCharType;
import org.eclipse.cdt.debug.mi.core.cdi.model.StackFrame;
/**
*/
@ -22,11 +22,11 @@ public class WCharType extends IntegralType implements ICDIWCharType {
/**
* @param typename
*/
public WCharType(ICDIStackFrame frame, String typename) {
public WCharType(StackFrame frame, String typename) {
this(frame, typename, false);
}
public WCharType(ICDIStackFrame frame, String typename, boolean usigned) {
public WCharType(StackFrame frame, String typename, boolean usigned) {
super(frame, typename, usigned);
}
}

View file

@ -246,7 +246,7 @@ public class GDBCDIDebugger implements ICDIDebugger {
protected String renderDebuggerProcessLabel() {
String format = "{0} ({1})"; //$NON-NLS-1$
String timestamp = DateFormat.getInstance().format(new Date(System.currentTimeMillis()));
String message = MIPlugin.getResourceString("src.GDBDebugger.Debugger_process");
String message = MIPlugin.getResourceString("src.GDBDebugger.Debugger_process"); //$NON-NLS-1$
return MessageFormat.format(format, new String[]{message, timestamp}); //$NON-NLS-1$
}

View file

@ -107,7 +107,7 @@ public class GDBServerCDIDebugger extends GDBCDIDebugger {
*/
public Session createAttachSession(ILaunchConfiguration config, IBinaryExecutable exe, IProgressMonitor monitor)
throws CoreException {
String msg = MIPlugin.getResourceString("src.GDBServerDebugger.GDBServer_attaching_unsupported");
String msg = MIPlugin.getResourceString("src.GDBServerDebugger.GDBServer_attaching_unsupported"); //$NON-NLS-1$
throw newCoreException(msg, null);
}
@ -116,7 +116,7 @@ public class GDBServerCDIDebugger extends GDBCDIDebugger {
*/
public Session createCoreSession(ILaunchConfiguration config, IBinaryExecutable exe, IProgressMonitor monitor)
throws CoreException {
String msg = MIPlugin.getResourceString("src.GDBServerDebugger.GDBServer_corefiles_unsupported");
String msg = MIPlugin.getResourceString("src.GDBServerDebugger.GDBServer_corefiles_unsupported"); //$NON-NLS-1$
throw newCoreException(msg, null);
}