diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/Addr32Factory.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/Addr32Factory.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/Addr32Factory.java 1970-01-01 03:00:00.000000000 +0300 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/Addr32Factory.java 2004-09-16 14:49:00.000000000 +0400 @@ -0,0 +1,41 @@ +/******************************************************************************* + * Copyright (c) 2004 Intel Corporation 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: + * Intel Corporation - Initial API and implementation + *******************************************************************************/ +package org.eclipse.cdt.core; + + +/* + */ +final public class Addr32Factory implements IAddressFactory +{ + + final public IAddress getZero() + { + return Addr32.ZERO; + } + + final public IAddress getMax() + { + return Addr32.MAX; + } + + final public IAddress createAddress(String addr) + { + IAddress address=new Addr32(addr); + return address; + } + + final public IAddress createAddress(String addr, int radix) + { + IAddress address=new Addr32(addr, radix); + return address; + } + +} diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/Addr32.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/Addr32.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/Addr32.java 1970-01-01 03:00:00.000000000 +0300 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/Addr32.java 2004-09-16 14:49:00.000000000 +0400 @@ -0,0 +1,141 @@ +/******************************************************************************* + * Copyright (c) 2004 Intel Corporation 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: + * Intel Corporation - Initial API and implementation + *******************************************************************************/ +package org.eclipse.cdt.core; + +import java.math.BigInteger; + +/* + */ +final public class Addr32 implements IAddress +{ + public static final Addr32 ZERO=new Addr32(0); + public static final Addr32 MAX=new Addr32(0xffffffffL); + + public static final BigInteger MAX_OFFSET = BigInteger.valueOf(0xffffffffL); + + public static final int BYTES_NUM = 4; + public static final int DIGITS_NUM = BYTES_NUM * 2; + public static final int CHARS_NUM = DIGITS_NUM + 2; + + private long address; + + /* + * addrBytes should be 4 bytes length + */ + public Addr32(byte [] addrBytes) + { + /*We should mask out sign bits to have correct value*/ + this.address = ( ( ((long)addrBytes[0]) << 24 ) & 0xFF000000L) + + ( ( ((long)addrBytes[1]) << 16 ) & 0x00FF0000L) + + ( ( ((long)addrBytes[2]) << 8 ) & 0x0000FF00L) + + ( ((long)addrBytes[3]) & 0x000000FFL); + } + + public Addr32(long rawaddress) + { + this.address=rawaddress; + } + + public Addr32(String addr) + { + addr = addr.toLowerCase(); + if ( addr.startsWith( "0x" ) ) + { + this.address = Long.parseLong(addr.substring(2), 16); + } + else + { + this.address = Long.parseLong(addr, 10); + } + } + + public Addr32(String addr, int radix) + { + this.address=Long.parseLong(addr, radix); + } + + final public IAddress add(BigInteger offset) + { + return new Addr32(this.address + offset.longValue()); + } + + final public BigInteger getMaxOffset() + { + return MAX_OFFSET; + } + + final public BigInteger distance(IAddress other) + { + return BigInteger.valueOf(address - ((Addr32)other).address); + } + + final public int compareTo(IAddress addr) + { + if (address > ((Addr32)addr).address) + { + return 1; + } + if (address < ((Addr32)addr).address) + { + return -1; + } + return 0; + } + + final public boolean isMax() + { + return address == MAX.address; + } + + final public boolean isZero() + { + return address == ZERO.address; + } + + final public String toString() + { + return toString(10); + } + + final public String toString(int radix) + { + return Long.toString(address, radix); + } + + final public boolean equals(IAddress x) + { + if (x == this) + return true; + if (!(x instanceof Addr32)) + return false; + return this.address == ((Addr32)x).address; + } + + final public String toHexAddressString( ) + { + String addressString = Long.toString(address,16); + StringBuffer sb = new StringBuffer( CHARS_NUM ); + int count = DIGITS_NUM - addressString.length(); + sb.append( "0x" ); + for ( int i = 0; i < count ; ++i ) + { + sb.append( '0' ); + } + sb.append( addressString ); + return sb.toString(); + } + + final public int getCharsNum() + { + return CHARS_NUM; + } + +} diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/Addr64Factory.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/Addr64Factory.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/Addr64Factory.java 1970-01-01 03:00:00.000000000 +0300 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/Addr64Factory.java 2004-09-16 14:49:00.000000000 +0400 @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright (c) 2004 Intel Corporation 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: + * Intel Corporation - Initial API and implementation + *******************************************************************************/ +package org.eclipse.cdt.core; + + +/* + */ +final public class Addr64Factory implements IAddressFactory{ + + final public IAddress getZero() + { + return Addr64.ZERO; + } + + final public IAddress getMax() + { + return Addr64.MAX; + } + + final public IAddress createAddress(String addr) + { + IAddress address=new Addr64(addr); + return address; + } + + final public IAddress createAddress(String addr, int radix) + { + IAddress address=new Addr64(addr, radix); + return address; + } +} diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/Addr64.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/Addr64.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/Addr64.java 1970-01-01 03:00:00.000000000 +0300 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/Addr64.java 2004-09-16 14:49:00.000000000 +0400 @@ -0,0 +1,128 @@ +/******************************************************************************* + * Copyright (c) 2004 Intel Corporation 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: + * Intel Corporation - Initial API and implementation + *******************************************************************************/ +package org.eclipse.cdt.core; + +import java.math.BigInteger; + +/* + */ +final public class Addr64 implements IAddress +{ + public static final Addr64 ZERO=new Addr64("0"); + public static final Addr64 MAX=new Addr64("ffffffffffffffff",16); + + public static final BigInteger MAX_OFFSET = new BigInteger("ffffffffffffffff",16); + + public static final int BYTES_NUM = 8; + public static final int DIGITS_NUM = BYTES_NUM * 2; + public static final int CHARS_NUM = DIGITS_NUM + 2; + + private BigInteger address; + + public Addr64(byte [] addrBytes) + { + if( addrBytes.length != 8) + throw(new NumberFormatException("Invalid address array")); + this.address = new BigInteger(1, addrBytes); + } + + public Addr64(BigInteger rawaddress) + { + this.address=rawaddress; + } + + public Addr64(String addr) + { + addr = addr.toLowerCase(); + if ( addr.startsWith( "0x" ) ) + { + this.address = new BigInteger(addr.substring(2), 16); + } + else + { + this.address = new BigInteger(addr, 10); + } + } + + public Addr64(String addr, int radix) + { + this.address=new BigInteger(addr, radix); + } + + final public IAddress add(BigInteger offset) + { + return new Addr64(this.address.add(offset)); + } + + final public BigInteger getMaxOffset() + { + return MAX_OFFSET; + } + + final public BigInteger distance(IAddress other) + { + return address.add(((Addr64)other).address.negate()); + } + + final public boolean isMax() + { + return address.equals(MAX); + } + + final public boolean isZero() + { + return address.equals(ZERO); + } + + final public int compareTo(IAddress addr) + { + return this.address.compareTo(((Addr64)addr).address); + } + + final public boolean equals(IAddress x) + { + if (x == this) + return true; + if (!(x instanceof Addr64)) + return false; + return this.address.equals(((Addr64)x).address); + } + + final public String toString() + { + return toString(10); + } + + final public String toString(int radix) + { + return address.toString(radix); + } + + final public String toHexAddressString( ) + { + String addressString = address.toString(16); + StringBuffer sb = new StringBuffer( CHARS_NUM ); + int count = DIGITS_NUM - addressString.length(); + sb.append( "0x" ); + for ( int i = 0; i < count; ++i ) + { + sb.append( '0' ); + } + sb.append( addressString ); + return sb.toString(); + } + + final public int getCharsNum() + { + return CHARS_NUM; + } +} + diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/IAddressFactory.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/IAddressFactory.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/IAddressFactory.java 1970-01-01 03:00:00.000000000 +0300 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/IAddressFactory.java 2004-09-16 14:49:00.000000000 +0400 @@ -0,0 +1,51 @@ +/******************************************************************************* + * Copyright (c) 2004 Intel Corporation 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: + * Intel Corporation - Initial API and implementation + *******************************************************************************/ +package org.eclipse.cdt.core; + + +/* + * This inteface serves as an address factory. If you need to + * implement your own addresses, you should extend this. + * + * Please see Addr32Factory and Addr64Factory to see how it can be implemented. + */ +public interface IAddressFactory +{ + /* + * Returns zero address, i.e. minimal possible address + */ + IAddress getZero(); + /* + * Returns maximal address. + */ + IAddress getMax(); + /* + * Creates address from string representation. + * + * 1. This method should be able to create address from hex + * address string (string produced with + * IAddress.toHexAddressString() method). + * 2. Method should be case insensetive + * 3. Method should be able to create address from decimal address + * representation + * + * Please see Addr32Factory.createAddress() for reference implementation. + */ + IAddress createAddress(String addr); + /* + * Creates address from string with given radix. + * + * Given string should not contain any prefixes or sign numbers. + * + * Method should be case insensetive + */ + IAddress createAddress(String addr, int radix); +} diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/IAddress.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/IAddress.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/IAddress.java 1970-01-01 03:00:00.000000000 +0300 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/IAddress.java 2004-09-16 14:49:00.000000000 +0400 @@ -0,0 +1,82 @@ +/******************************************************************************* + * Copyright (c) 2004 Intel Corporation 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: + * Intel Corporation - Initial API and implementation + *******************************************************************************/ +package org.eclipse.cdt.core; + +import java.math.BigInteger; + +/* + * Represents C/C++ address in CDT. All implementors of this inteface should be + * immutable, i.e. all methods should not modify objects, they should return + * new object. + * + * Please see Addr32 and Addr64 classes to see how this interface should + * be extended + */ +public interface IAddress +{ + /* + * Return adds offset to address and returns new address object + * which is the result + */ + IAddress add(BigInteger offset); + /* + * Returns maximal offset possible for address. The offset + * should be Identicall for all addresses of given class. + */ + BigInteger getMaxOffset(); + /* + * Returns distance between two addresses. Distance may be positive or negative + */ + BigInteger distance(IAddress other); + /* + * Compares two addresses. + * + * Returns: + * -1 if this < addr + * 0 if this == addr + * 1 if this > addr + */ + int compareTo(IAddress addr); + /* + * Returns true if addresses are equal + */ + boolean equals(IAddress addr); + /* + * Return true if address is zero, i.e. minimal possible + */ + boolean isZero(); + /* + * Return true if address is maximal, i.e. maximal possible + */ + boolean isMax(); + + /* + * Converts address to string as an unsigned number with given radix + */ + String toString(int radix); + /* + * Identical to toString(10) + */ + String toString(); + /* + * Converts address to the hex representation with '0x' prefix and + * with all leading zeros. The length of returned string should be + * the same for all addresses of given class. I.e. 10 for 32-bit + * addresses and 18 for 64-bit addresses + */ + String toHexAddressString(); + + /* + * Returns amount of symbols in hex representation. Is identical to + * toHexAddressString().length(). It is present for perfomance purpose. + */ + int getCharsNum(); +} \ No newline at end of file diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/IBinaryParser.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/IBinaryParser.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/IBinaryParser.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/IBinaryParser.java 2004-09-16 14:49:00.000000000 +0400 @@ -121,7 +121,7 @@ * @param addr * @return ISymbol */ - ISymbol getSymbol(long addr); + ISymbol getSymbol(IAddress addr); /** * The name of the object @@ -129,6 +129,7 @@ */ String getName(); + IAddressFactory getAddressFactory(); } /** @@ -176,7 +177,7 @@ * Address of the symbol * @return */ - long getAddress(); + IAddress getAddress(); /** * Size of the symbol. diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/model/IBinaryElement.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/model/IBinaryElement.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/model/IBinaryElement.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/model/IBinaryElement.java 2004-09-16 14:49:00.000000000 +0400 @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.cdt.core.model; +import org.eclipse.cdt.core.IAddress; + /** */ @@ -22,7 +24,7 @@ * @exception CModelException if this element does not have address * information. */ - long getAddress() throws CModelException; + IAddress getAddress() throws CModelException; /** * Returns the binary object the element belongs to. diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/model/IBinary.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/model/IBinary.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/model/IBinary.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/core/model/IBinary.java 2004-09-16 14:49:00.000000000 +0400 @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.cdt.core.model; +import org.eclipse.cdt.core.IAddressFactory; + /** * Represents a Binary file, for example an ELF excutable. @@ -43,4 +45,6 @@ public boolean isLittleEndian(); + public IAddressFactory getAddressFactory(); + } diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/internal/core/model/BinaryElement.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/internal/core/model/BinaryElement.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/internal/core/model/BinaryElement.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/internal/core/model/BinaryElement.java 2004-09-16 14:49:00.000000000 +0400 @@ -7,6 +7,7 @@ import java.io.IOException; import java.util.Map; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.core.model.CModelException; import org.eclipse.cdt.core.model.IBinary; import org.eclipse.cdt.core.model.IBinaryElement; @@ -27,9 +28,9 @@ */ public class BinaryElement extends CElement implements IBinaryElement, ISourceManipulation, ISourceReference { - long addr; + IAddress addr; - public BinaryElement(ICElement parent, String name, int type, long a) { + public BinaryElement(ICElement parent, String name, int type, IAddress a) { super(parent, name, type); addr = a; } @@ -153,7 +154,7 @@ /* (non-Javadoc) * @see org.eclipse.cdt.core.model.IBinaryElement#getAddress() */ - public long getAddress() throws CModelException { + public IAddress getAddress() throws CModelException { return addr; } diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/internal/core/model/BinaryFunction.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/internal/core/model/BinaryFunction.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/internal/core/model/BinaryFunction.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/internal/core/model/BinaryFunction.java 2004-09-16 14:49:00.000000000 +0400 @@ -11,6 +11,7 @@ package org.eclipse.cdt.internal.core.model; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.core.model.IBinaryFunction; import org.eclipse.cdt.core.model.ICElement; @@ -18,7 +19,7 @@ */ public class BinaryFunction extends BinaryElement implements IBinaryFunction { - public BinaryFunction(ICElement parent, String name, long a) { + public BinaryFunction(ICElement parent, String name, IAddress a) { super(parent, name, ICElement.C_FUNCTION, a); } diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/internal/core/model/Binary.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/internal/core/model/Binary.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/internal/core/model/Binary.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/internal/core/model/Binary.java 2004-09-16 14:49:00.000000000 +0400 @@ -17,6 +17,7 @@ import java.util.HashMap; import java.util.Map; +import org.eclipse.cdt.core.IAddressFactory; import org.eclipse.cdt.core.IBinaryParser.IBinaryExecutable; import org.eclipse.cdt.core.IBinaryParser.IBinaryFile; import org.eclipse.cdt.core.IBinaryParser.IBinaryObject; @@ -43,6 +44,7 @@ private long longBSS; private String endian; private String soname; + private IAddressFactory addressFactory; private long fLastModification; @@ -172,6 +174,15 @@ return binaryObject; } + public IAddressFactory getAddressFactory() { + if (isObject() || isExecutable() || isSharedLib() || isCore()) { + if (addressFactory == null || hasChanged()) { + addressFactory = getBinaryObject().getAddressFactory(); + } + } + return addressFactory; + } + protected int getType() { IBinaryObject obj = getBinaryObject(); if (obj != null && (fBinType == 0 || hasChanged())) { @@ -193,6 +204,7 @@ longData = -1; longText = -1; soname = null; + addressFactory = null; } return changed; } diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/internal/core/model/BinaryModule.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/internal/core/model/BinaryModule.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/internal/core/model/BinaryModule.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/internal/core/model/BinaryModule.java 2004-09-16 14:49:00.000000000 +0400 @@ -13,6 +13,7 @@ import java.util.Map; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.core.model.CModelException; import org.eclipse.cdt.core.model.IBinary; import org.eclipse.cdt.core.model.IBinaryElement; @@ -47,8 +48,8 @@ /* (non-Javadoc) * @see org.eclipse.cdt.core.model.IBinaryElement#getAddress() */ - public long getAddress() throws CModelException { - return 0; + public IAddress getAddress() throws CModelException { + return null; } /* (non-Javadoc) diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/internal/core/model/BinaryVariable.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/internal/core/model/BinaryVariable.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/internal/core/model/BinaryVariable.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/internal/core/model/BinaryVariable.java 2004-09-16 14:49:00.000000000 +0400 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.cdt.internal.core.model; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.core.model.ICElement; import org.eclipse.cdt.core.model.IVariable; @@ -18,7 +19,7 @@ */ public class BinaryVariable extends BinaryElement implements IVariable { - public BinaryVariable(ICElement parent, String name, long a) { + public BinaryVariable(ICElement parent, String name, IAddress a) { super(parent, name, ICElement.C_VARIABLE, a); } diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/Addr2line.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/Addr2line.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/Addr2line.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/Addr2line.java 2004-09-16 14:49:00.000000000 +0400 @@ -15,7 +15,9 @@ import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; +import java.math.BigInteger; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.utils.spawner.ProcessFactory; public class Addr2line { @@ -61,13 +63,13 @@ } } - public String getLine(long address) throws IOException { - getOutput(Integer.toHexString((int)address)); + public String getLine(IAddress address) throws IOException { + getOutput(address.toString(16)); return lastline; } - public String getFunction(long address) throws IOException { - getOutput(Integer.toHexString((int)address)); + public String getFunction(IAddress address) throws IOException { + getOutput(address.toString(16)); return lastsymbol; } @@ -78,7 +80,7 @@ * main * hello.c:39 */ - public String getFileName(long address) throws IOException { + public String getFileName(IAddress address) throws IOException { String filename = null; String line = getLine(address); int index1, index2; @@ -103,12 +105,14 @@ * main * hello.c:39 */ - public int getLineNumber(long address) throws IOException { + public int getLineNumber(IAddress address) throws IOException { // We try to get the nearest match // since the symbol may not exactly align with debug info. // In C line number 0 is invalid, line starts at 1 for file, we use // this for validation. - for (int i = 0; i <= 20; i += 4, address += i) { + + //IPF_TODO: check + for (int i = 0; i <= 20; i += 4, address = address.add(BigInteger.valueOf(i))) { String line = getLine(address); if (line != null) { int colon = line.lastIndexOf(':'); diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/BinaryObjectAdapter.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/BinaryObjectAdapter.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/BinaryObjectAdapter.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/BinaryObjectAdapter.java 2004-09-16 14:49:00.000000000 +0400 @@ -10,8 +10,11 @@ *******************************************************************************/ package org.eclipse.cdt.utils; +import java.math.BigInteger; import java.util.Arrays; +import org.eclipse.cdt.core.IAddress; +import org.eclipse.cdt.core.IAddressFactory; import org.eclipse.cdt.core.IBinaryParser; import org.eclipse.cdt.core.IBinaryParser.IBinaryExecutable; import org.eclipse.cdt.core.IBinaryParser.IBinaryObject; @@ -35,6 +38,7 @@ public String soname; public String[] needed; public String cpu; + public IAddressFactory addressFactory; public BinaryObjectInfo() { cpu = soname = ""; //$NON-NLS-1$ @@ -49,9 +53,9 @@ /* (non-Javadoc) * @see org.eclipse.cdt.core.IBinaryParser.IBinaryObject#getSymbol(long) */ - public ISymbol getSymbol(long addr) { + public ISymbol getSymbol(IAddress addr) { ISymbol[] syms = getSymbols(); - int insertion = Arrays.binarySearch(syms, new Long(addr)); + int insertion = Arrays.binarySearch(syms, addr); if (insertion >= 0) { return syms[insertion]; } @@ -60,7 +64,7 @@ } insertion = -insertion - 1; ISymbol symbol = syms[insertion - 1]; - if (addr < (symbol.getAddress() + symbol.getSize())) { + if (addr.compareTo(symbol.getAddress().add(BigInteger.valueOf(symbol.getSize()))) < 0) { return syms[insertion - 1]; } return null; @@ -153,7 +157,14 @@ } return ""; //$NON-NLS-1$ } - + public IAddressFactory getAddressFactory() + { + BinaryObjectInfo info = getBinaryObjectInfo(); + if (info != null) { + return info.addressFactory; + } + return null; //$NON-NLS-1$ + } /** * @see org.eclipse.cdt.core.model.IBinaryParser.IBinaryObject#getName() */ diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/coff/parser/ARMember.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/coff/parser/ARMember.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/coff/parser/ARMember.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/coff/parser/ARMember.java 2004-09-16 14:49:00.000000000 +0400 @@ -15,6 +15,7 @@ import java.io.InputStream; import java.util.List; +import org.eclipse.cdt.core.Addr32; import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.IBinaryParser; import org.eclipse.cdt.core.IBinaryParser.ISymbol; @@ -77,7 +78,7 @@ continue; } int type = peSyms[i].isFunction() ? ISymbol.FUNCTION : ISymbol.VARIABLE; - list.add(new Symbol(this, name, type, peSyms[i].n_value, 1)); + list.add(new Symbol(this, name, type, new Addr32(peSyms[i].n_value), 1)); } } } diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/coff/parser/CygwinPEBinaryObject.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/coff/parser/CygwinPEBinaryObject.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/coff/parser/CygwinPEBinaryObject.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/coff/parser/CygwinPEBinaryObject.java 2004-09-16 14:49:00.000000000 +0400 @@ -11,8 +11,11 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; +import java.math.BigInteger; import java.util.List; +import org.eclipse.cdt.core.Addr32; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.core.IBinaryParser.ISymbol; import org.eclipse.cdt.utils.Addr2line; import org.eclipse.cdt.utils.CPPFilt; @@ -147,7 +150,7 @@ continue; } int type = peSyms[i].isFunction() ? ISymbol.FUNCTION : ISymbol.VARIABLE; - int addr = peSyms[i].n_value; + IAddress addr = new Addr32(peSyms[i].n_value); int size = 4; if (cppfilt != null) { try { @@ -172,7 +175,7 @@ } IPath file = filename != null ? new Path(filename) : Path.EMPTY; int startLine = addr2line.getLineNumber(addr); - int endLine = addr2line.getLineNumber(addr + size - 1); + int endLine = addr2line.getLineNumber(addr.add(BigInteger.valueOf(size - 1))); list.add(new CygwinSymbol(this, name, type, addr, size, file, startLine, endLine)); } catch (IOException e) { addr2line = null; diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/coff/parser/CygwinSymbol.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/coff/parser/CygwinSymbol.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/coff/parser/CygwinSymbol.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/coff/parser/CygwinSymbol.java 2004-09-16 14:49:00.000000000 +0400 @@ -7,7 +7,9 @@ package org.eclipse.cdt.utils.coff.parser; import java.io.IOException; +import java.math.BigInteger; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.utils.Addr2line; import org.eclipse.cdt.utils.Symbol; import org.eclipse.core.runtime.IPath; @@ -31,7 +33,7 @@ * @param startLine * @param endLine */ - public CygwinSymbol(CygwinPEBinaryObject binary, String name, int type, long addr, long size, IPath sourceFile, int startLine, + public CygwinSymbol(CygwinPEBinaryObject binary, String name, int type, IAddress addr, long size, IPath sourceFile, int startLine, int endLine) { super(binary, name, type, addr, size, sourceFile, startLine, endLine); } @@ -43,7 +45,7 @@ * @param addr * @param size */ - public CygwinSymbol(CygwinPEBinaryObject binary, String name, int type, long addr, long size) { + public CygwinSymbol(CygwinPEBinaryObject binary, String name, int type, IAddress addr, long size) { super(binary, name, type, addr, size); } @@ -55,7 +57,7 @@ Addr2line addr2line = ((CygwinPEBinaryObject)binary).getAddr2line(true); if (addr2line != null) { try { - return addr2line.getLineNumber(getAddress() + offset); + return addr2line.getLineNumber(getAddress().add(BigInteger.valueOf(offset))); } catch (IOException e) { // ignore } diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/coff/parser/PEBinaryObject.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/coff/parser/PEBinaryObject.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/coff/parser/PEBinaryObject.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/coff/parser/PEBinaryObject.java 2004-09-16 14:49:00.000000000 +0400 @@ -15,6 +15,7 @@ import java.util.Arrays; import java.util.List; +import org.eclipse.cdt.core.Addr32; import org.eclipse.cdt.core.IBinaryParser; import org.eclipse.cdt.core.IBinaryParser.IBinaryFile; import org.eclipse.cdt.core.IBinaryParser.ISymbol; @@ -107,6 +108,7 @@ info.isLittleEndian = attribute.isLittleEndian(); info.hasDebug = attribute.hasDebug(); info.cpu = attribute.getCPU(); + info.addressFactory = attribute.getAddressFactory(); } protected void loadSymbols(PE pe) throws IOException { @@ -129,7 +131,7 @@ continue; } int type = peSyms[i].isFunction() ? ISymbol.FUNCTION : ISymbol.VARIABLE; - list.add(new Symbol(this, name, type, peSyms[i].n_value, 1)); + list.add(new Symbol(this, name, type, new Addr32(peSyms[i].n_value), 1)); } } } diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/coff/PE.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/coff/PE.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/coff/PE.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/coff/PE.java 2004-09-16 14:49:00.000000000 +0400 @@ -14,7 +14,9 @@ import java.io.IOException; import java.io.RandomAccessFile; +import org.eclipse.cdt.core.Addr32Factory; import org.eclipse.cdt.core.CCorePlugin; +import org.eclipse.cdt.core.IAddressFactory; import org.eclipse.cdt.utils.coff.Coff.FileHeader; import org.eclipse.cdt.utils.coff.Coff.OptionalHeader; import org.eclipse.cdt.utils.coff.Coff.SectionHeader; @@ -84,6 +86,7 @@ int word; boolean bDebug; boolean isle; + IAddressFactory addrFactory; public String getCPU() { return cpu; @@ -104,6 +107,11 @@ public int getWord() { return word; } + + public IAddressFactory getAddressFactory(){ + return addrFactory; + } + } /** @@ -462,6 +470,8 @@ if ((filhdr.f_flags & PEConstants.IMAGE_FILE_32BIT_MACHINE) != 0) { attrib.word = 32; } + + attrib.addrFactory = new Addr32Factory(); return attrib; } diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/elf/Elf.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/elf/Elf.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/elf/Elf.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/elf/Elf.java 2004-09-16 15:09:00.000000000 +0400 @@ -17,10 +17,21 @@ import java.util.Arrays; import java.util.Comparator; +import org.eclipse.cdt.core.Addr32; +import org.eclipse.cdt.core.Addr32Factory; +import org.eclipse.cdt.core.Addr64; +import org.eclipse.cdt.core.Addr64Factory; import org.eclipse.cdt.core.CCorePlugin; +import org.eclipse.cdt.core.IAddress; +import org.eclipse.cdt.core.IAddressFactory; // test checkin public class Elf { + public final static int ELF32_ADDR_SIZE = 4; + public final static int ELF32_OFF_SIZE = 4; + public final static int ELF64_ADDR_SIZE = 8; + public final static int ELF64_OFF_SIZE = 8; + protected ERandomAccessFile efile; protected ELFhdr ehdr; @@ -52,7 +63,7 @@ /* e_ident[EI_CLASS] */ public final static int ELFCLASSNONE = 0; - public final static int ELCLASS32 = 1; + public final static int ELFCLASS32 = 1; public final static int ELFCLASS64 = 2; /* e_ident[EI_DATA] */ @@ -117,7 +128,7 @@ public int e_type; /* file type (Elf32_Half) */ public int e_machine; /* machine type (Elf32_Half) */ public long e_version; /* version number (Elf32_Word) */ - public long e_entry; /* entry point (Elf32_Addr)*/ + public IAddress e_entry; /* entry point (Elf32_Addr)*/ public long e_phoff; /* Program hdr offset (Elf32_Off)*/ public long e_shoff; /* Section hdr offset (Elf32_Off)*/ public long e_flags; /* Processor flags (Elf32_Word)*/ @@ -138,9 +149,30 @@ e_type = efile.readShortE(); e_machine = efile.readShortE(); e_version = efile.readIntE(); - e_entry = efile.readIntE(); + switch (e_ident[ELFhdr.EI_CLASS]) + { + case ELFhdr.ELFCLASS32: + { + byte[] addrArray = new byte[ELF32_ADDR_SIZE]; + efile.readFullyE(addrArray); + e_entry = new Addr32(addrArray); e_phoff = efile.readIntE(); e_shoff = efile.readIntE(); + } + break; + case ELFhdr.ELFCLASS64: + { + byte[] addrArray = new byte[ELF64_ADDR_SIZE]; + efile.readFullyE(addrArray); + e_entry = new Addr64(addrArray); + e_phoff = readUnsignedLong(efile); + e_shoff = readUnsignedLong(efile); + } + break; + case ELFhdr.ELFCLASSNONE: + default: + throw new IOException("Unknown ELF class " + e_ident[ELFhdr.EI_CLASS]); + } e_flags = efile.readIntE(); e_ehsize = efile.readShortE(); e_phentsize = efile.readShortE(); @@ -163,9 +195,30 @@ e_type = makeShort(bytes, offset, isle); offset += 2; e_machine = makeShort(bytes, offset, isle); offset += 2; e_version = makeInt(bytes, offset, isle); offset += 4; - e_entry = makeInt(bytes, offset, isle); offset += 4; - e_phoff = makeInt(bytes, offset, isle); offset += 4; - e_shoff = makeInt(bytes, offset, isle); offset += 4; + switch (e_ident[ELFhdr.EI_CLASS]) + { + case ELFhdr.ELFCLASS32: + { + byte[] addrArray = new byte[ELF32_ADDR_SIZE]; + System.arraycopy(bytes, offset, addrArray, 0, ELF32_ADDR_SIZE); offset += ELF32_ADDR_SIZE; + e_entry = new Addr32(addrArray); + e_phoff = makeInt(bytes, offset, isle); offset += ELF32_OFF_SIZE; + e_shoff = makeInt(bytes, offset, isle); offset += ELF32_OFF_SIZE; + } + break; + case ELFhdr.ELFCLASS64: + { + byte[] addrArray = new byte[ELF64_ADDR_SIZE]; + System.arraycopy(bytes, offset, addrArray, 0, ELF64_ADDR_SIZE); offset += ELF64_ADDR_SIZE; + e_entry = new Addr64(addrArray); + e_phoff = makeUnsignedLong(bytes, offset, isle); offset += ELF64_OFF_SIZE; + e_shoff = makeUnsignedLong(bytes, offset, isle); offset += ELF64_OFF_SIZE; + } + break; + case ELFhdr.ELFCLASSNONE: + default: + throw new IOException("Unknown ELF class " + e_ident[ELFhdr.EI_CLASS]); + } e_flags = makeInt(bytes, offset, isle); offset += 4; e_ehsize = makeShort(bytes, offset, isle); offset += 2; e_phentsize = makeShort(bytes, offset, isle); offset += 2; @@ -194,6 +247,38 @@ return ((val[offset + 0] << 24) + (val[offset + 1] << 16) + (val[offset + 2] << 8) + val[offset + 3]); } + private final long makeLong(byte [] val, int offset, boolean isle) throws IOException + { + long result = 0; + int shift = 0; + if ( isle ) + for(int i=7; i >= 0; i-- ) + { + shift = i*8; + result += ( ((long)val[offset + i]) << shift ) & ( 0xffL << shift ); + } + else + for(int i=0; i <= 7; i++ ) + { + shift = (7-i)*8; + result += ( ((long)val[offset + i]) << shift ) & ( 0xffL << shift ); + } + return result; + } + + private final long makeUnsignedLong(byte [] val, int offset, boolean isle) throws IOException + { + long result = makeLong(val,offset,isle); + if(result < 0) + { + throw new IOException( "Maximal file offset is " + Long.toHexString(Long.MAX_VALUE) + + " given offset is " + Long.toHexString(result)); + } + return result; + + } + + } @@ -222,7 +307,7 @@ public long sh_name; public long sh_type; public long sh_flags; - public long sh_addr; + public IAddress sh_addr; public long sh_offset; public long sh_size; public long sh_link; @@ -301,9 +386,9 @@ public final static int SHN_XINDEX = 0xffffffff; public final static int SHN_HIRESERVE = 0xffffffff; - + /*NOTE: 64 bit and 32 bit ELF sections has different order*/ public long st_name; - public long st_value; + public IAddress st_value; public long st_size; public short st_info; public short st_other; @@ -326,6 +411,7 @@ } public int compareTo(Object obj) { + /* long thisVal = 0; long anotherVal = 0; if ( obj instanceof Symbol ) { @@ -338,6 +424,8 @@ thisVal = this.st_value; } return (thisVal 0 ) return symbols[ndx]; if ( ndx == -1 ) { @@ -882,7 +1101,7 @@ ndx = -ndx - 1; return symbols[ndx-1]; } - + /* public long swapInt( long val ) { if ( ehdr.e_ident[ELFhdr.EI_DATA] == ELFhdr.ELFDATA2LSB ) { short tmp[] = new short[4]; @@ -904,8 +1123,19 @@ } return val; } - +*/ public String getFilename() { return file; } + + private final long readUnsignedLong(ERandomAccessFile file) throws IOException + { + long result = file.readLongE(); + if(result < 0) + { + throw new IOException( "Maximal file offset is " + Long.toHexString(Long.MAX_VALUE) + + " given offset is " + Long.toHexString(result)); + } + return result; + } } diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/elf/ERandomAccessFile.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/elf/ERandomAccessFile.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/elf/ERandomAccessFile.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/elf/ERandomAccessFile.java 2004-09-16 14:49:00.000000000 +0400 @@ -59,6 +59,40 @@ return ((val[0] << 24) + (val[1] << 16) + (val[2] << 8) + val[3]); } + public final long readLongE() throws IOException + { + byte [] bytes = new byte[8]; + long result = 0; + super.readFully(bytes); + int shift = 0; + if ( isle ) + for(int i=7; i >= 0; i-- ) + { + shift = i*8; + result += ( ((long)bytes[i]) << shift ) & ( 0xffL << shift ); + } + else + for(int i=0; i <= 7; i++ ) + { + shift = (7-i)*8; + result += ( ((long)bytes[i]) << shift ) & ( 0xffL << shift ); + } + return result; + } + + public final void readFullyE(byte [] bytes) throws IOException + { + super.readFully(bytes); + byte tmp = 0; + if( isle ) + for(int i=0; i <= bytes.length / 2; i++) + { + tmp = bytes[i]; + bytes[i] = bytes[bytes.length - i -1]; + bytes[bytes.length - i -1] = tmp; + } + } + public void setFileOffset( long offset ) throws IOException { ptr_offset = offset; super.seek( offset ); diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/elf/parser/ElfBinaryObject.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/elf/parser/ElfBinaryObject.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/elf/parser/ElfBinaryObject.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/elf/parser/ElfBinaryObject.java 2004-09-16 14:49:00.000000000 +0400 @@ -120,6 +120,7 @@ info.isLittleEndian = attribute.isLittleEndian(); info.hasDebug = attribute.hasDebug(); info.cpu = attribute.getCPU(); + info.addressFactory = attribute.getAddressFactory(); } protected void loadSymbols(ElfHelper helper) throws IOException { diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/elf/parser/GNUElfBinaryObject.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/elf/parser/GNUElfBinaryObject.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/elf/parser/GNUElfBinaryObject.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/elf/parser/GNUElfBinaryObject.java 2004-09-16 14:49:00.000000000 +0400 @@ -11,8 +11,10 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; +import java.math.BigInteger; import java.util.List; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.utils.Addr2line; import org.eclipse.cdt.utils.CPPFilt; import org.eclipse.cdt.utils.Objdump; @@ -124,7 +126,7 @@ cppfilt = null; } } - long addr = array[i].st_value; + IAddress addr = array[i].st_value; long size = array[i].st_size; if (addr2line != null) { try { @@ -133,7 +135,7 @@ // the file. IPath file = (filename != null && !filename.equals("??")) ? new Path(filename) : Path.EMPTY; //$NON-NLS-1$ int startLine = addr2line.getLineNumber(addr); - int endLine = addr2line.getLineNumber(addr + size - 1); + int endLine = addr2line.getLineNumber(addr.add(BigInteger.valueOf(size - 1))); list.add(new GNUSymbol(this, name, type, addr, size, file, startLine, endLine)); } catch (IOException e) { addr2line = null; diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/elf/parser/GNUSymbol.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/elf/parser/GNUSymbol.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/elf/parser/GNUSymbol.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/elf/parser/GNUSymbol.java 2004-09-16 14:49:00.000000000 +0400 @@ -11,19 +11,21 @@ package org.eclipse.cdt.utils.elf.parser; import java.io.IOException; +import java.math.BigInteger; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.utils.Addr2line; import org.eclipse.cdt.utils.Symbol; import org.eclipse.core.runtime.IPath; public class GNUSymbol extends Symbol { - public GNUSymbol(GNUElfBinaryObject binary, String name, int type, long addr, long size, IPath sourceFile, int startLine, int endLine) { + public GNUSymbol(GNUElfBinaryObject binary, String name, int type, IAddress addr, long size, IPath sourceFile, int startLine, int endLine) { super(binary, name, type, addr, size, sourceFile, startLine, endLine); // TODO Auto-generated constructor stub } - public GNUSymbol(GNUElfBinaryObject binary, String name, int type, long addr, long size) { + public GNUSymbol(GNUElfBinaryObject binary, String name, int type, IAddress addr, long size) { super(binary, name, type, addr, size); } @@ -35,7 +37,7 @@ Addr2line addr2line = ((GNUElfBinaryObject)binary).getAddr2line(true); if (addr2line != null) { try { - return addr2line.getLineNumber(getAddress() + offset); + return addr2line.getLineNumber(getAddress().add(BigInteger.valueOf(offset))); } catch (IOException e) { // ignore } diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/macho/parser/ARMember.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/macho/parser/ARMember.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/macho/parser/ARMember.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/macho/parser/ARMember.java 2004-09-16 14:49:00.000000000 +0400 @@ -15,6 +15,7 @@ import java.io.InputStream; import java.util.List; +import org.eclipse.cdt.core.Addr32; import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.IBinaryParser; import org.eclipse.cdt.utils.Addr2line; @@ -72,7 +73,7 @@ protected void addSymbols(MachO.Symbol[] array, int type, Addr2line addr2line, CPPFilt cppfilt, List list) { for (int i = 0; i < array.length; i++) { - list.add(new Symbol(this, array[i].toString(), type, array[i].n_value, 4)); + list.add(new Symbol(this, array[i].toString(), type, new Addr32(array[i].n_value), 4)); } } diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/macho/parser/MachOBinaryObject.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/macho/parser/MachOBinaryObject.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/macho/parser/MachOBinaryObject.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/macho/parser/MachOBinaryObject.java 2004-09-16 14:49:00.000000000 +0400 @@ -15,6 +15,7 @@ import java.util.Arrays; import java.util.List; +import org.eclipse.cdt.core.Addr32; import org.eclipse.cdt.core.IBinaryParser; import org.eclipse.cdt.core.IBinaryParser.IBinaryFile; import org.eclipse.cdt.core.IBinaryParser.ISymbol; @@ -161,7 +162,7 @@ int size = 0; String filename = array[i].getFilename(); IPath filePath = (filename != null) ? new Path(filename) : null; //$NON-NLS-1$ - list.add(new Symbol(this, name, type, array[i].n_value, size, filePath, array[i].getLineNumber(addr), array[i].getLineNumber(addr + size - 1))); + list.add(new Symbol(this, name, type, new Addr32(array[i].n_value), size, filePath, array[i].getLineNumber(addr), array[i].getLineNumber(addr + size - 1))); } } diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/som/parser/ARMember.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/som/parser/ARMember.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/som/parser/ARMember.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/som/parser/ARMember.java 2004-09-16 14:49:00.000000000 +0400 @@ -15,15 +15,15 @@ import java.io.InputStream; import java.util.List; +import org.eclipse.cdt.core.Addr32; import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.IBinaryParser; import org.eclipse.cdt.core.IBinaryParser.ISymbol; -import org.eclipse.core.runtime.IPath; - import org.eclipse.cdt.utils.CPPFilt; import org.eclipse.cdt.utils.Symbol; import org.eclipse.cdt.utils.som.AR; import org.eclipse.cdt.utils.som.SOM; +import org.eclipse.core.runtime.IPath; /** * A member of a SOM archive @@ -61,7 +61,7 @@ cppfilt = null; } } - Symbol sym = new Symbol(this, name, peSyms[i].isFunction() ? ISymbol.FUNCTION : ISymbol.VARIABLE, peSyms[i].symbol_value, 1); + Symbol sym = new Symbol(this, name, peSyms[i].isFunction() ? ISymbol.FUNCTION : ISymbol.VARIABLE, new Addr32(peSyms[i].symbol_value), 1); list.add(sym); } diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/som/parser/SOMBinaryObject.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/som/parser/SOMBinaryObject.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/som/parser/SOMBinaryObject.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/som/parser/SOMBinaryObject.java 2004-09-16 14:49:00.000000000 +0400 @@ -13,10 +13,13 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; +import java.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.eclipse.cdt.core.Addr32; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.core.IBinaryParser; import org.eclipse.cdt.core.IBinaryParser.IBinaryFile; import org.eclipse.cdt.core.IBinaryParser.ISymbol; @@ -25,7 +28,6 @@ import org.eclipse.cdt.utils.CPPFilt; import org.eclipse.cdt.utils.Objdump; import org.eclipse.cdt.utils.som.SOM; -import org.eclipse.cdt.utils.som.parser.SOMParser; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; @@ -162,7 +164,7 @@ continue; } int type = peSyms[i].isFunction() ? ISymbol.FUNCTION : ISymbol.VARIABLE; - int addr = peSyms[i].symbol_value; + IAddress addr = new Addr32(peSyms[i].symbol_value); int size = 4; if (cppfilt != null) { try { @@ -181,7 +183,7 @@ IPath file = filename != null ? new Path(filename) : Path.EMPTY; int startLine = addr2line.getLineNumber(addr); - int endLine = addr2line.getLineNumber(addr + size - 1); + int endLine = addr2line.getLineNumber(addr.add(BigInteger.valueOf(size - 1))); list.add(new SomSymbol(this, name, type, addr, size, file, startLine, endLine)); } catch (IOException e) { addr2line = null; diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/som/parser/SomSymbol.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/som/parser/SomSymbol.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/som/parser/SomSymbol.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/som/parser/SomSymbol.java 2004-09-16 14:49:00.000000000 +0400 @@ -11,7 +11,9 @@ package org.eclipse.cdt.utils.som.parser; import java.io.IOException; +import java.math.BigInteger; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.utils.Addr2line; import org.eclipse.cdt.utils.BinaryObjectAdapter; import org.eclipse.cdt.utils.Symbol; @@ -34,7 +36,7 @@ * @param startLine * @param endLine */ - public SomSymbol(BinaryObjectAdapter binary, String name, int type, long addr, long size, IPath sourceFile, int startLine, int endLine) { + public SomSymbol(BinaryObjectAdapter binary, String name, int type, IAddress addr, long size, IPath sourceFile, int startLine, int endLine) { super(binary, name, type, addr, size, sourceFile, startLine, endLine); // TODO Auto-generated constructor stub } @@ -46,7 +48,7 @@ * @param addr * @param size */ - public SomSymbol(BinaryObjectAdapter binary, String name, int type, long addr, long size) { + public SomSymbol(BinaryObjectAdapter binary, String name, int type, IAddress addr, long size) { super(binary, name, type, addr, size); // TODO Auto-generated constructor stub } @@ -59,7 +61,7 @@ Addr2line addr2line = ((SOMBinaryObject)binary).getAddr2line(true); if (addr2line != null) { try { - return addr2line.getLineNumber(getAddress() + offset); + return addr2line.getLineNumber(getAddress().add(BigInteger.valueOf(offset))); } catch (IOException e) { // ignore } diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/Symbol.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/Symbol.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/Symbol.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/Symbol.java 2004-09-16 14:49:00.000000000 +0400 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.cdt.utils; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.core.IBinaryParser.IBinaryObject; import org.eclipse.cdt.core.IBinaryParser.ISymbol; import org.eclipse.core.runtime.IPath; @@ -19,14 +20,14 @@ protected final BinaryObjectAdapter binary; private final String name; - private final long addr; + private final IAddress addr; private final int type; private final long size; private final int startLine; private final int endLine; private final IPath sourceFile; - public Symbol(BinaryObjectAdapter binary, String name, int type, long addr, long size, IPath sourceFile, int startLine, int endLine) { + public Symbol(BinaryObjectAdapter binary, String name, int type, IAddress addr, long size, IPath sourceFile, int startLine, int endLine) { this.binary = binary; this.name = name; this.type = type; @@ -37,7 +38,7 @@ this.sourceFile = sourceFile; } - public Symbol(BinaryObjectAdapter binary, String name, int type, long addr, long size) { + public Symbol(BinaryObjectAdapter binary, String name, int type, IAddress addr, long size) { this.binary = binary; this.name = name; this.type = type; @@ -81,7 +82,7 @@ * * @see org.eclipse.cdt.core.IBinaryParser.ISymbol#getAdress() */ - public long getAddress() { + public IAddress getAddress() { return addr; } @@ -122,17 +123,13 @@ } public int compareTo(Object obj) { - long thisVal = 0; - long anotherVal = 0; + IAddress thisVal = this.addr; + IAddress anotherVal = null; if (obj instanceof Symbol) { - Symbol sym = (Symbol) obj; - thisVal = this.addr; - anotherVal = sym.addr; - } else if (obj instanceof Long) { - Long val = (Long) obj; - anotherVal = val.longValue(); - thisVal = this.addr; + anotherVal = ((Symbol) obj).addr; + } else if (obj instanceof IAddress) { + anotherVal = (IAddress) obj; } - return (thisVal < anotherVal ? -1 : (thisVal == anotherVal ? 0 : 1)); + return thisVal.compareTo(anotherVal); } } \ No newline at end of file diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/xcoff/parser/ARMember.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/xcoff/parser/ARMember.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/xcoff/parser/ARMember.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/xcoff/parser/ARMember.java 2004-09-16 14:49:00.000000000 +0400 @@ -15,6 +15,7 @@ import java.io.InputStream; import java.util.List; +import org.eclipse.cdt.core.Addr32; import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.IBinaryParser; import org.eclipse.cdt.core.IBinaryParser.ISymbol; @@ -87,7 +88,7 @@ cppfilt = null; } } - Symbol sym = new Symbol(this, name, peSyms[i].isFunction() ? ISymbol.FUNCTION : ISymbol.VARIABLE, peSyms[i].n_value, 1); + Symbol sym = new Symbol(this, name, peSyms[i].isFunction() ? ISymbol.FUNCTION : ISymbol.VARIABLE, new Addr32(peSyms[i].n_value), 1); list.add(sym); } diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/xcoff/parser/XCOFFBinaryObject.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/xcoff/parser/XCOFFBinaryObject.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/xcoff/parser/XCOFFBinaryObject.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/xcoff/parser/XCOFFBinaryObject.java 2004-09-16 14:49:00.000000000 +0400 @@ -11,10 +11,13 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; +import java.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.eclipse.cdt.core.Addr32; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.core.IBinaryParser; import org.eclipse.cdt.core.IBinaryParser.IBinaryFile; import org.eclipse.cdt.core.IBinaryParser.ISymbol; @@ -164,7 +167,7 @@ continue; } int type = peSyms[i].isFunction() ? ISymbol.FUNCTION : ISymbol.VARIABLE; - int addr = peSyms[i].n_value; + IAddress addr = new Addr32(peSyms[i].n_value); int size = 4; if (cppfilt != null) { try { @@ -184,7 +187,7 @@ IPath file = filename != null ? new Path(filename) : Path.EMPTY; int startLine = addr2line.getLineNumber(addr); - int endLine = addr2line.getLineNumber(addr + size - 1); + int endLine = addr2line.getLineNumber(addr.add(BigInteger.valueOf(size - 1))); list.add(new XCoffSymbol(this, name, type, addr, size, file, startLine, endLine)); } catch (IOException e) { addr2line = null; diff -NaurbB workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/xcoff/parser/XCoffSymbol.java workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/xcoff/parser/XCoffSymbol.java --- workspace-old/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/xcoff/parser/XCoffSymbol.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.core/src-cdtcore/org/eclipse/cdt/utils/xcoff/parser/XCoffSymbol.java 2004-09-16 14:49:00.000000000 +0400 @@ -7,7 +7,9 @@ package org.eclipse.cdt.utils.xcoff.parser; import java.io.IOException; +import java.math.BigInteger; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.utils.Addr2line; import org.eclipse.cdt.utils.BinaryObjectAdapter; import org.eclipse.cdt.utils.Symbol; @@ -32,7 +34,7 @@ * @param startLine * @param endLine */ - public XCoffSymbol(BinaryObjectAdapter binary, String name, int type, long addr, long size, IPath sourceFile, int startLine, + public XCoffSymbol(BinaryObjectAdapter binary, String name, int type, IAddress addr, long size, IPath sourceFile, int startLine, int endLine) { super(binary, name, type, addr, size, sourceFile, startLine, endLine); // TODO Auto-generated constructor stub @@ -45,7 +47,7 @@ * @param addr * @param size */ - public XCoffSymbol(BinaryObjectAdapter binary, String name, int type, long addr, long size) { + public XCoffSymbol(BinaryObjectAdapter binary, String name, int type, IAddress addr, long size) { super(binary, name, type, addr, size); // TODO Auto-generated constructor stub } @@ -58,7 +60,7 @@ Addr2line addr2line = ((XCOFFBinaryObject)binary).getAddr2line(true); if (addr2line != null) { try { - return addr2line.getLineNumber(getAddress() + offset); + return addr2line.getLineNumber(getAddress().add(BigInteger.valueOf(offset))); } catch (IOException e) { // ignore } diff -NaurbB workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/CDebugUtils.java workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/CDebugUtils.java --- workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/CDebugUtils.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/CDebugUtils.java 2004-09-16 14:45:00.000000000 +0400 @@ -91,19 +91,6 @@ } } - public static String toHexAddressString( long address ) - { - String addressString = Long.toHexString( address ); - StringBuffer sb = new StringBuffer( 10 ); - sb.append( "0x" ); //$NON-NLS-1$ - for ( int i = 0; i < 8 - addressString.length(); ++i ) - { - sb.append( '0' ); - } - sb.append( addressString ); - return sb.toString(); - } - public static char[] getByteText( byte b ) { return new char[]{ charFromByte( (byte)((b >>> 4) & 0x0f) ), @@ -201,18 +188,6 @@ return Long.parseLong( bytesToString( bytes, le, false ), 16 ); } - public static long toLongLong( char[] bytes, boolean le ) - { - if ( bytes.length != 16 ) - return 0; - return Long.parseLong( bytesToString( bytes, le, false ), 16 ); - } - - public static long toUnsignedLongLong( char[] bytes, boolean le ) - { - return 0; - } - private static String bytesToString( char[] bytes, boolean le, boolean signed ) { char[] copy = new char[bytes.length]; diff -NaurbB workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/event/ICDIMemoryChangedEvent.java workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/event/ICDIMemoryChangedEvent.java --- workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/event/ICDIMemoryChangedEvent.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/event/ICDIMemoryChangedEvent.java 2004-09-16 14:45:00.000000000 +0400 @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.cdt.debug.core.cdi.event; +import org.eclipse.cdt.core.IAddress; + /** * * Notifies that the originator has changed. @@ -19,5 +21,5 @@ /** * @return the modified addresses. */ - Long[] getAddresses(); + IAddress[] getAddresses(); } diff -NaurbB workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/ICDILocation.java workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/ICDILocation.java --- workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/ICDILocation.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/ICDILocation.java 2004-09-16 14:45:00.000000000 +0400 @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.cdt.debug.core.cdi; +import org.eclipse.cdt.core.IAddress; + /** * @@ -24,7 +26,7 @@ * * @return the address of this location */ - long getAddress(); + IAddress getAddress(); /** * Returns the source file of this location or null diff -NaurbB workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/ICDIMemoryManager.java workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/ICDIMemoryManager.java --- workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/ICDIMemoryManager.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/ICDIMemoryManager.java 2004-09-16 14:45:00.000000000 +0400 @@ -11,6 +11,7 @@ package org.eclipse.cdt.debug.core.cdi; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock; /** @@ -41,7 +42,7 @@ * @return a memory block with the specified identifier * @throws CDIException on failure. Reasons include: */ - ICDIMemoryBlock createMemoryBlock(long address, int length) + ICDIMemoryBlock createMemoryBlock(IAddress address, int length) throws CDIException; /** diff -NaurbB workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/ICDISourceManager.java workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/ICDISourceManager.java --- workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/ICDISourceManager.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/ICDISourceManager.java 2004-09-16 14:45:00.000000000 +0400 @@ -11,6 +11,7 @@ package org.eclipse.cdt.debug.core.cdi; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction; import org.eclipse.cdt.debug.core.cdi.model.ICDIMixedInstruction; @@ -40,7 +41,7 @@ * @param endAddress is the end address * @throws CDIException on failure. */ - ICDIInstruction[] getInstructions(long startAddress, long endAddress) + ICDIInstruction[] getInstructions(IAddress startAddress, IAddress endAddress) throws CDIException; /** @@ -66,8 +67,8 @@ * @throws CDIException on failure. */ ICDIMixedInstruction[] getMixedInstructions( - long startAddress, - long endAddress) + IAddress startAddress, + IAddress endAddress) throws CDIException; /** diff -NaurbB workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/ICDITraceManager.java workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/ICDITraceManager.java --- workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/ICDITraceManager.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/ICDITraceManager.java 2004-09-16 14:45:00.000000000 +0400 @@ -11,6 +11,7 @@ package org.eclipse.cdt.debug.core.cdi; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.model.ICDITracepoint; /** @@ -155,5 +156,5 @@ * @param address - an address * @return an ICDILocation object */ - ICDILocation createLocation( long address ); + ICDILocation createLocation( IAddress address ); } diff -NaurbB workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/model/ICDIInstruction.java workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/model/ICDIInstruction.java --- workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/model/ICDIInstruction.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/model/ICDIInstruction.java 2004-09-16 14:45:00.000000000 +0400 @@ -11,6 +11,8 @@ package org.eclipse.cdt.debug.core.cdi.model; +import org.eclipse.cdt.core.IAddress; + /** * * Represents a machine instruction. @@ -22,7 +24,7 @@ * Returns the Address. * @return the address. */ - long getAdress(); + IAddress getAdress(); /** * @return the function name. diff -NaurbB workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/model/ICDIMemoryBlock.java workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/model/ICDIMemoryBlock.java --- workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/model/ICDIMemoryBlock.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/model/ICDIMemoryBlock.java 2004-09-16 14:45:00.000000000 +0400 @@ -11,6 +11,7 @@ package org.eclipse.cdt.debug.core.cdi.model; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.CDIException; /** @@ -26,7 +27,7 @@ * * @return the start address of this memory block */ - long getStartAddress(); + IAddress getStartAddress(); /** * Returns the length of this memory block in bytes. diff -NaurbB workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/model/ICDISharedLibrary.java workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/model/ICDISharedLibrary.java --- workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/model/ICDISharedLibrary.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/model/ICDISharedLibrary.java 2004-09-16 14:45:00.000000000 +0400 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.cdt.debug.core.cdi.model; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.CDIException; /** @@ -32,14 +33,14 @@ * * @return the start address of this library */ - long getStartAddress(); + IAddress getStartAddress(); /** * Returns the end address of this library. * * @return the end address of this library */ - long getEndAddress(); + IAddress getEndAddress(); /** * Returns whether the symbols of this library are read. diff -NaurbB workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/model/ICDITarget.java workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/model/ICDITarget.java --- workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/model/ICDITarget.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/model/ICDITarget.java 2004-09-16 14:45:00.000000000 +0400 @@ -11,6 +11,7 @@ package org.eclipse.cdt.debug.core.cdi.model; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.ICDICondition; import org.eclipse.cdt.debug.core.cdi.ICDILocation; @@ -182,6 +183,6 @@ /** * Returns a ICDILocation */ - ICDILocation createLocation(long address); + ICDILocation createLocation(IAddress address); } diff -NaurbB workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/model/type/ICDIPointerValue.java workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/model/type/ICDIPointerValue.java --- workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/model/type/ICDIPointerValue.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/model/type/ICDIPointerValue.java 2004-09-16 14:45:00.000000000 +0400 @@ -11,6 +11,7 @@ package org.eclipse.cdt.debug.core.cdi.model.type; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.CDIException; @@ -22,5 +23,5 @@ */ public interface ICDIPointerValue extends ICDIDerivedValue { - long pointerValue() throws CDIException; + IAddress pointerValue() throws CDIException; } diff -NaurbB workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/model/type/ICDIReferenceValue.java workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/model/type/ICDIReferenceValue.java --- workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/model/type/ICDIReferenceValue.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/cdi/model/type/ICDIReferenceValue.java 2004-09-16 14:45:00.000000000 +0400 @@ -10,11 +10,12 @@ *******************************************************************************/ package org.eclipse.cdt.debug.core.cdi.model.type; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.CDIException; /** */ public interface ICDIReferenceValue extends ICDIDerivedValue { - long referenceValue() throws CDIException; + IAddress referenceValue() throws CDIException; } diff -NaurbB workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/CDIDebugModel.java workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/CDIDebugModel.java --- workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/CDIDebugModel.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/CDIDebugModel.java 2004-09-16 14:45:00.000000000 +0400 @@ -12,6 +12,8 @@ import java.text.MessageFormat; import java.util.HashMap; + +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.ICDIConfiguration; import org.eclipse.cdt.debug.core.cdi.ICDILocation; @@ -255,7 +257,7 @@ */ public static ICAddressBreakpoint createAddressBreakpoint( String sourceHandle, IResource resource, - long address, + IAddress address, boolean enabled, int ignoreCount, String condition, @@ -266,7 +268,7 @@ attributes.put( IMarker.CHAR_END, new Integer( 0 ) ); attributes.put( IMarker.LINE_NUMBER, new Integer( -1 ) ); attributes.put( IMarker.LINE_NUMBER, new Integer( -1 ) ); - attributes.put( ICLineBreakpoint.ADDRESS, Long.toString( address ) ); + attributes.put( ICLineBreakpoint.ADDRESS, address.toHexAddressString() ); attributes.put( IBreakpoint.ENABLED, new Boolean( enabled ) ); attributes.put( ICBreakpoint.IGNORE_COUNT, new Integer( ignoreCount ) ); attributes.put( ICBreakpoint.CONDITION, condition ); diff -NaurbB workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/model/IAsmInstruction.java workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/model/IAsmInstruction.java --- workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/model/IAsmInstruction.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/model/IAsmInstruction.java 2004-09-16 14:45:00.000000000 +0400 @@ -10,6 +10,8 @@ ***********************************************************************/ package org.eclipse.cdt.debug.core.model; +import org.eclipse.cdt.core.IAddress; + /** * An instruction of disassemby. */ @@ -20,7 +22,7 @@ * * @return the address of this instruction */ - long getAdress(); + IAddress getAdress(); /** * Returns the function name of this instruction, diff -NaurbB workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/model/IBreakpointTarget.java workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/model/IBreakpointTarget.java --- workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/model/IBreakpointTarget.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/model/IBreakpointTarget.java 2004-09-16 14:45:00.000000000 +0400 @@ -10,6 +10,7 @@ ***********************************************************************/ package org.eclipse.cdt.debug.core.model; +import org.eclipse.cdt.core.IAddress; import org.eclipse.debug.core.DebugException; /** @@ -30,5 +31,5 @@ * @return the target address of the given breakpoint * @throws DebugException if the address is not available */ - long getBreakpointAddress( ICLineBreakpoint breakpoint ) throws DebugException; + IAddress getBreakpointAddress( ICLineBreakpoint breakpoint ) throws DebugException; } diff -NaurbB workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/model/ICSharedLibrary.java workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/model/ICSharedLibrary.java --- workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/model/ICSharedLibrary.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/model/ICSharedLibrary.java 2004-09-16 14:45:00.000000000 +0400 @@ -10,6 +10,7 @@ ***********************************************************************/ package org.eclipse.cdt.debug.core.model; +import org.eclipse.cdt.core.IAddress; import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.model.IDebugElement; @@ -30,14 +31,14 @@ * * @return the start address of this library */ - long getStartAddress(); + IAddress getStartAddress(); /** * Returns the end address of this library. * * @return the end address of this library */ - long getEndAddress(); + IAddress getEndAddress(); /** * Returns whether the symbols of this library are read. diff -NaurbB workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/model/ICStackFrame.java workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/model/ICStackFrame.java --- workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/model/ICStackFrame.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/model/ICStackFrame.java 2004-09-16 14:45:00.000000000 +0400 @@ -10,6 +10,7 @@ ***********************************************************************/ package org.eclipse.cdt.debug.core.model; +import org.eclipse.cdt.core.IAddress; import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.model.IStackFrame; import org.eclipse.debug.core.model.IValue; @@ -24,7 +25,7 @@ * * @return the address of this stack frame */ - public long getAddress(); + public IAddress getAddress(); /** * Returns the source file of this stack frame or null diff -NaurbB workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/model/IFormattedMemoryBlock.java workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/model/IFormattedMemoryBlock.java --- workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/model/IFormattedMemoryBlock.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/model/IFormattedMemoryBlock.java 2004-09-16 14:45:00.000000000 +0400 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.cdt.debug.core.model; +import org.eclipse.cdt.core.IAddress; import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.model.IMemoryBlock; @@ -104,13 +105,15 @@ char getPaddingCharacter(); - long nextRowAddress(); + public IAddress getRealStartAddress(); - long previousRowAddress(); + IAddress nextRowAddress(); - long nextPageAddress(); + IAddress previousRowAddress(); - long previousPageAddress(); + IAddress nextPageAddress(); + + IAddress previousPageAddress(); void reformat( int format, int wordSize, @@ -124,7 +127,7 @@ char paddingChar ) throws DebugException; void dispose(); - Long[] getChangedAddresses(); + IAddress[] getChangedAddresses(); boolean isFrozen(); diff -NaurbB workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/model/IFormattedMemoryBlockRow.java workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/model/IFormattedMemoryBlockRow.java --- workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/model/IFormattedMemoryBlockRow.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/model/IFormattedMemoryBlockRow.java 2004-09-16 14:45:00.000000000 +0400 @@ -11,6 +11,8 @@ package org.eclipse.cdt.debug.core.model; +import org.eclipse.cdt.core.IAddress; + /** * * Represents a row in the output table of formatted memory block. @@ -24,7 +26,7 @@ * * @return the address of this row */ - long getAddress(); + IAddress getAddress(); /** * Returns the array of memory words. diff -NaurbB workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/model/IJumpToAddress.java workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/model/IJumpToAddress.java --- workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/model/IJumpToAddress.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/model/IJumpToAddress.java 2004-09-16 14:45:00.000000000 +0400 @@ -10,6 +10,7 @@ ***********************************************************************/ package org.eclipse.cdt.debug.core.model; +import org.eclipse.cdt.core.IAddress; import org.eclipse.debug.core.DebugException; /** @@ -22,12 +23,12 @@ * * @return whether this operation is currently available */ - public boolean canJumpToAddress( long address ); + public boolean canJumpToAddress( IAddress address ); /** * Causes this element to resume the execution at the specified address. * * @exception DebugException on failure. Reasons include: */ - public void jumpToAddress( long address ) throws DebugException; + public void jumpToAddress( IAddress address ) throws DebugException; } \ No newline at end of file diff -NaurbB workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/model/IRunToAddress.java workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/model/IRunToAddress.java --- workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/model/IRunToAddress.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/core/model/IRunToAddress.java 2004-09-16 14:45:00.000000000 +0400 @@ -10,6 +10,7 @@ ***********************************************************************/ package org.eclipse.cdt.debug.core.model; +import org.eclipse.cdt.core.IAddress; import org.eclipse.debug.core.DebugException; /** @@ -22,12 +23,12 @@ * * @return whether this operation is currently available */ - public boolean canRunToAddress( long address ); + public boolean canRunToAddress( IAddress address ); /** * Causes this element to run to specified address. * * @exception DebugException on failure. Reasons include: */ - public void runToAddress( long address, boolean skipBreakpoints ) throws DebugException; + public void runToAddress( IAddress address, boolean skipBreakpoints ) throws DebugException; } \ No newline at end of file diff -NaurbB workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/breakpoints/CAddressBreakpoint.java workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/breakpoints/CAddressBreakpoint.java --- workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/breakpoints/CAddressBreakpoint.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/breakpoints/CAddressBreakpoint.java 2004-09-16 14:45:00.000000000 +0400 @@ -10,13 +10,12 @@ ***********************************************************************/ package org.eclipse.cdt.debug.internal.core.breakpoints; -import java.text.MessageFormat; import java.util.Map; import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint; -import org.eclipse.cdt.debug.internal.core.CDebugUtils; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; +import org.eclipse.osgi.framework.msg.MessageFormat; /** * A breakpoint that suspend the execution when a particular address is reached. @@ -58,8 +57,7 @@ sb.append( name ); } try { - long address = Long.parseLong( getAddress() ); - sb.append( MessageFormat.format( BreakpointMessages.getString( "CAddressBreakpoint.2" ), new String[] { CDebugUtils.toHexAddressString( address ) } ) ); //$NON-NLS-1$ + sb.append( MessageFormat.format( BreakpointMessages.getString( "CAddressBreakpoint.2" ), new String[] { getAddress() } ) ); //$NON-NLS-1$ } catch( NumberFormatException e ) { } diff -NaurbB workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java --- workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java 2004-09-16 14:45:00.000000000 +0400 @@ -15,6 +15,8 @@ import java.util.HashMap; import java.util.Map; import java.util.Set; + +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.CDIDebugModel; import org.eclipse.cdt.debug.core.CDebugCorePlugin; import org.eclipse.cdt.debug.core.CDebugUtils; @@ -256,7 +258,7 @@ return getBreakpointMap().getCBreakpoint( cdiBreakpoint ); } - public long getBreakpointAddress( ICBreakpoint breakpoint ) { + public IAddress getBreakpointAddress( ICBreakpoint breakpoint ) { if ( breakpoint != null ) { ICDIBreakpoint cdiBreakpoint = getBreakpointMap().getCDIBreakpoint( breakpoint ); if ( cdiBreakpoint instanceof ICDILocationBreakpoint ) { @@ -269,7 +271,7 @@ } } } - return 0; + return fDebugTarget.getAddressFactory().getZero(); } public void setBreakpoint( ICBreakpoint breakpoint ) throws DebugException { @@ -493,7 +495,7 @@ private ICDIBreakpoint setAddressBreakpoint( ICAddressBreakpoint breakpoint ) throws CDIException, CoreException, NumberFormatException { ICDITarget cdiTarget = getCDITarget(); - ICDILocation location = cdiTarget.createLocation( Long.parseLong( breakpoint.getAddress() ) ); + ICDILocation location = cdiTarget.createLocation( getDebugTarget().getAddressFactory().createAddress(breakpoint.getAddress())); ICDIBreakpoint cdiBreakpoint = null; synchronized ( getBreakpointMap() ) { cdiBreakpoint = cdiTarget.setLocationBreakpoint( ICDIBreakpoint.REGULAR, location, null, null, true ); @@ -563,7 +565,7 @@ else if ( !isEmpty( cdiBreakpoint.getLocation().getFunction() ) ) { breakpoint = createFunctionBreakpoint( cdiBreakpoint ); } - else if ( cdiBreakpoint.getLocation().getAddress() > 0 ) { + else if ( ! cdiBreakpoint.getLocation().getAddress().isZero() ) { breakpoint = createAddressBreakpoint( cdiBreakpoint ); } } @@ -571,7 +573,7 @@ else if ( !isEmpty( cdiBreakpoint.getLocation().getFunction() ) ) { breakpoint = createFunctionBreakpoint( cdiBreakpoint ); } - else if ( cdiBreakpoint.getLocation().getAddress() > 0 ) { + else if ( ! cdiBreakpoint.getLocation().getAddress().isZero()) { breakpoint = createAddressBreakpoint( cdiBreakpoint ); } } diff -NaurbB workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/model/AsmInstruction.java workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/model/AsmInstruction.java --- workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/model/AsmInstruction.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/model/AsmInstruction.java 2004-09-16 14:45:00.000000000 +0400 @@ -10,6 +10,7 @@ ***********************************************************************/ package org.eclipse.cdt.debug.internal.core.model; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction; import org.eclipse.cdt.debug.core.model.IAsmInstruction; @@ -30,7 +31,7 @@ /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.model.IAsmInstruction#getAdress() */ - public long getAdress() { + public IAddress getAdress() { return fCDIInstruction.getAdress(); } diff -NaurbB workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java --- workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java 2004-09-16 14:45:00.000000000 +0400 @@ -15,7 +15,10 @@ import java.util.Iterator; import java.util.List; import java.util.StringTokenizer; + import org.eclipse.cdt.core.CCorePlugin; +import org.eclipse.cdt.core.IAddress; +import org.eclipse.cdt.core.IAddressFactory; import org.eclipse.cdt.core.model.CModelException; import org.eclipse.cdt.core.model.CoreModel; import org.eclipse.cdt.core.model.IBinary; @@ -205,6 +208,8 @@ */ private Preferences fPreferences = null; + private IAddressFactory fAddressFactory; + /** * Constructor for CDebugTarget. */ @@ -754,7 +759,8 @@ * @see org.eclipse.debug.core.model.IMemoryBlockRetrieval#getMemoryBlock(long, long) */ public IMemoryBlock getMemoryBlock( long startAddress, long length ) throws DebugException { - return null; + //IPF_TODO look into implementation + throw new RuntimeException("Method getMemoryBlock should not be called from CDT"); } /* (non-Javadoc) @@ -1521,7 +1527,7 @@ /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.model.IRunToAddress#canRunToAddress(long) */ - public boolean canRunToAddress( long address ) { + public boolean canRunToAddress( IAddress address ) { // for now return canResume(); } @@ -1529,7 +1535,7 @@ /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.model.IRunToAddress#runToAddress(long, boolean) */ - public void runToAddress( long address, boolean skipBreakpoints ) throws DebugException { + public void runToAddress( IAddress address, boolean skipBreakpoints ) throws DebugException { if ( !canRunToAddress( address ) ) return; if ( skipBreakpoints ) { @@ -1625,7 +1631,7 @@ /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.model.IJumpToAddress#canJumpToAddress(long) */ - public boolean canJumpToAddress( long address ) { + public boolean canJumpToAddress( IAddress address ) { // check if supports jump to address return canResume(); } @@ -1633,7 +1639,7 @@ /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.model.IJumpToAddress#jumpToAddress(long) */ - public void jumpToAddress( long address ) throws DebugException { + public void jumpToAddress( IAddress address ) throws DebugException { if ( !canJumpToAddress( address ) ) return; ICDILocation location = getCDITarget().createLocation( address ); @@ -1783,8 +1789,8 @@ /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.model.IBreakpointTarget#getBreakpointAddress(org.eclipse.cdt.debug.core.model.ICLineBreakpoint) */ - public long getBreakpointAddress( ICLineBreakpoint breakpoint ) throws DebugException { - return (getBreakpointManager() != null) ? getBreakpointManager().getBreakpointAddress( breakpoint ) : 0; + public IAddress getBreakpointAddress( ICLineBreakpoint breakpoint ) throws DebugException { + return (getBreakpointManager() != null) ? getBreakpointManager().getBreakpointAddress( breakpoint ) : getAddressFactory().getZero(); } /* (non-Javadoc) @@ -1861,4 +1867,19 @@ public boolean isPostMortem() { return false; } + public IAddressFactory getAddressFactory() + { + if ( fAddressFactory == null ) + { + if ( getExecFile() != null && CoreModel.getDefault().isBinary( getExecFile() ) ) + { + ICElement cFile = CCorePlugin.getDefault().getCoreModel().create( getExecFile() ); + if ( cFile instanceof IBinary ) + { + fAddressFactory = ((IBinary)cFile).getAddressFactory(); + } + } + } + return fAddressFactory; + } } \ No newline at end of file diff -NaurbB workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/model/CFormattedMemoryBlock.java workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/model/CFormattedMemoryBlock.java --- workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/model/CFormattedMemoryBlock.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/model/CFormattedMemoryBlock.java 2004-09-16 14:45:00.000000000 +0400 @@ -10,9 +10,11 @@ *******************************************************************************/ package org.eclipse.cdt.debug.internal.core.model; +import java.math.BigInteger; import java.util.ArrayList; import java.util.List; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.CDebugCorePlugin; import org.eclipse.cdt.debug.core.CDebugUtils; import org.eclipse.cdt.debug.core.cdi.CDIException; @@ -43,14 +45,14 @@ { class CFormattedMemoryBlockRow implements IFormattedMemoryBlockRow { - private long fAddress; + private IAddress fAddress; private String[] fData; private String fAscii; /** * Constructor for CFormattedMemoryBlockRow. */ - public CFormattedMemoryBlockRow( long address, String[] data, String ascii ) + public CFormattedMemoryBlockRow( IAddress address, String[] data, String ascii ) { fAddress = address; fData = data; @@ -60,7 +62,7 @@ /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlockRow#getAddress() */ - public long getAddress() + public IAddress getAddress() { return fAddress; } @@ -92,7 +94,7 @@ private boolean fDisplayAscii = true; private char fPaddingChar = '.'; private List fRows = null; - private Long[] fChangedAddresses = new Long[0]; + private IAddress[] fChangedAddresses = new IAddress[0]; private boolean fStartAddressChanged = false; /** @@ -219,33 +221,33 @@ /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#nextRowAddress() */ - public long nextRowAddress() + public IAddress nextRowAddress() { - return 0; + return ((CDebugTarget)getDebugTarget()).getAddressFactory().getZero(); } /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#previousRowAddress() */ - public long previousRowAddress() + public IAddress previousRowAddress() { - return 0; + return ((CDebugTarget)getDebugTarget()).getAddressFactory().getZero(); } /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#nextPageAddress() */ - public long nextPageAddress() + public IAddress nextPageAddress() { - return 0; + return ((CDebugTarget)getDebugTarget()).getAddressFactory().getZero(); } /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.IFormattedMemoryBlock#previousPageAddress() */ - public long previousPageAddress() + public IAddress previousPageAddress() { - return 0; + return ((CDebugTarget)getDebugTarget()).getAddressFactory().getZero(); } /* (non-Javadoc) @@ -285,13 +287,18 @@ */ public long getStartAddress() { + //IPF_TODO look into implementation + throw new RuntimeException("Method IMemoryBlock.getStartAddress shoud not be called in CDT debug"); + } + + public IAddress getRealStartAddress() + { if ( fCDIMemoryBlock != null ) { return fCDIMemoryBlock.getStartAddress(); } - return 0; + return ((CDebugTarget)getDebugTarget()).getAddressFactory().getZero(); } - /* (non-Javadoc) * @see org.eclipse.debug.core.model.IMemoryBlock#getLength() */ @@ -510,19 +517,19 @@ fireTerminateEvent(); } - public Long[] getChangedAddresses() + public IAddress[] getChangedAddresses() { return fChangedAddresses; } - protected void setChangedAddresses( Long[] changedAddresses ) + protected void setChangedAddresses( IAddress[] changedAddresses ) { fChangedAddresses = changedAddresses; } protected void resetChangedAddresses() { - fChangedAddresses = new Long[0]; + fChangedAddresses = new IAddress[0]; } /** @@ -679,12 +686,13 @@ return fStartAddressChanged; } - private long getRowAddress( int offset ) + private IAddress getRowAddress(int offset ) { - long result = getStartAddress() + offset; - if ( result > 0xFFFFFFFFL ) + IAddress result = getRealStartAddress().add(BigInteger.valueOf(offset)); + IAddress max = ((CDebugTarget)getDebugTarget()).getAddressFactory().getMax(); + if ( result.compareTo(max) > 0 ) { - result -= 0xFFFFFFFFL; + result = result.add(result.getMaxOffset().negate()); } return result; } diff -NaurbB workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/model/CSharedLibrary.java workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/model/CSharedLibrary.java --- workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/model/CSharedLibrary.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/model/CSharedLibrary.java 2004-09-16 14:45:00.000000000 +0400 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.cdt.debug.internal.core.model; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent; import org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener; @@ -52,21 +53,21 @@ /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.model.ICSharedLibrary#getStartAddress() */ - public long getStartAddress() + public IAddress getStartAddress() { if ( getCDISharedLibrary() != null ) return getCDISharedLibrary().getStartAddress(); - return 0; + return ((CDebugTarget)getDebugTarget()).getAddressFactory().getZero(); } /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.model.ICSharedLibrary#getEndAddress() */ - public long getEndAddress() + public IAddress getEndAddress() { if ( getCDISharedLibrary() != null ) return getCDISharedLibrary().getEndAddress(); - return 0; + return ((CDebugTarget)getDebugTarget()).getAddressFactory().getZero(); } /* (non-Javadoc) diff -NaurbB workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java --- workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java 2004-09-16 14:45:00.000000000 +0400 @@ -16,6 +16,8 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; + +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.ICDILocation; import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent; @@ -530,7 +532,7 @@ /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.model.ICStackFrame#getAddress() */ - public long getAddress() { + public IAddress getAddress() { return getCDIStackFrame().getLocation().getAddress(); } diff -NaurbB workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/model/CValue.java workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/model/CValue.java --- workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/model/CValue.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/model/CValue.java 2004-09-16 14:45:00.000000000 +0400 @@ -16,6 +16,8 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; + +import org.eclipse.cdt.core.IAddress; 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; @@ -274,12 +276,20 @@ private String getLongValueString( ICDILongValue value ) throws CDIException { CVariableFormat format = getParentVariable().getFormat(); if ( CVariableFormat.NATURAL.equals( format ) || CVariableFormat.DECIMAL.equals( format ) ) { - return (isUnsigned()) ? Long.toString( value.longValue() ) : Integer.toString( value.intValue() ); + if ( isUnsigned() ) { + BigInteger bigValue = new BigInteger( value.getValueString() ); + return bigValue.toString(); + } + return Long.toString( value.longValue() ); } else if ( CVariableFormat.HEXADECIMAL.equals( format ) ) { StringBuffer sb = new StringBuffer( "0x" ); //$NON-NLS-1$ - String stringValue = Long.toHexString( (isUnsigned()) ? value.longValue() : value.intValue() ); - sb.append( (stringValue.length() > 8) ? stringValue.substring( stringValue.length() - 8 ) : stringValue ); + if ( isUnsigned() ) { + BigInteger bigValue = new BigInteger( value.getValueString() ); + sb.append( bigValue.toString( 16 ) ); + } + else + sb.append( Long.toHexString( value.longValue() ) ); return sb.toString(); } return null; @@ -351,33 +361,32 @@ return null; } - private String getPointerValueString( ICDIPointerValue value ) throws CDIException { - long longValue = value.pointerValue(); - CVariableFormat format = getParentVariable().getFormat(); - if ( CVariableFormat.DECIMAL.equals( format ) ) { - return Long.toString( longValue ); - } - else if ( CVariableFormat.NATURAL.equals( format ) || CVariableFormat.HEXADECIMAL.equals( format ) ) { - StringBuffer sb = new StringBuffer( "0x" ); //$NON-NLS-1$ - String stringValue = Long.toHexString( longValue ); - sb.append( (stringValue.length() > 8) ? stringValue.substring( stringValue.length() - 8 ) : stringValue ); - return sb.toString(); - } + private String getPointerValueString( ICDIPointerValue value ) throws CDIException + { + //IPF_TODO Workaround to solve incoorect handling of structures referenced by pointers or references + IAddress address = value.pointerValue(); + if(address == null) return ""; + CVariableFormat format = getParentVariable().getFormat(); + if( CVariableFormat.NATURAL.equals( format ) || + CVariableFormat.HEXADECIMAL.equals( format ) ) + return address.toHexAddressString(); + if( CVariableFormat.DECIMAL.equals( format )) + return address.toString(); return null; } - private String getReferenceValueString( ICDIReferenceValue value ) throws CDIException { - long longValue = value.referenceValue(); - CVariableFormat format = getParentVariable().getFormat(); - if ( CVariableFormat.DECIMAL.equals( format ) ) { - return Long.toString( longValue ); - } - else if ( CVariableFormat.NATURAL.equals( format ) || CVariableFormat.HEXADECIMAL.equals( format ) ) { - StringBuffer sb = new StringBuffer( "0x" ); //$NON-NLS-1$ - String stringValue = Long.toHexString( longValue ); - sb.append( (stringValue.length() > 8) ? stringValue.substring( stringValue.length() - 8 ) : stringValue ); - return sb.toString(); - } + private String getReferenceValueString( ICDIReferenceValue value ) throws CDIException + { + //NOTE: Reference should be displayed identically to address + //IPF_TODO Workaround to solve incoorect handling of structures referenced by pointers or references + IAddress address = value.referenceValue(); + if(address == null) return ""; + CVariableFormat format = getParentVariable().getFormat(); + if( CVariableFormat.NATURAL.equals( format ) || + CVariableFormat.HEXADECIMAL.equals( format ) ) + return address.toHexAddressString(); + if( CVariableFormat.DECIMAL.equals( format )) + return address.toString(); return null; } diff -NaurbB workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/model/DisassemblyBlock.java workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/model/DisassemblyBlock.java --- workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/model/DisassemblyBlock.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/model/DisassemblyBlock.java 2004-09-16 14:45:00.000000000 +0400 @@ -16,6 +16,7 @@ import java.io.IOException; import java.io.LineNumberReader; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction; import org.eclipse.cdt.debug.core.cdi.model.ICDIMixedInstruction; import org.eclipse.cdt.debug.core.model.IAsmInstruction; @@ -39,9 +40,9 @@ private IAsmSourceLine[] fSourceLines; - private long fStartAddress = 0; + private IAddress fStartAddress; - private long fEndAddress = 0; + private IAddress fEndAddress; private boolean fMixedMode = false; @@ -100,8 +101,9 @@ public boolean contains( ICStackFrame frame ) { if ( !getDisassembly().getDebugTarget().equals( frame.getDebugTarget() ) ) return false; - long address = frame.getAddress(); - return (address >= fStartAddress && address <= fEndAddress); + IAddress address = frame.getAddress(); + return ( address.compareTo(fStartAddress) >= 0 && + address.compareTo(fEndAddress) <= 0 ); } /* (non-Javadoc) diff -NaurbB workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/model/Disassembly.java workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/model/Disassembly.java --- workspace-old/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/model/Disassembly.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.core/src-cdtdebugcore/org/eclipse/cdt/debug/internal/core/model/Disassembly.java 2004-09-16 14:45:00.000000000 +0400 @@ -10,8 +10,10 @@ ***********************************************************************/ package org.eclipse.cdt.debug.internal.core.model; +import java.math.BigInteger; import java.util.ArrayList; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.CDebugCorePlugin; import org.eclipse.cdt.debug.core.ICDebugConstants; import org.eclipse.cdt.debug.core.cdi.CDIException; @@ -62,7 +64,7 @@ String fileName = frame.getFile(); int lineNumber = frame.getLineNumber(); ICDIMixedInstruction[] mixedInstrs = new ICDIMixedInstruction[0]; - long address = frame.getAddress(); + IAddress address = frame.getAddress(); if ( fileName != null && fileName.length() > 0 ) { try { mixedInstrs = sm.getMixedInstructions( fileName, @@ -73,19 +75,17 @@ targetRequestFailed( e.getMessage(), e ); } } - if ( mixedInstrs.length == 0 || // Double check if debugger returns correct address range. + if ( mixedInstrs.length == 0 || !containsAddress( mixedInstrs, address ) ) { - if ( address >= 0 ) { try { - ICDIInstruction[] instructions = getFunctionInstructions( sm.getInstructions( address, address + DISASSEMBLY_BLOCK_SIZE ) ); + ICDIInstruction[] instructions = getFunctionInstructions( sm.getInstructions( address, address.add(BigInteger.valueOf(DISASSEMBLY_BLOCK_SIZE)) ) ); return DisassemblyBlock.create( this, instructions ); } catch( CDIException e ) { targetRequestFailed( e.getMessage(), e ); } } - } else { return DisassemblyBlock.create( this, mixedInstrs ); } @@ -94,11 +94,11 @@ return null; } - private boolean containsAddress( ICDIMixedInstruction[] mi, long address ) { + private boolean containsAddress( ICDIMixedInstruction[] mi, IAddress address ) { for( int i = 0; i < mi.length; ++i ) { ICDIInstruction[] instructions = mi[i].getInstructions(); for ( int j = 0; j < instructions.length; ++j ) - if ( instructions[j].getAdress() == address ) + if ( address.equals(instructions[j].getAdress())) return true; } return false; diff -NaurbB workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java --- workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java 2004-09-16 14:45:00.000000000 +0400 @@ -16,6 +16,7 @@ import java.util.List; import java.util.Map; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.ICDICondition; import org.eclipse.cdt.debug.core.cdi.ICDILocation; @@ -649,7 +650,7 @@ /** * @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#createLocation(long) */ - public ICDILocation createLocation(long address) { + public ICDILocation createLocation(IAddress address) { return new Location(address); } diff -NaurbB workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/event/CreatedEvent.java workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/event/CreatedEvent.java --- workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/event/CreatedEvent.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/event/CreatedEvent.java 2004-09-16 14:45:00.000000000 +0400 @@ -95,7 +95,7 @@ MISession miSession = mblock.getMISession(); ICDIMemoryBlock[] blocks = mgr.getMemoryBlocks(miSession); for (int i = 0; i < blocks.length; i++) { - if (blocks[i].getStartAddress() == mblock.getAddress() && + if (blocks[i].getStartAddress().equals(mblock.getAddress()) && blocks[i].getLength() == mblock.getLength()) { source = blocks[i]; break; diff -NaurbB workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/event/MemoryChangedEvent.java workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/event/MemoryChangedEvent.java --- workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/event/MemoryChangedEvent.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/event/MemoryChangedEvent.java 2004-09-16 14:45:00.000000000 +0400 @@ -13,6 +13,7 @@ import java.util.ArrayList; import java.util.List; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.event.ICDIMemoryChangedEvent; import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; import org.eclipse.cdt.debug.mi.core.cdi.Session; @@ -36,16 +37,16 @@ /** * @see org.eclipse.cdt.debug.core.cdi.event.ICDIEvent#getAddresses() */ - public Long[] getAddresses() { + public IAddress[] getAddresses() { /* But only returns the address that are in the block. */ - Long[] longs = miMem.getAddresses(); - List aList = new ArrayList(longs.length); - for (int i = 0; i < longs.length; i++) { - if (source.contains(longs[i])) { - aList.add(longs[i]); + IAddress[] mi_addresses = miMem.getAddresses(); + List aList = new ArrayList(mi_addresses.length); + for (int i = 0; i < mi_addresses.length; i++) { + if (source.contains(mi_addresses[i])) { + aList.add(mi_addresses[i]); } } - return (Long[])aList.toArray(new Long[0]); + return (IAddress[])aList.toArray(new IAddress[0]); } /** diff -NaurbB workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/EventManager.java workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/EventManager.java --- workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/EventManager.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/EventManager.java 2004-09-16 14:45:00.000000000 +0400 @@ -16,6 +16,7 @@ import java.util.Observable; import java.util.Observer; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.ICDIEventManager; import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager; @@ -119,7 +120,7 @@ MemoryManager mgr = (MemoryManager)session.getMemoryManager(); MemoryBlock[] blocks = mgr.getMemoryBlocks(miEvent.getMISession()); MIMemoryChangedEvent miMem = (MIMemoryChangedEvent)miEvent; - Long[] addresses = miMem.getAddresses(); + IAddress[] addresses = miMem.getAddresses(); for (int i = 0; i < blocks.length; i++) { if (blocks[i].contains(addresses) && (! blocks[i].isFrozen() || blocks[i].isDirty())) { diff -NaurbB workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/Location.java workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/Location.java --- workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/Location.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/Location.java 2004-09-16 14:45:00.000000000 +0400 @@ -10,22 +10,23 @@ *******************************************************************************/ package org.eclipse.cdt.debug.mi.core.cdi; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.ICDILocation; /** */ public class Location implements ICDILocation { - long addr; + IAddress addr; String file = ""; //$NON-NLS-1$ String function = ""; //$NON-NLS-1$ int line; public Location(String f, String fnct, int l) { - this(f, fnct, l, 0); + this(f, fnct, l, null); } - public Location(String f, String fnct, int l, long a) { + public Location(String f, String fnct, int l, IAddress a) { if (f != null) file = f; if (fnct != null) @@ -34,14 +35,14 @@ addr = a; } - public Location(long address) { + public Location(IAddress address) { addr = address; } /** * @see org.eclipse.cdt.debug.core.cdi.ICDILocation#getAddress() */ - public long getAddress() { + public IAddress getAddress() { return addr; } @@ -86,9 +87,9 @@ } } } - long oaddr = location.getAddress(); - if (addr != 0 && oaddr != 0) { - if (addr == oaddr) { + IAddress oaddr = location.getAddress(); + if (addr != null && oaddr != null) { //IPF_TODO: check ZERO addresses + if (addr.equals(oaddr)) { return true; } } diff -NaurbB workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/MemoryManager.java workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/MemoryManager.java --- workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/MemoryManager.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/MemoryManager.java 2004-09-16 14:45:00.000000000 +0400 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.cdt.debug.mi.core.cdi; +import java.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -17,6 +18,7 @@ import java.util.List; import java.util.Map; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.ICDIMemoryManager; import org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock; @@ -100,12 +102,12 @@ /** * update one Block. */ - public Long[] update(MemoryBlock block, List aList) throws CDIException { + public IAddress[] update(MemoryBlock block, List aList) throws CDIException { Target target = (Target)block.getTarget(); MISession miSession = target.getMISession(); MemoryBlock newBlock = cloneBlock(block); boolean newAddress = ( newBlock.getStartAddress() != block.getStartAddress() ); - Long[] array = compareBlocks(block, newBlock); + IAddress[] array = compareBlocks(block, newBlock); // Update the block MIDataReadMemoryInfo. block.setMIDataReadMemoryInfo(newBlock.getMIDataReadMemoryInfo()); if (array.length > 0 || newAddress) { @@ -126,21 +128,23 @@ * oldBlock.getLength() == newBlock.getLength(); * @return Long[] array of modified addresses. */ - Long[] compareBlocks (MemoryBlock oldBlock, MemoryBlock newBlock) throws CDIException { + IAddress[] compareBlocks (MemoryBlock oldBlock, MemoryBlock newBlock) throws CDIException { byte[] oldBytes = oldBlock.getBytes(); byte[] newBytes = newBlock.getBytes(); List aList = new ArrayList(newBytes.length); - long diff = newBlock.getStartAddress() - oldBlock.getStartAddress(); - if ( Math.abs( diff ) < newBytes.length ) { + BigInteger distance = newBlock.getStartAddress().distance(oldBlock.getStartAddress()); + //IPF_TODO enshure it is OK here + int diff = distance.intValue(); + if ( Math.abs(diff) < newBytes.length) { for (int i = 0; i < newBytes.length; i++) { - if (i + (int)diff < oldBytes.length && i + (int)diff >= 0) { - if (oldBytes[i + (int)diff] != newBytes[i]) { - aList.add(new Long(newBlock.getStartAddress() + i)); + if (i + diff < oldBytes.length && i + diff >= 0) { + if (oldBytes[i + diff] != newBytes[i]) { + aList.add(newBlock.getStartAddress().add(BigInteger.valueOf(i))); } } } } - return (Long[])aList.toArray(new Long[0]); + return (IAddress[])aList.toArray(new IAddress[0]); } /** @@ -176,10 +180,9 @@ /** * @see org.eclipse.cdt.debug.core.cdi.ICDIMemoryManager#createMemoryBlock(long, int) */ - public ICDIMemoryBlock createMemoryBlock(long address, int length) + public ICDIMemoryBlock createMemoryBlock(IAddress address, int length) throws CDIException { - String addr = "0x" + Long.toHexString(address); //$NON-NLS-1$ - return createMemoryBlock(addr, length); + return createMemoryBlock(address.toHexAddressString(), length); } /** diff -NaurbB workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/Breakpoint.java workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/Breakpoint.java --- workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/Breakpoint.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/Breakpoint.java 2004-09-16 14:45:00.000000000 +0400 @@ -153,7 +153,7 @@ fLocation = new Location (miBreakpoint.getFile(), miBreakpoint.getFunction(), miBreakpoint.getLine(), - miBreakpoint.getAddress()); + ((Target)getTarget()).getAddressFactory().createAddress(miBreakpoint.getAddress())); } } return fLocation; diff -NaurbB workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/Instruction.java workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/Instruction.java --- workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/Instruction.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/Instruction.java 2004-09-16 14:45:00.000000000 +0400 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.cdt.debug.mi.core.cdi.model; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction; import org.eclipse.cdt.debug.mi.core.output.MIAsm; @@ -26,8 +27,8 @@ /** * @see org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction#getAdress() */ - public long getAdress() { - return asm.getAddress(); + public IAddress getAdress() { + return ((Target)getTarget()).getAddressFactory().createAddress(asm.getAddress()); } /** diff -NaurbB workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/MemoryBlock.java workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/MemoryBlock.java --- workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/MemoryBlock.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/MemoryBlock.java 2004-09-16 14:45:00.000000000 +0400 @@ -11,9 +11,11 @@ package org.eclipse.cdt.debug.mi.core.cdi.model; +import java.math.BigInteger; import java.util.ArrayList; import java.util.List; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock; import org.eclipse.cdt.debug.mi.core.MIException; @@ -68,7 +70,7 @@ /** * @return true if any address in the array is within the block. */ - public boolean contains(Long[] adds) { + public boolean contains(IAddress[] adds) { for (int i = 0; i < adds.length; i++) { if (contains(adds[i])) { return true; @@ -80,10 +82,12 @@ /** * @return true if the address is within the block. */ - public boolean contains(Long addr) { - long start = getStartAddress(); + public boolean contains(IAddress addr) { + IAddress start = getStartAddress(); long length = getLength(); - if (start <= addr.longValue() && addr.longValue() <= start + length) { + if ( start.compareTo(addr) <= 0 && + addr.compareTo(start.add(BigInteger.valueOf(length))) <= 0 ) + { return true; } return false; @@ -130,7 +134,7 @@ Target target = (Target)getTarget(); MemoryManager mgr = (MemoryManager)target.getSession().getMemoryManager(); setDirty(true); - Long[] addresses = mgr.update(this, null); + IAddress[] addresses = mgr.update(this, null); // Check if this affects other blocks. if (addresses.length > 0) { MemoryBlock[] blocks = mgr.getMemoryBlocks(target.getMISession()); @@ -154,8 +158,8 @@ /** * @see org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock#getStartAddress() */ - public long getStartAddress() { - return mem.getAddress(); + public IAddress getStartAddress() { + return ((Target)getTarget()).getAddressFactory().createAddress(mem.getAddress()); } /** diff -NaurbB workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/SharedLibrary.java workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/SharedLibrary.java --- workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/SharedLibrary.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/SharedLibrary.java 2004-09-16 14:45:00.000000000 +0400 @@ -11,6 +11,7 @@ package org.eclipse.cdt.debug.mi.core.cdi.model; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary; import org.eclipse.cdt.debug.mi.core.cdi.Session; @@ -47,15 +48,15 @@ /** * @see org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary#getStartAddress() */ - public long getStartAddress() { - return miShared.getFrom(); + public IAddress getStartAddress() { + return ((Target)getTarget()).getAddressFactory().createAddress(miShared.getFrom()); } /** * @see org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary#getEndAddress() */ - public long getEndAddress() { - return miShared.getTo(); + public IAddress getEndAddress() { + return ((Target)getTarget()).getAddressFactory().createAddress(miShared.getTo()); } /** diff -NaurbB workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/StackFrame.java workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/StackFrame.java --- workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/StackFrame.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/StackFrame.java 2004-09-16 14:45:00.000000000 +0400 @@ -130,10 +130,12 @@ */ public ICDILocation getLocation() { if (frame != null) { - return new Location(frame.getFile(), frame.getFunction(), - frame.getLine(), frame.getAddress()); + return new Location(frame.getFile(), + frame.getFunction(), + frame.getLine(), + ((Target)getTarget()).getAddressFactory().createAddress(frame.getAddress())); } - return new Location("", "", 0, 0); //$NON-NLS-1$ //$NON-NLS-2$ + return new Location("", "", 0, ((Target)getTarget()).getAddressFactory().getZero()); //$NON-NLS-1$ //$NON-NLS-2$ } /** diff -NaurbB workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java --- workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java 2004-09-16 14:45:00.000000000 +0400 @@ -13,6 +13,8 @@ import java.util.ArrayList; import java.util.List; +import org.eclipse.cdt.core.IAddress; +import org.eclipse.cdt.core.IAddressFactory; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.ICDICondition; import org.eclipse.cdt.debug.core.cdi.ICDILocation; @@ -26,6 +28,7 @@ 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; +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.cdi.Session; @@ -52,7 +55,6 @@ import org.eclipse.cdt.debug.mi.core.output.MIInfo; import org.eclipse.cdt.debug.mi.core.output.MIInfoThreadsInfo; import org.eclipse.cdt.debug.mi.core.output.MIThreadSelectInfo; -import org.eclipse.cdt.debug.mi.core.cdi.CdiResources; /** */ @@ -63,11 +65,13 @@ Thread[] noThreads = new Thread[0]; Thread[] currentThreads; int currentThreadId; + IAddressFactory addressFactory; - public Target(Session s, MISession mi) { + public Target(Session s, MISession mi, IAddressFactory addrFactory) { session = s; miSession = mi; currentThreads = noThreads; + addressFactory = addrFactory; } public MISession getMISession() { @@ -464,8 +468,8 @@ loc = location.getFile() + ":" + location.getLineNumber(); //$NON-NLS-1$ } else if (location.getFunction() != null && location.getFunction().length() > 0) { loc = location.getFunction(); - } else if (location.getAddress() != 0) { - loc = "*" + location.getAddress(); //$NON-NLS-1$ + } else if ( ! location.getAddress().isZero() ) { + loc = "*" + location.getAddress().toString(); //$NON-NLS-1$ } MIExecUntil until = factory.createMIExecUntil(loc); try { @@ -575,8 +579,8 @@ loc = location.getFile() + ":" + location.getLineNumber(); //$NON-NLS-1$ } else if (location.getFunction() != null && location.getFunction().length() > 0) { loc = location.getFunction(); - } else if (location.getAddress() != 0) { - loc = "*" + location.getAddress(); //$NON-NLS-1$ + } else if (! location.getAddress().isZero()) { + loc = "*" + location.getAddress().toString(); //$NON-NLS-1$ } MIJump jump = factory.createMIJump(loc); try { @@ -742,10 +746,44 @@ /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#createLocation(long) */ - public ICDILocation createLocation(long address) { + public ICDILocation createLocation(IAddress address) { BreakpointManager bMgr = ((Session)getSession()).getBreakpointManager(); return bMgr.createLocation(address); } +/* + private IAddressFactory createAddressFactory() throws CDIException + { + MISession mi = ((Session)getSession()).getMISession(); + CommandFactory cf = mi.getCommandFactory(); + MIGDBShowAddressSize as = cf.createMIGDBShowAddressSize(); + try + { + mi.postCommand(as ); + MIGDBShowAddressSizeInfo info = (MIGDBShowAddressSizeInfo)as.getMIInfo(); + if (info == null) + { + throw new CDIException("Target is not responding"); + } + switch ( info.getAddressSize() ) + { + case 32: + return new Addr32Factory(); + case 64: + return new Addr64Factory(); + default: + throw new CDIException("Undefined address size"); + } + } + catch (MIException e) + { + throw new MI2CDIException(e); + } + } +*/ + public IAddressFactory getAddressFactory() + { + return addressFactory; + } } diff -NaurbB workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/type/PointerValue.java workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/type/PointerValue.java --- workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/type/PointerValue.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/type/PointerValue.java 2004-09-16 14:45:00.000000000 +0400 @@ -11,8 +11,10 @@ package org.eclipse.cdt.debug.mi.core.cdi.model.type; +import org.eclipse.cdt.core.IAddress; 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.Target; import org.eclipse.cdt.debug.mi.core.cdi.model.Variable; /** @@ -29,17 +31,19 @@ /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.cdi.model.type.ICDIPointerValue#pointerValue() */ - public long pointerValue() throws CDIException { - long value = 0; - String valueString = getValueString(); + public IAddress pointerValue() throws CDIException { + String valueString = getValueString().trim(); int space = valueString.indexOf(' '); if (space != -1) { valueString = valueString.substring(0, space).trim(); } - try { - value = Long.decode(valueString).longValue(); - } catch (NumberFormatException e) { + try{ + + return ((Target)getTarget()).getAddressFactory().createAddress(valueString); + } + catch(Exception e) + { + return null; } - return value; } } diff -NaurbB workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/type/ReferenceValue.java workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/type/ReferenceValue.java --- workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/type/ReferenceValue.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/type/ReferenceValue.java 2004-09-16 14:45:00.000000000 +0400 @@ -11,8 +11,10 @@ package org.eclipse.cdt.debug.mi.core.cdi.model.type; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.model.type.ICDIReferenceValue; +import org.eclipse.cdt.debug.mi.core.cdi.model.Target; import org.eclipse.cdt.debug.mi.core.cdi.model.Variable; /** @@ -32,8 +34,7 @@ /* (non-Javadoc) * @see org.eclipse.cdt.debug.core.cdi.model.type.ICDIReferenceValue#referenceValue() */ - public long referenceValue() throws CDIException { - long value = 0; + public IAddress referenceValue() throws CDIException { String valueString = getValueString().trim(); if ( valueString.startsWith("@") ) //$NON-NLS-1$ valueString = valueString.substring( 1 ); @@ -41,10 +42,14 @@ if (space != -1) { valueString = valueString.substring(0, space).trim(); } - try { - value = Long.decode(valueString).longValue(); - } catch (NumberFormatException e) { + try{ + + return ((Target)getTarget()).getAddressFactory().createAddress(valueString); + } + catch(Exception e) + { + return null; } - return value; + } } diff -NaurbB workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/Session.java workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/Session.java --- workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/Session.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/Session.java 2004-09-16 14:45:00.000000000 +0400 @@ -13,6 +13,7 @@ import java.util.Properties; +import org.eclipse.cdt.core.IAddressFactory; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.ICDIConfiguration; import org.eclipse.cdt.debug.core.cdi.ICDIEventManager; @@ -54,19 +55,19 @@ SourceManager sourceManager; ICDIConfiguration configuration; - public Session(MISession miSession, boolean attach) { + public Session(MISession miSession, IAddressFactory addrFactory, boolean attach) { commonSetup(); setConfiguration(new Configuration(miSession, attach)); - Target target = new Target(this, miSession); + Target target = new Target(this, miSession, addrFactory); addTargets(new Target[] { target }, target); } - public Session(MISession miSession) { + public Session(MISession miSession, IAddressFactory addrFactory) { commonSetup(); setConfiguration(new CoreFileConfiguration()); - Target target = new Target(this, miSession); + Target target = new Target(this, miSession, addrFactory); addTargets(new Target[] { target }, target); } diff -NaurbB workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryManager.java workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryManager.java --- workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryManager.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryManager.java 2004-09-16 14:45:00.000000000 +0400 @@ -17,6 +17,7 @@ import java.util.List; import java.util.Map; +import org.eclipse.cdt.core.IAddressFactory; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.ICDIConfiguration; import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager; @@ -145,9 +146,10 @@ } public boolean hasSharedLibChanged(ICDISharedLibrary lib, MIShared miLib) { + IAddressFactory af = ((Target)getSession().getCurrentTarget()).getAddressFactory(); return !miLib.getName().equals(lib.getFileName()) || - miLib.getFrom() != lib.getStartAddress() || - miLib.getTo() != lib.getEndAddress() || + !af.createAddress(miLib.getFrom()).equals(lib.getStartAddress()) || + !af.createAddress(miLib.getTo()).equals(lib.getEndAddress()) || miLib.isRead() != lib.areSymbolsLoaded(); } diff -NaurbB workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java --- workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java 2004-09-16 14:45:00.000000000 +0400 @@ -12,6 +12,7 @@ import java.util.StringTokenizer; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.ICDISourceManager; import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction; @@ -142,16 +143,16 @@ /** * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#getInstructions(long, long) */ - public ICDIInstruction[] getInstructions(long start, long end) throws CDIException { + public ICDIInstruction[] getInstructions(IAddress start, IAddress end) throws CDIException { Target target = (Target)getSession().getCurrentTarget(); return getInstructions(target, start, end); } - public ICDIInstruction[] getInstructions(Target target, long start, long end) throws CDIException { + public ICDIInstruction[] getInstructions(Target target, IAddress start, IAddress end) throws CDIException { MISession mi = target.getMISession(); CommandFactory factory = mi.getCommandFactory(); String hex = "0x"; //$NON-NLS-1$ - String sa = hex + Long.toHexString(start); - String ea = hex + Long.toHexString(end); + String sa = start.toHexAddressString(); + String ea = end.toHexAddressString(); MIDataDisassemble dis = factory.createMIDataDisassemble(sa, ea, false); try { mi.postCommand(dis); @@ -202,16 +203,15 @@ /** * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#getMixedInstructions(long, long) */ - public ICDIMixedInstruction[] getMixedInstructions(long start, long end) throws CDIException { + public ICDIMixedInstruction[] getMixedInstructions(IAddress start, IAddress end) throws CDIException { Target target = (Target)getSession().getCurrentTarget(); return getMixedInstructions(target, start, end); } - public ICDIMixedInstruction[] getMixedInstructions(Target target, long start, long end) throws CDIException { + public ICDIMixedInstruction[] getMixedInstructions(Target target, IAddress start, IAddress end) throws CDIException { MISession mi = target.getMISession(); CommandFactory factory = mi.getCommandFactory(); - String hex = "0x"; //$NON-NLS-1$ - String sa = hex + Long.toHexString(start); - String ea = hex + Long.toHexString(end); + String sa = start.toHexAddressString(); + String ea = end.toHexAddressString(); MIDataDisassemble dis = factory.createMIDataDisassemble(sa, ea, true); try { mi.postCommand(dis); diff -NaurbB workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/command/CommandFactory.java workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/command/CommandFactory.java --- workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/command/CommandFactory.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/command/CommandFactory.java 2004-09-16 14:45:00.000000000 +0400 @@ -222,6 +222,10 @@ return new MIGDBShowSolibSearchPath(); } + public MIGDBShowAddressSize createMIGDBShowAddressSize() { + return new MIGDBShowAddressSize(); + } + public MIStackInfoDepth createMIStackInfoDepth() { return new MIStackInfoDepth(); } diff -NaurbB workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/command/MIGDBShowAddressSize.java workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/command/MIGDBShowAddressSize.java --- workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/command/MIGDBShowAddressSize.java 1970-01-01 03:00:00.000000000 +0300 +++ workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/command/MIGDBShowAddressSize.java 2004-09-16 14:45:00.000000000 +0400 @@ -0,0 +1,38 @@ +/* + * Created on Jun 4, 2004 + * + * To change the template for this generated file go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +package org.eclipse.cdt.debug.mi.core.command; + +import org.eclipse.cdt.debug.mi.core.MIException; +import org.eclipse.cdt.debug.mi.core.output.MIGDBShowAddressSizeInfo; +import org.eclipse.cdt.debug.mi.core.output.MIInfo; +import org.eclipse.cdt.debug.mi.core.output.MIOutput; + +/** + * @author root + * + * To change the template for this generated type comment go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +public class MIGDBShowAddressSize extends MIGDBShow { + + public MIGDBShowAddressSize () { + super(new String[] { "remoteaddresssize" }); + } + + public MIInfo getMIInfo() throws MIException { + MIGDBShowAddressSizeInfo info = null; + MIOutput out = getMIOutput(); + if (out != null) { + info = new MIGDBShowAddressSizeInfo(out); + if (info.isError()) { + throwMIException(info, out); + } + } + return info; + } + +} diff -NaurbB workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/event/MIMemoryChangedEvent.java workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/event/MIMemoryChangedEvent.java --- workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/event/MIMemoryChangedEvent.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/event/MIMemoryChangedEvent.java 2004-09-16 14:45:00.000000000 +0400 @@ -12,7 +12,7 @@ import org.eclipse.cdt.debug.mi.core.MISession; - +import org.eclipse.cdt.core.IAddress; /** * This can not be detected yet by gdb/mi. @@ -20,18 +20,18 @@ */ public class MIMemoryChangedEvent extends MIChangedEvent { - Long[] addresses; + IAddress[] addresses; - public MIMemoryChangedEvent(MISession source, Long[] addrs) { + public MIMemoryChangedEvent(MISession source, IAddress[] addrs) { this(source, 0, addrs); } - public MIMemoryChangedEvent(MISession source, int token, Long[] addrs) { + public MIMemoryChangedEvent(MISession source, int token, IAddress[] addrs) { super(source, token); addresses = addrs; } - public Long[] getAddresses() { + public IAddress[] getAddresses() { return addresses; } } diff -NaurbB workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/event/MIMemoryCreatedEvent.java workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/event/MIMemoryCreatedEvent.java --- workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/event/MIMemoryCreatedEvent.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/event/MIMemoryCreatedEvent.java 2004-09-16 14:45:00.000000000 +0400 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.cdt.debug.mi.core.event; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.mi.core.MISession; @@ -20,20 +21,20 @@ */ public class MIMemoryCreatedEvent extends MICreatedEvent { - long address; + IAddress address; long totalBytes; - public MIMemoryCreatedEvent(MISession source, long addr, long total) { + public MIMemoryCreatedEvent(MISession source, IAddress addr, long total) { this(source, 0, addr, total); } - public MIMemoryCreatedEvent(MISession source, int token, long addr, long total) { + public MIMemoryCreatedEvent(MISession source, int token, IAddress addr, long total) { super(source, token); address = addr; totalBytes = total; } - public long getAddress() { + public IAddress getAddress() { return address; } diff -NaurbB workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/GDBDebugger.java workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/GDBDebugger.java --- workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/GDBDebugger.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/GDBDebugger.java 2004-09-16 14:45:00.000000000 +0400 @@ -73,7 +73,7 @@ String gdb = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb"); //$NON-NLS-1$ File cwd = exe.getProject().getLocation().toFile(); String gdbinit = config.getAttribute(IMILaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit"); //$NON-NLS-1$ - session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), cwd, gdbinit); + session = (Session)MIPlugin.getDefault().createCSession(gdb, exe, cwd, gdbinit); initializeLibraries(config, session); return session; } catch (IOException e) { @@ -105,7 +105,7 @@ String gdb = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb"); //$NON-NLS-1$ File cwd = exe.getProject().getLocation().toFile(); String gdbinit = config.getAttribute(IMILaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit"); //$NON-NLS-1$ - session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), pid, null, cwd, gdbinit); + session = (Session)MIPlugin.getDefault().createCSession(gdb, exe, pid, null, cwd, gdbinit); initializeLibraries(config, session); return session; } catch (IOException e) { @@ -137,7 +137,7 @@ String gdb = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb"); //$NON-NLS-1$ File cwd = exe.getProject().getLocation().toFile(); String gdbinit = config.getAttribute(IMILaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit"); //$NON-NLS-1$ - session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), corefile.toFile(), cwd, gdbinit); + session = (Session)MIPlugin.getDefault().createCSession(gdb, exe, corefile.toFile(), cwd, gdbinit); initializeLibraries(config, session); return session; } catch (IOException e) { diff -NaurbB workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/GDBServerDebugger.java workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/GDBServerDebugger.java --- workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/GDBServerDebugger.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/GDBServerDebugger.java 2004-09-16 14:45:00.000000000 +0400 @@ -69,7 +69,7 @@ remote += ":"; //$NON-NLS-1$ remote += config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_PORT, "invalid"); //$NON-NLS-1$ String[] args = new String[] {"remote", remote}; //$NON-NLS-1$ - session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), 0, args, cwd, gdbinit); + session = (Session)MIPlugin.getDefault().createCSession(gdb, exe, 0, args, cwd, gdbinit); } else { MIPlugin plugin = MIPlugin.getDefault(); Preferences prefs = plugin.getPluginPreferences(); @@ -77,7 +77,7 @@ String remote = config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_DEV, "invalid"); //$NON-NLS-1$ String remoteBaud = config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_DEV_SPEED, "invalid"); //$NON-NLS-1$ - session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), -1, null, cwd, gdbinit); + session = (Session)MIPlugin.getDefault().createCSession(gdb, exe, -1, null, cwd, gdbinit); ICDITarget[] targets = session.getTargets(); for (int i = 0; i < targets.length; ++i) { Target target = (Target)targets[i]; diff -NaurbB workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/MIPlugin.java workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/MIPlugin.java --- workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/MIPlugin.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/MIPlugin.java 2004-09-16 14:45:00.000000000 +0400 @@ -21,6 +21,10 @@ import java.util.MissingResourceException; import java.util.ResourceBundle; +import org.eclipse.cdt.core.CCorePlugin; +import org.eclipse.cdt.core.IAddressFactory; +import org.eclipse.cdt.core.model.IBinary; +import org.eclipse.cdt.core.model.ICElement; import org.eclipse.cdt.debug.core.cdi.ICDISession; import org.eclipse.cdt.debug.mi.core.cdi.Session; import org.eclipse.cdt.debug.mi.core.command.CLICommand; @@ -30,6 +34,8 @@ import org.eclipse.cdt.debug.mi.core.output.MIInfo; import org.eclipse.cdt.utils.pty.PTY; import org.eclipse.cdt.utils.spawner.ProcessFactory; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.runtime.IPluginDescriptor; import org.eclipse.core.runtime.Plugin; import org.eclipse.core.runtime.Preferences; import org.osgi.framework.BundleContext; @@ -113,7 +119,7 @@ * @return ICDISession * @throws MIException */ - public ICDISession createCSession(String gdb, File program, File cwd, String gdbinit) throws IOException, MIException { + public ICDISession createCSession(String gdb, IFile program, File cwd, String gdbinit) throws IOException, MIException { PTY pty = null; boolean failed = false; @@ -156,7 +162,7 @@ * @return ICDISession * @throws IOException */ - public ICDISession createCSession(String gdb, File program, File cwd, String gdbinit, PTY pty) throws IOException, MIException { + public ICDISession createCSession(String gdb, IFile program, File cwd, String gdbinit, PTY pty) throws IOException, MIException { if (gdb == null || gdb.length() == 0) { gdb = GDB; } @@ -170,13 +176,13 @@ if (program == null) { args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "-q", "-nw", "-tty", pty.getSlaveName(), "-i", "mi1"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ } else { - args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "-q", "-nw", "-tty", pty.getSlaveName(), "-i", "mi1", program.getAbsolutePath()}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ + args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "-q", "-nw", "-tty", pty.getSlaveName(), "-i", "mi1", program.getLocation().toFile().getAbsolutePath()}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ } } else { if (program == null) { args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "-q", "-nw", "-i", "mi1"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ } else { - args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "-q", "-nw", "-i", "mi1", program.getAbsolutePath()}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ + args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "-q", "-nw", "-i", "mi1", program.getLocation().toFile().getAbsolutePath()}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ } } @@ -206,7 +212,7 @@ // If an exception is thrown that means ok // we did not attach to any target. } - return new Session(session, false); + return new Session(session, getAddressFactory(program), false); } /** @@ -216,7 +222,7 @@ * @return ICDISession * @throws IOException */ - public ICDISession createCSession(String gdb, File program, File core, File cwd, String gdbinit) throws IOException, MIException { + public ICDISession createCSession(String gdb, IFile program, File core, File cwd, String gdbinit) throws IOException, MIException { if (gdb == null || gdb.length() == 0) { gdb = GDB; } @@ -229,7 +235,7 @@ if (program == null) { args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "--quiet", "-nw", "-i", "mi1", "-c", core.getAbsolutePath()}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ } else { - args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "--quiet", "-nw", "-i", "mi1", "-c", core.getAbsolutePath(), program.getAbsolutePath()}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ + args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "--quiet", "-nw", "-i", "mi1", "-c", core.getAbsolutePath(), program.getLocation().toFile().getAbsolutePath()}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ } Process pgdb = getGDBProcess(args); MISession session; @@ -239,7 +245,7 @@ pgdb.destroy(); throw e; } - return new Session(session); + return new Session(session, getAddressFactory(program)); } /** @@ -249,7 +255,7 @@ * @return ICDISession * @throws IOException */ - public ICDISession createCSession(String gdb, File program, int pid, String[] targetParams, File cwd, String gdbinit) throws IOException, MIException { + public ICDISession createCSession(String gdb, IFile program, int pid, String[] targetParams, File cwd, String gdbinit) throws IOException, MIException { if (gdb == null || gdb.length() == 0) { gdb = GDB; } @@ -262,7 +268,7 @@ if (program == null) { args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "--quiet", "-nw", "-i", "mi1"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ } else { - args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "--quiet", "-nw", "-i", "mi1", program.getAbsolutePath()}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ + args = new String[] {gdb, "--cd="+cwd.getAbsolutePath(), "--command="+gdbinit, "--quiet", "-nw", "-i", "mi1", program.getLocation().toFile().getAbsolutePath()}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ } Process pgdb = getGDBProcess(args); MISession session; @@ -298,7 +304,7 @@ //@@@ We have to manually set the suspended state when we attach session.getMIInferior().setSuspended(); session.getMIInferior().update(); - return new Session(session, true); + return new Session(session, getAddressFactory(program), true); } /** @@ -423,6 +429,16 @@ getPluginPreferences().setDefault(IMIConstants.PREF_REQUEST_LAUNCH_TIMEOUT, IMIConstants.DEF_REQUEST_LAUNCH_TIMEOUT); } + protected IAddressFactory getAddressFactory(IFile exe) + { + ICElement cFile = CCorePlugin.getDefault().getCoreModel().create( exe ); + if ( cFile instanceof IBinary ) + { + return ((IBinary)cFile).getAddressFactory(); + } + return null; + } + /* (non-Javadoc) * @see org.eclipse.core.runtime.Plugin#shutdown() */ diff -NaurbB workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIAsm.java workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIAsm.java --- workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIAsm.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIAsm.java 2004-09-16 14:45:00.000000000 +0400 @@ -14,7 +14,7 @@ * Represent a GDB Tuple MI assembly response. */ public class MIAsm { - long address; + String address; String function = ""; //$NON-NLS-1$ String opcode = ""; //$NON-NLS-1$ String args = ""; //$NON-NLS-1$ @@ -24,7 +24,7 @@ parse(tuple); } - public long getAddress() { + public String getAddress() { return address; } @@ -43,7 +43,7 @@ public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append('{'); - buffer.append("address=\"" + Long.toHexString(address) +"\""); //$NON-NLS-1$//$NON-NLS-2$ + buffer.append("address=\"" + address +"\""); //$NON-NLS-1$//$NON-NLS-2$ buffer.append(",func-name=\"" + function + "\""); //$NON-NLS-1$//$NON-NLS-2$ buffer.append(",offset=\"").append(offset).append('"'); //$NON-NLS-1$ buffer.append(",inst=\"" + getInstruction() + "\""); //$NON-NLS-1$//$NON-NLS-2$ @@ -64,7 +64,7 @@ if (var.equals("address")) { //$NON-NLS-1$ try { - address = Long.decode(str.trim()).longValue(); + address = str.trim(); } catch (NumberFormatException e) { } } else if (var.equals("func-name")) { //$NON-NLS-1$ diff -NaurbB workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIBreakpoint.java workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIBreakpoint.java --- workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIBreakpoint.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIBreakpoint.java 2004-09-16 14:45:00.000000000 +0400 @@ -54,7 +54,7 @@ String type = ""; //$NON-NLS-1$ String disp = ""; //$NON-NLS-1$ boolean enabled; - long address; + String address; String func = ""; //$NON-NLS-1$ String file = ""; //$NON-NLS-1$ int line; @@ -146,7 +146,7 @@ enabled = e; } - public long getAddress() { + public String getAddress() { return address; } @@ -228,7 +228,7 @@ enabled = str.equals("y"); //$NON-NLS-1$ } else if (var.equals("addr")) { //$NON-NLS-1$ try { - address = Long.decode(str.trim()).longValue(); + address = str.trim(); } catch (NumberFormatException e) { } } else if (var.equals("func")) { //$NON-NLS-1$ diff -NaurbB workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIDataReadMemoryInfo.java workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIDataReadMemoryInfo.java --- workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIDataReadMemoryInfo.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIDataReadMemoryInfo.java 2004-09-16 14:45:00.000000000 +0400 @@ -18,7 +18,7 @@ */ public class MIDataReadMemoryInfo extends MIInfo { - long addr; + String addr; long nextRow; long prevRow; long nextPage; @@ -33,7 +33,7 @@ parse(); } - public long getAddress() { + public String getAddress() { return addr; } @@ -96,7 +96,7 @@ if (var.equals("addr")) { //$NON-NLS-1$ try { - addr = Long.decode(str.trim()).longValue(); + addr = str.trim(); } catch (NumberFormatException e) { } } else if (var.equals("nr-bytes")) { //$NON-NLS-1$ diff -NaurbB workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIFrame.java workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIFrame.java --- workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIFrame.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIFrame.java 2004-09-16 14:45:00.000000000 +0400 @@ -16,7 +16,7 @@ public class MIFrame { int level; - long addr; + String addr; String func = ""; //$NON-NLS-1$ String file = ""; //$NON-NLS-1$ int line; @@ -42,7 +42,7 @@ return line; } - public long getAddress() { + public String getAddress() { return addr; } @@ -53,7 +53,7 @@ public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append("level=\"" + level + "\""); //$NON-NLS-1$//$NON-NLS-2$ - buffer.append(",addr=\"" + Long.toHexString(addr) + "\""); //$NON-NLS-1$//$NON-NLS-2$ + buffer.append(",addr=\"" + addr + "\""); //$NON-NLS-1$//$NON-NLS-2$ buffer.append(",func=\"" + func + "\""); //$NON-NLS-1$//$NON-NLS-2$ buffer.append(",file=\"" + file + "\""); //$NON-NLS-1$//$NON-NLS-2$ buffer.append(",line=\"").append(line).append('"'); //$NON-NLS-1$ @@ -86,7 +86,7 @@ } } else if (var.equals("addr")) { //$NON-NLS-1$ try { - addr = Long.decode(str.trim()).longValue(); + addr = str.trim(); } catch (NumberFormatException e) { } } else if (var.equals("func")) { //$NON-NLS-1$ diff -NaurbB workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIGDBShowAddressSizeInfo.java workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIGDBShowAddressSizeInfo.java --- workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIGDBShowAddressSizeInfo.java 1970-01-01 03:00:00.000000000 +0300 +++ workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIGDBShowAddressSizeInfo.java 2004-09-16 14:45:00.000000000 +0400 @@ -0,0 +1,25 @@ +/* + * Created on Jun 7, 2004 + * + * To change the template for this generated file go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +package org.eclipse.cdt.debug.mi.core.output; + +/** + * @author root + * + * To change the template for this generated type comment go to + * Window>Preferences>Java>Code Generation>Code and Comments + */ +public class MIGDBShowAddressSizeInfo extends MIGDBShowInfo { + + public MIGDBShowAddressSizeInfo(MIOutput o) { + super(o); + } + + public int getAddressSize() + { + return Integer.parseInt(getValue()); + } +} diff -NaurbB workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIInfoSharedLibraryInfo.java workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIInfoSharedLibraryInfo.java --- workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIInfoSharedLibraryInfo.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIInfoSharedLibraryInfo.java 2004-09-16 14:45:00.000000000 +0400 @@ -80,8 +80,8 @@ if (str.length() > 0) { // Pass the header int index = -1; - long from = 0; - long to = 0; + String from = ""; + String to = ""; boolean syms = false; String name = ""; //$NON-NLS-1$ @@ -102,16 +102,10 @@ } break; case 2 : // second column is "To" - try { - to = Long.decode(sub).longValue(); - } catch (NumberFormatException e) { - } + to = sub; break; case 3 : // first column is "From" - try { - from = Long.decode(sub).longValue(); - } catch (NumberFormatException e) { - } + from = sub; break; } } @@ -123,8 +117,8 @@ } void parseWinShared(String str, List aList) { - long from = 0; - long to = 0; + String from = ""; + String to = ""; boolean syms = true; int index = str.lastIndexOf(' '); @@ -134,10 +128,7 @@ if (!sub.startsWith("0x")) { //$NON-NLS-1$ sub = "0x" + sub; //$NON-NLS-1$ } - try { - from = Long.decode(sub).longValue(); - } catch (NumberFormatException e) { - } + from = sub; str = str.substring(0, index).trim(); } MIShared s = new MIShared(from, to, syms, str.trim()); diff -NaurbB workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIMemory.java workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIMemory.java --- workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIMemory.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIMemory.java 2004-09-16 14:45:00.000000000 +0400 @@ -14,7 +14,7 @@ * GDB/MI memory parsing. */ public class MIMemory { - long addr; + String addr; long [] data = new long[0]; String ascii = ""; //$NON-NLS-1$ @@ -22,7 +22,7 @@ parse(tuple); } - public long getAddress() { + public String getAddress() { return addr; } @@ -36,7 +36,7 @@ public String toSting() { StringBuffer buffer = new StringBuffer(); - buffer.append("addr=\"" + Long.toHexString(addr) + "\""); //$NON-NLS-1$ //$NON-NLS-2$ + buffer.append("addr=\"" + addr + "\""); //$NON-NLS-1$ //$NON-NLS-2$ buffer.append("data=["); //$NON-NLS-1$ for (int i = 0 ; i < data.length; i++) { if (i != 0) { @@ -63,7 +63,7 @@ if (var.equals("addr")) { //$NON-NLS-1$ try { - addr = Long.decode(str.trim()).longValue(); + addr = str.trim(); } catch (NumberFormatException e) { } } else if (var.equals("data")) { //$NON-NLS-1$ diff -NaurbB workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIShared.java workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIShared.java --- workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIShared.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIShared.java 2004-09-16 14:45:00.000000000 +0400 @@ -16,23 +16,23 @@ */ public class MIShared { - long from; - long to; + String from; + String to; boolean isread; String name; - public MIShared (long start, long end, boolean read, String location) { + public MIShared (String start, String end, boolean read, String location) { from = start; to = end; isread = read; name = location; } - public long getFrom() { + public String getFrom() { return from; } - public long getTo() { + public String getTo() { return to; } diff -NaurbB workspace-old/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/actions/JumpToLineActionDelegate.java workspace/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/actions/JumpToLineActionDelegate.java --- workspace-old/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/actions/JumpToLineActionDelegate.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/actions/JumpToLineActionDelegate.java 2004-09-16 14:45:00.000000000 +0400 @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.cdt.debug.internal.ui.actions; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.core.resources.FileStorage; import org.eclipse.cdt.debug.core.model.IJumpToAddress; import org.eclipse.cdt.debug.core.model.IJumpToLine; @@ -176,7 +177,7 @@ } } - protected void jumpToAddress( long address ) + protected void jumpToAddress( IAddress address ) { IJumpToAddress target = (IJumpToAddress)getDebugTarget().getAdapter( IJumpToAddress.class ); if ( target != null ) diff -NaurbB workspace-old/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineActionDelegate.java workspace/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineActionDelegate.java --- workspace-old/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineActionDelegate.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineActionDelegate.java 2004-09-16 14:45:00.000000000 +0400 @@ -10,6 +10,7 @@ ***********************************************************************/ package org.eclipse.cdt.debug.internal.ui.actions; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.CDIDebugModel; import org.eclipse.cdt.debug.core.model.IJumpToAddress; import org.eclipse.cdt.debug.core.model.IJumpToLine; @@ -247,7 +248,7 @@ } ITextSelection textSelection = (ITextSelection)selection; int lineNumber = textSelection.getStartLine() + 1; - long address = ((DisassemblyEditorInput)input).getAddress( lineNumber ); + IAddress address = ((DisassemblyEditorInput)input).getAddress( lineNumber ); return jumpToAddress.canJumpToAddress( address ); } return false; @@ -287,7 +288,7 @@ else { ITextSelection textSelection = (ITextSelection)selection; int lineNumber = textSelection.getStartLine() + 1; - long address = ((DisassemblyEditorInput)input).getAddress( lineNumber ); + IAddress address = ((DisassemblyEditorInput)input).getAddress( lineNumber ); IJumpToAddress jumpToAddress = (IJumpToAddress)((IAdaptable)debugTarget).getAdapter( IJumpToAddress.class ); if ( jumpToAddress != null ) jumpToAddress.jumpToAddress( address ); diff -NaurbB workspace-old/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/actions/RunToLineAdapter.java workspace/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/actions/RunToLineAdapter.java --- workspace-old/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/actions/RunToLineAdapter.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/actions/RunToLineAdapter.java 2004-09-16 14:45:00.000000000 +0400 @@ -10,6 +10,7 @@ ***********************************************************************/ package org.eclipse.cdt.debug.internal.ui.actions; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.CDIDebugModel; import org.eclipse.cdt.debug.core.model.IRunToAddress; import org.eclipse.cdt.debug.core.model.IRunToLine; @@ -83,7 +84,7 @@ else { ITextSelection textSelection = (ITextSelection)selection; int lineNumber = textSelection.getStartLine() + 1; - long address = ((DisassemblyEditorInput)input).getAddress( lineNumber ); + IAddress address = ((DisassemblyEditorInput)input).getAddress( lineNumber ); if ( target instanceof IAdaptable ) { IRunToAddress runToAddress = (IRunToAddress)((IAdaptable)target).getAdapter( IRunToAddress.class ); if ( runToAddress != null && runToAddress.canRunToAddress( address ) ) { diff -NaurbB workspace-old/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/actions/ToggleBreakpointAdapter.java workspace/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/actions/ToggleBreakpointAdapter.java --- workspace-old/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/actions/ToggleBreakpointAdapter.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/actions/ToggleBreakpointAdapter.java 2004-09-16 14:45:00.000000000 +0400 @@ -10,6 +10,7 @@ ***********************************************************************/ package org.eclipse.cdt.debug.internal.ui.actions; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.core.model.CModelException; import org.eclipse.cdt.core.model.IDeclaration; import org.eclipse.cdt.core.model.IFunction; @@ -110,8 +111,8 @@ errorMessage = ActionMessages.getString( "ToggleBreakpointAdapter.Invalid_line_1" ); //$NON-NLS-1$ } else { - long address = ((DisassemblyEditorInput)input).getAddress( lineNumber ); - if ( address == 0 ) { + IAddress address = ((DisassemblyEditorInput)input).getAddress( lineNumber ); + if ( address == null ) { errorMessage = ActionMessages.getString( "ToggleBreakpointAdapter.Invalid_line_1" ); //$NON-NLS-1$ } else { diff -NaurbB workspace-old/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java workspace/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java --- workspace-old/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java 2004-09-16 14:45:00.000000000 +0400 @@ -24,16 +24,7 @@ */ public class CDebugUIUtils { - static public String toHexAddressString( long address ) - { - String tmp = Long.toHexString( address ); - char[] prefix = new char[10 - tmp.length()]; - prefix[0] = '0'; - prefix[1] = 'x'; - for ( int i = 2; i < prefix.length; ++i ) - prefix[i] = '0'; - return new String( prefix ) + tmp; - } + static public IRegion findWord( IDocument document, int offset ) { diff -NaurbB workspace-old/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/CDTDebugModelPresentation.java workspace/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/CDTDebugModelPresentation.java --- workspace-old/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/CDTDebugModelPresentation.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/CDTDebugModelPresentation.java 2004-09-16 14:45:00.000000000 +0400 @@ -703,9 +703,8 @@ protected StringBuffer appendAddress( ICAddressBreakpoint breakpoint, StringBuffer label ) throws CoreException { try { - long address = Long.parseLong( breakpoint.getAddress() ); label.append( ' ' ); - label.append( MessageFormat.format( CDebugUIMessages.getString( "CDTDebugModelPresentation.27" ), new String[]{ CDebugUtils.toHexAddressString( address ) } ) ); //$NON-NLS-1$ + label.append( MessageFormat.format( CDebugUIMessages.getString( "CDTDebugModelPresentation.27" ), new String[]{ breakpoint.getAddress() } ) ); //$NON-NLS-1$ } catch( NumberFormatException e ) { } diff -NaurbB workspace-old/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/propertypages/CBreakpointPropertyPage.java workspace/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/propertypages/CBreakpointPropertyPage.java --- workspace-old/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/propertypages/CBreakpointPropertyPage.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/propertypages/CBreakpointPropertyPage.java 2004-09-16 14:45:00.000000000 +0400 @@ -13,7 +13,7 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; -import org.eclipse.cdt.debug.core.CDebugUtils; + import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint; import org.eclipse.cdt.debug.core.model.ICBreakpoint; import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint; @@ -293,13 +293,6 @@ ICAddressBreakpoint abrkpt = (ICAddressBreakpoint)breakpoint; addField( createLabelEditor( getFieldEditorParent(), PropertyPageMessages.getString( "CBreakpointPropertyPage.18" ), PropertyPageMessages.getString( "CBreakpointPropertyPage.6" ) ) ); //$NON-NLS-1$//$NON-NLS-2$ String address = PropertyPageMessages.getString( "CBreakpointPropertyPage.4" ); //$NON-NLS-1$ - try { - address = CDebugUtils.toHexAddressString( Long.parseLong( abrkpt.getAddress() ) ); - } - catch( CoreException e ) { - } - catch( NumberFormatException e ) { - } if ( address != null ) { addField( createLabelEditor( getFieldEditorParent(), PropertyPageMessages.getString( "CBreakpointPropertyPage.5" ), address ) ); //$NON-NLS-1$ } diff -NaurbB workspace-old/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/views/disassembly/DisassemblyEditorInput.java workspace/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/views/disassembly/DisassemblyEditorInput.java --- workspace-old/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/views/disassembly/DisassemblyEditorInput.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/views/disassembly/DisassemblyEditorInput.java 2004-09-16 14:45:00.000000000 +0400 @@ -11,6 +11,8 @@ package org.eclipse.cdt.debug.internal.ui.views.disassembly; import java.util.Arrays; + +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.CDIDebugModel; import org.eclipse.cdt.debug.core.model.IAsmInstruction; import org.eclipse.cdt.debug.core.model.IAsmSourceLine; @@ -20,7 +22,6 @@ import org.eclipse.cdt.debug.core.model.ICStackFrame; import org.eclipse.cdt.debug.core.model.IDisassembly; import org.eclipse.cdt.debug.core.model.IDisassemblyBlock; -import org.eclipse.cdt.debug.internal.ui.CDebugUIUtils; import org.eclipse.core.runtime.CoreException; import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.DebugPlugin; @@ -67,7 +68,7 @@ * @param disassembly * @param instructions */ - private DisassemblyEditorInput( IDisassemblyBlock block ) { + private DisassemblyEditorInput( IDisassemblyBlock block) { fBlock = block; createContents(); } @@ -125,7 +126,7 @@ return fContents; } - public int getInstructionLine( long address ) { + public int getInstructionLine( IAddress address ) { if ( fBlock != null ) { IAsmSourceLine[] lines = fBlock.getSourceLines(); int result = 0; @@ -134,13 +135,13 @@ ++result; for ( int j = 0; j < instructions.length; ++j ) { ++result; - if ( instructions[j].getAdress() == address ) { + if ( address.compareTo(instructions[j].getAdress()) == 0) { return result; } } } } - return 0; + return -1; } public int getInstructionLine( ICLineBreakpoint breakpoint ) { @@ -150,8 +151,8 @@ IBreakpointTarget bt = (IBreakpointTarget)dis.getDebugTarget().getAdapter( IBreakpointTarget.class ); if ( bt != null ) { try { - long address = bt.getBreakpointAddress( breakpoint ); - if ( address != 0 ) + IAddress address = bt.getBreakpointAddress( breakpoint ); + if ( ! address.isZero() ) return getInstructionLine( address ); } catch( DebugException e ) { @@ -159,10 +160,10 @@ } } } - return 0; + return -1; } - public long getAddress( int lineNumber ) { + public IAddress getAddress( int lineNumber ) { if ( fBlock != null ) { IAsmSourceLine[] lines = fBlock.getSourceLines(); int current = 0; @@ -176,7 +177,7 @@ current += instructions.length; } } - return 0; + return null; } public String getModuleFile() { @@ -185,10 +186,11 @@ public static DisassemblyEditorInput create( ICStackFrame frame ) throws DebugException { DisassemblyEditorInput input = null; - IDisassembly disassembly = ((ICDebugTarget)frame.getDebugTarget()).getDisassembly(); + ICDebugTarget target = ((ICDebugTarget)frame.getDebugTarget()); + IDisassembly disassembly = target.getDisassembly(); if ( disassembly != null ) { IDisassemblyBlock block = disassembly.getDisassemblyBlock( frame ); - input = new DisassemblyEditorInput( block ); + input = new DisassemblyEditorInput( block); } return input; } @@ -216,7 +218,8 @@ } } } - int instrPos = calculateInstructionPosition( maxFunctionName, maxOffset ); + int instrPos = calculateInstructionPosition( maxFunctionName, maxOffset, + fBlock.getSourceLines()[0].getInstructions()[0].getAdress().getCharsNum()); int argPosition = instrPos + maxOpcodeLength + 1; if ( fBlock.isMixedMode() ) fSourceRegions = new IRegion[mi.length]; @@ -241,7 +244,7 @@ Arrays.fill( spaces, ' ' ); StringBuffer sb = new StringBuffer(); if ( instruction != null ) { - sb.append( CDebugUIUtils.toHexAddressString( instruction.getAdress() ) ); + sb.append( instruction.getAdress().toHexAddressString() ); sb.append( ' ' ); String functionName = instruction.getFunctionName(); if ( functionName != null && functionName.length() > 0 ) { @@ -262,8 +265,9 @@ return sb.toString(); } - private int calculateInstructionPosition( int maxFunctionName, long maxOffset ) { - return (16 + maxFunctionName + Long.toString( maxOffset ).length()); + private int calculateInstructionPosition( int maxFunctionName, long maxOffset, int addressLength ) { + //(Address prefix address representation in chars) + (space) + (<) + (+) + (>) + (:) + (space) + return ( addressLength + 6 + maxFunctionName + Long.toString( maxOffset ).length() ); } private String getSourceLineString( IAsmSourceLine line ) { @@ -282,8 +286,8 @@ return ( fBlock != null ) ? fBlock.getDisassembly() : null; } - public ICLineBreakpoint breakpointExists( long address ) throws CoreException { - Assert.isTrue( address != 0 ); + public ICLineBreakpoint breakpointExists( IAddress address ) throws CoreException { + Assert.isTrue( address != null ); IDisassembly dis = getDisassembly(); if ( dis != null ) { IBreakpointTarget bt = (IBreakpointTarget)dis.getDebugTarget().getAdapter( IBreakpointTarget.class ); @@ -294,7 +298,7 @@ if ( bps[i] instanceof ICLineBreakpoint ) { ICLineBreakpoint b = (ICLineBreakpoint)bps[i]; try { - if ( address == bt.getBreakpointAddress( b ) ) + if ( address.compareTo(bt.getBreakpointAddress( b )) == 0) return b; } catch( NumberFormatException e ) { diff -NaurbB workspace-old/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/views/disassembly/DisassemblyInstructionPointerAnnotation.java workspace/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/views/disassembly/DisassemblyInstructionPointerAnnotation.java --- workspace-old/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/views/disassembly/DisassemblyInstructionPointerAnnotation.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/views/disassembly/DisassemblyInstructionPointerAnnotation.java 2004-09-16 14:45:00.000000000 +0400 @@ -10,6 +10,7 @@ ***********************************************************************/ package org.eclipse.cdt.debug.internal.ui.views.disassembly; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.model.ICDebugTarget; import org.eclipse.cdt.debug.core.model.ICStackFrame; import org.eclipse.cdt.debug.core.model.IDisassembly; @@ -63,8 +64,8 @@ IDisassembly disassembly = getDisassembly( frame ); hashCode = 37*hashCode + (( disassembly != null ) ? disassembly.hashCode() : 0); if ( frame != null ) { - long address = frame.getAddress(); - hashCode = 37*hashCode + (int)(address^(address>>>32)); + IAddress address = frame.getAddress(); + hashCode = 37*hashCode + address.hashCode(); } return hashCode; } diff -NaurbB workspace-old/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryControlArea.java workspace/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryControlArea.java --- workspace-old/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryControlArea.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryControlArea.java 2004-09-16 14:45:00.000000000 +0400 @@ -13,7 +13,6 @@ import org.eclipse.cdt.debug.core.CDebugModel; import org.eclipse.cdt.debug.core.ICMemoryManager; import org.eclipse.cdt.debug.core.model.IFormattedMemoryBlock; -import org.eclipse.cdt.debug.internal.ui.CDebugUIUtils; import org.eclipse.cdt.debug.internal.ui.preferences.ICDebugPreferenceConstants; import org.eclipse.cdt.debug.ui.CDebugUIPlugin; import org.eclipse.debug.core.DebugException; @@ -430,7 +429,7 @@ } } if ( getMemoryBlock() != null ) { - fAddressText.setText( CDebugUIUtils.toHexAddressString( getMemoryBlock().getStartAddress() ) ); + fAddressText.setText( getMemoryBlock().getRealStartAddress().toHexAddressString() ); handleAddressEnter(); } } diff -NaurbB workspace-old/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryPresentation.java workspace/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryPresentation.java --- workspace-old/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryPresentation.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/views/memory/MemoryPresentation.java 2004-09-16 14:45:00.000000000 +0400 @@ -11,15 +11,16 @@ package org.eclipse.cdt.debug.internal.ui.views.memory; +import java.math.BigInteger; import java.util.Arrays; import java.util.LinkedList; import java.util.List; +import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.debug.core.CDebugUtils; import org.eclipse.cdt.debug.core.ICMemoryManager; import org.eclipse.cdt.debug.core.model.IFormattedMemoryBlock; import org.eclipse.cdt.debug.core.model.IFormattedMemoryBlockRow; -import org.eclipse.cdt.debug.internal.ui.CDebugUIUtils; import org.eclipse.debug.core.DebugException; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.widgets.Display; @@ -77,7 +78,7 @@ { int offset = sb.length(); sb.append( getRowText( rows[i] ) ); - fAddressZones.add( new Point( offset, offset + getAddressLength() ) ); + fAddressZones.add( new Point( offset, offset + rows[i].getAddress().getCharsNum() ) ); } return sb.toString(); } @@ -104,7 +105,7 @@ public Point[] getChangedZones() { fChangedZones.clear(); - Long[] changedAddresses = getChangedAddresses(); + IAddress[] changedAddresses = getChangedAddresses(); for ( int i = 0; i < changedAddresses.length; ++i ) { int dataOffset = getDataItemOffsetByAddress( changedAddresses[i] ); @@ -126,7 +127,7 @@ public String getStartAddress() { - return ( fBlock != null ) ? getAddressString( fBlock.getStartAddress() ) : ""; //$NON-NLS-1$ + return ( fBlock != null ) ? fBlock.getRealStartAddress().toHexAddressString() : ""; //$NON-NLS-1$ } public String getAddressExpression() @@ -141,15 +142,10 @@ return new String( chars ); } - private String getAddressString( long address ) - { - return CDebugUIUtils.toHexAddressString( address ); - } - private String getRowText( IFormattedMemoryBlockRow row ) { - StringBuffer result = new StringBuffer( getRowLength() ); - result.append( getAddressString( row.getAddress() ) ); + StringBuffer result = new StringBuffer( getRowLength( ) ); + result.append( row.getAddress().toHexAddressString() ); result.append( getInterval( INTERVAL_BETWEEN_ADDRESS_AND_DATA ) ); String[] items = row.getData(); for ( int i = 0; i < items.length; ++i ) @@ -175,9 +171,9 @@ getDataBytesPerRow() : 0 ) + 1; } - private int getAddressLength() - { - return 10; + + private int getAddressLength() { + return fBlock.getRealStartAddress().getCharsNum(); } private boolean isInAsciiArea( int offset ) @@ -293,12 +289,12 @@ return IFormattedMemoryBlock.MEMORY_FORMAT_HEX; } - private Long[] getChangedAddresses() + private IAddress[] getChangedAddresses() { - return ( getMemoryBlock() != null ) ? getMemoryBlock().getChangedAddresses() : new Long[0]; + return ( getMemoryBlock() != null ) ? getMemoryBlock().getChangedAddresses() : new IAddress[0]; } - private int getDataItemOffsetByAddress( Long address ) + private int getDataItemOffsetByAddress( IAddress address ) { if ( getMemoryBlock() != null ) { @@ -307,15 +303,16 @@ { int wordSize = getMemoryBlock().getWordSize(); int numberOfColumns = getMemoryBlock().getNumberOfColumns(); - if ( address.longValue() >= rows[i].getAddress() && - address.longValue() < rows[i].getAddress() + (wordSize * numberOfColumns) ) + + if( address.compareTo( rows[i].getAddress()) >=0 && + address.compareTo( rows[i].getAddress().add(BigInteger.valueOf(wordSize * numberOfColumns))) <0) { for ( int j = 1; j <= numberOfColumns; ++j ) { - if ( address.longValue() >= rows[i].getAddress() + ((j - 1) * wordSize) && - address.longValue() < rows[i].getAddress() + (j * wordSize) ) + if( address.compareTo( rows[i].getAddress().add(BigInteger.valueOf( (j - 1) * wordSize))) >=0 && + address.compareTo( rows[i].getAddress().add(BigInteger.valueOf( j * wordSize))) <0) { - return (i * getRowLength()) + ((j - 1) * (getDataItemLength() + INTERVAL_BETWEEN_DATA_ITEMS)) + getAddressLength() + INTERVAL_BETWEEN_ADDRESS_AND_DATA; + return (i * getRowLength()) + ((j - 1) * (getDataItemLength() + INTERVAL_BETWEEN_DATA_ITEMS)) + address.getCharsNum() + INTERVAL_BETWEEN_ADDRESS_AND_DATA; } } } @@ -325,7 +322,7 @@ return -1; } - private int getAsciiOffsetByAddress( Long address ) + private int getAsciiOffsetByAddress( IAddress address ) { if ( getMemoryBlock() != null ) { @@ -334,14 +331,16 @@ { IFormattedMemoryBlockRow firstRow = rows[0]; IFormattedMemoryBlockRow lastRow = rows[rows.length - 1]; - if ( address.longValue() >= firstRow.getAddress() && address.longValue() <= lastRow.getAddress() ) + + if (address.compareTo( firstRow.getAddress()) >=0 && address.compareTo( lastRow.getAddress()) <=0) + { - int asciiOffset = (int)(address.longValue() - firstRow.getAddress()); + BigInteger asciiOffset = address.distance( firstRow.getAddress()); int asciiRowlength = getMemoryBlock().getWordSize() * getMemoryBlock().getNumberOfColumns(); - int numberOfRows = asciiOffset / asciiRowlength; - int offsetInRow = asciiOffset % asciiRowlength; + int numberOfRows = asciiOffset.intValue() / asciiRowlength; + int offsetInRow = asciiOffset.intValue() % asciiRowlength; return (numberOfRows * getRowLength()) + - getAddressLength() + INTERVAL_BETWEEN_ADDRESS_AND_DATA + + address.getCharsNum() + INTERVAL_BETWEEN_ADDRESS_AND_DATA + (getDataItemLength() + INTERVAL_BETWEEN_DATA_ITEMS) * getMemoryBlock().getNumberOfColumns() + INTERVAL_BETWEEN_DATA_AND_ASCII + offsetInRow; } @@ -513,13 +512,13 @@ { if ( getMemoryBlock() != null ) { - int index = getDataItemIndex( offset ); + int index = getDataItemIndex(offset ); if ( index != -1 ) { char[] chars = getDataItemChars( index ); if ( isInDataArea( offset ) ) { - int charIndex = getOffsetInDataItem( offset, index ); + int charIndex = getOffsetInDataItem(offset, index ); chars[charIndex] = newChar; } if ( isInAsciiArea( offset ) ) @@ -539,7 +538,7 @@ int index = getDataItemIndex( offset ); if ( index != -1 ) { - String newValue = getNewItemValue( offset, ch ); + String newValue = getNewItemValue(offset, ch ); if ( newValue != null ) { try diff -NaurbB workspace-old/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/views/sharedlibs/SharedLibrariesView.java workspace/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/views/sharedlibs/SharedLibrariesView.java --- workspace-old/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/views/sharedlibs/SharedLibrariesView.java 2004-09-16 11:21:00.000000000 +0400 +++ workspace/org.eclipse.cdt.debug.ui/src-cdtdebugui/org/eclipse/cdt/debug/internal/ui/views/sharedlibs/SharedLibrariesView.java 2004-09-16 14:45:00.000000000 +0400 @@ -13,7 +13,6 @@ import org.eclipse.cdt.debug.core.model.ICDebugTarget; import org.eclipse.cdt.debug.core.model.ICSharedLibrary; import org.eclipse.cdt.debug.internal.ui.CDebugModelPresentation; -import org.eclipse.cdt.debug.internal.ui.CDebugUIUtils; import org.eclipse.cdt.debug.internal.ui.ICDebugHelpContextIds; import org.eclipse.cdt.debug.internal.ui.PixelConverter; import org.eclipse.cdt.debug.internal.ui.views.AbstractDebugEventHandler; @@ -83,11 +82,9 @@ case 2: return ( library.areSymbolsLoaded() ) ? SharedLibrariesMessages.getString( "SharedLibrariesView.Loaded_1" ) : SharedLibrariesMessages.getString( "SharedLibrariesView.Not_loaded_1" ); //$NON-NLS-1$ //$NON-NLS-2$ case 3: - return ( library.getStartAddress() > 0 ) ? - CDebugUIUtils.toHexAddressString( library.getStartAddress() ) : ""; //$NON-NLS-1$ + return library.getStartAddress().toHexAddressString(); //$NON-NLS-1$ case 4: - return ( library.getEndAddress() > 0 ) ? - CDebugUIUtils.toHexAddressString( library.getEndAddress() ) : ""; //$NON-NLS-1$ + return library.getEndAddress().toHexAddressString(); //$NON-NLS-1$ } } return null;