mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-10 18:45:26 +02:00
Partial fix for bug 45535: Performance problems when debugging.
Cache the double and float presentations of the floating point types.
This commit is contained in:
parent
10aa7ebe3a
commit
fe9c5ad64b
3 changed files with 14 additions and 16 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2004-06-28 Mikhail Khodjaiants
|
||||||
|
Partial fix for bug 45535: Performance problems when debugging.
|
||||||
|
Cache the double and float presentations of the floating point types.
|
||||||
|
* CDebugUtils.java
|
||||||
|
* CFloatingPointValue.java: new
|
||||||
|
* CValueFactory.java
|
||||||
|
|
||||||
2004-06-24 Mikhail Khodjaiants
|
2004-06-24 Mikhail Khodjaiants
|
||||||
Temporary fix for bug 56520: Debug Perspective doesn't get called when a breakpoint is hit.
|
Temporary fix for bug 56520: Debug Perspective doesn't get called when a breakpoint is hit.
|
||||||
* CThread.java
|
* CThread.java
|
||||||
|
|
|
@ -16,23 +16,18 @@ import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.xml.transform.OutputKeys;
|
import javax.xml.transform.OutputKeys;
|
||||||
import javax.xml.transform.Transformer;
|
import javax.xml.transform.Transformer;
|
||||||
import javax.xml.transform.TransformerException;
|
import javax.xml.transform.TransformerException;
|
||||||
import javax.xml.transform.TransformerFactory;
|
import javax.xml.transform.TransformerFactory;
|
||||||
import javax.xml.transform.dom.DOMSource;
|
import javax.xml.transform.dom.DOMSource;
|
||||||
import javax.xml.transform.stream.StreamResult;
|
import javax.xml.transform.stream.StreamResult;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.model.IFunction;
|
import org.eclipse.cdt.core.model.IFunction;
|
||||||
import org.eclipse.cdt.core.model.IMethod;
|
import org.eclipse.cdt.core.model.IMethod;
|
||||||
import org.eclipse.cdt.core.model.ITranslationUnit;
|
import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||||
import org.eclipse.cdt.debug.core.cdi.CDIException;
|
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.type.ICDIDoubleValue;
|
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIFloatValue;
|
|
||||||
import org.eclipse.cdt.debug.core.model.ICValue;
|
import org.eclipse.cdt.debug.core.model.ICValue;
|
||||||
import org.eclipse.cdt.debug.internal.core.model.CValue;
|
import org.eclipse.cdt.debug.internal.core.model.CFloatingPointValue;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
@ -354,19 +349,11 @@ public class CDebugUtils
|
||||||
|
|
||||||
public static Number getFloatingPointValue( ICValue value )
|
public static Number getFloatingPointValue( ICValue value )
|
||||||
{
|
{
|
||||||
if ( value instanceof CValue )
|
if ( value instanceof CFloatingPointValue )
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ICDIValue cdiValue = ((CValue)value).getUnderlyingValue();
|
return ((CFloatingPointValue)value).getFloatingPointValue();
|
||||||
if ( cdiValue instanceof ICDIDoubleValue )
|
|
||||||
{
|
|
||||||
return new Double( ((ICDIDoubleValue)cdiValue).doubleValue() );
|
|
||||||
}
|
|
||||||
if ( cdiValue instanceof ICDIFloatValue )
|
|
||||||
{
|
|
||||||
return new Float( ((ICDIFloatValue)cdiValue).floatValue() );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch( CDIException e )
|
catch( CDIException e )
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,6 +13,7 @@ package org.eclipse.cdt.debug.internal.core.model;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIValue;
|
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.ICDIVariable;
|
||||||
|
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIFloatingPointValue;
|
||||||
import org.eclipse.debug.core.DebugException;
|
import org.eclipse.debug.core.DebugException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -25,6 +26,9 @@ public class CValueFactory
|
||||||
{
|
{
|
||||||
static public CValue createValue( CVariable parent, ICDIValue cdiValue ) throws DebugException
|
static public CValue createValue( CVariable parent, ICDIValue cdiValue ) throws DebugException
|
||||||
{
|
{
|
||||||
|
if ( cdiValue instanceof ICDIFloatingPointValue ) {
|
||||||
|
return new CFloatingPointValue( parent, cdiValue );
|
||||||
|
}
|
||||||
return new CValue( parent, cdiValue );
|
return new CValue( parent, cdiValue );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue