| /* |
| *(c) Copyright QNX Software Systems Ltd. 2002. |
| * All Rights Reserved. |
| * |
| */ |
| |
| 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.type.ICDIPointerValue; |
| import org.eclipse.cdt.debug.mi.core.cdi.model.Variable; |
| |
| /** |
| * Enter type comment. |
| * |
| * @since Jun 3, 2003 |
| */ |
| public class PointerValue extends DerivedValue implements ICDIPointerValue { |
| |
| public PointerValue(Variable v) { |
| super(v); |
| } |
| |
| /* (non-Javadoc) |
| * @see org.eclipse.cdt.debug.core.cdi.model.type.ICDIPointerValue#pointerValue() |
| */ |
| public long pointerValue() throws CDIException { |
| long value = 0; |
| String valueString = getValueString(); |
| int space = valueString.indexOf(' '); |
| if (space != -1) { |
| valueString = valueString.substring(0, space).trim(); |
| } |
| try { |
| value = Long.decode(valueString).longValue(); |
| } catch (NumberFormatException e) { |
| } |
| return value; |
| } |
| } |