View | Details | Raw Unified | Return to bug 74058 | Differences between
and this patch

Collapse All | Expand All

(-)workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java (-1 / +2 lines)
Lines 16-21 Link Here
16
import java.util.List;
16
import java.util.List;
17
import java.util.Map;
17
import java.util.Map;
18
18
19
import org.eclipse.cdt.core.IAddress;
19
import org.eclipse.cdt.debug.core.cdi.CDIException;
20
import org.eclipse.cdt.debug.core.cdi.CDIException;
20
import org.eclipse.cdt.debug.core.cdi.ICDICondition;
21
import org.eclipse.cdt.debug.core.cdi.ICDICondition;
21
import org.eclipse.cdt.debug.core.cdi.ICDILocation;
22
import org.eclipse.cdt.debug.core.cdi.ICDILocation;
Lines 649-655 Link Here
649
	/**
650
	/**
650
	 * @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#createLocation(long)
651
	 * @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#createLocation(long)
651
	 */
652
	 */
652
	public ICDILocation createLocation(long address) {
653
	public ICDILocation createLocation(IAddress address) {
653
		return new Location(address);
654
		return new Location(address);
654
	}
655
	}
655
656
(-)workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/event/CreatedEvent.java (-1 / +1 lines)
Lines 95-101 Link Here
95
		MISession miSession = mblock.getMISession();
95
		MISession miSession = mblock.getMISession();
96
		ICDIMemoryBlock[] blocks = mgr.getMemoryBlocks(miSession);
96
		ICDIMemoryBlock[] blocks = mgr.getMemoryBlocks(miSession);
97
		for (int i = 0; i < blocks.length; i++) {
97
		for (int i = 0; i < blocks.length; i++) {
98
			if (blocks[i].getStartAddress() == mblock.getAddress() &&
98
			if (blocks[i].getStartAddress().equals(mblock.getAddress()) &&
99
			    blocks[i].getLength() == mblock.getLength()) {
99
			    blocks[i].getLength() == mblock.getLength()) {
100
				source = blocks[i];
100
				source = blocks[i];
101
				break;
101
				break;
(-)workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/event/MemoryChangedEvent.java (-7 / +8 lines)
Lines 13-18 Link Here
13
import java.util.ArrayList;
13
import java.util.ArrayList;
14
import java.util.List;
14
import java.util.List;
15
15
16
import org.eclipse.cdt.core.IAddress;
16
import org.eclipse.cdt.debug.core.cdi.event.ICDIMemoryChangedEvent;
17
import org.eclipse.cdt.debug.core.cdi.event.ICDIMemoryChangedEvent;
17
import org.eclipse.cdt.debug.core.cdi.model.ICDIObject;
18
import org.eclipse.cdt.debug.core.cdi.model.ICDIObject;
18
import org.eclipse.cdt.debug.mi.core.cdi.Session;
19
import org.eclipse.cdt.debug.mi.core.cdi.Session;
Lines 36-51 Link Here
36
	/**
37
	/**
37
	 * @see org.eclipse.cdt.debug.core.cdi.event.ICDIEvent#getAddresses()
38
	 * @see org.eclipse.cdt.debug.core.cdi.event.ICDIEvent#getAddresses()
38
	 */
39
	 */
39
	public Long[] getAddresses() {
40
	public IAddress[] getAddresses() {
40
	 	/* But only returns the address that are in the block.  */
41
	 	/* But only returns the address that are in the block.  */
41
		Long[] longs = miMem.getAddresses();
42
		IAddress[] mi_addresses = miMem.getAddresses();
42
		List aList = new ArrayList(longs.length);
43
		List aList = new ArrayList(mi_addresses.length);
43
		for (int i = 0; i < longs.length; i++) {
44
		for (int i = 0; i < mi_addresses.length; i++) {
44
			if (source.contains(longs[i])) {
45
			if (source.contains(mi_addresses[i])) {
45
				aList.add(longs[i]);
46
				aList.add(mi_addresses[i]);
46
			}
47
			}
47
		}
48
		}
48
		return (Long[])aList.toArray(new Long[0]);
49
		return (IAddress[])aList.toArray(new IAddress[0]);
49
	}
50
	}
50
51
51
	/**
52
	/**
(-)workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/EventManager.java (-1 / +2 lines)
Lines 16-21 Link Here
16
import java.util.Observable;
16
import java.util.Observable;
17
import java.util.Observer;
17
import java.util.Observer;
18
18
19
import org.eclipse.cdt.core.IAddress;
19
import org.eclipse.cdt.debug.core.cdi.CDIException;
20
import org.eclipse.cdt.debug.core.cdi.CDIException;
20
import org.eclipse.cdt.debug.core.cdi.ICDIEventManager;
21
import org.eclipse.cdt.debug.core.cdi.ICDIEventManager;
21
import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager;
22
import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager;
Lines 119-125 Link Here
119
				MemoryManager mgr = (MemoryManager)session.getMemoryManager();
120
				MemoryManager mgr = (MemoryManager)session.getMemoryManager();
120
				MemoryBlock[] blocks = mgr.getMemoryBlocks(miEvent.getMISession());
121
				MemoryBlock[] blocks = mgr.getMemoryBlocks(miEvent.getMISession());
121
				MIMemoryChangedEvent miMem = (MIMemoryChangedEvent)miEvent;
122
				MIMemoryChangedEvent miMem = (MIMemoryChangedEvent)miEvent;
122
				Long[] addresses = miMem.getAddresses();
123
				IAddress[] addresses = miMem.getAddresses();
123
				for (int i = 0; i < blocks.length; i++) {
124
				for (int i = 0; i < blocks.length; i++) {
124
					if (blocks[i].contains(addresses) &&
125
					if (blocks[i].contains(addresses) &&
125
						(! blocks[i].isFrozen() || blocks[i].isDirty())) {
126
						(! blocks[i].isFrozen() || blocks[i].isDirty())) {
(-)workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/Location.java (-8 / +9 lines)
Lines 10-31 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.cdt.debug.mi.core.cdi;
11
package org.eclipse.cdt.debug.mi.core.cdi;
12
12
13
import org.eclipse.cdt.core.IAddress;
13
import org.eclipse.cdt.debug.core.cdi.ICDILocation;
14
import org.eclipse.cdt.debug.core.cdi.ICDILocation;
14
15
15
/**
16
/**
16
 */
17
 */
17
public class Location implements ICDILocation {
18
public class Location implements ICDILocation {
18
19
19
	long addr;
20
	IAddress addr;
20
	String file = ""; //$NON-NLS-1$
21
	String file = ""; //$NON-NLS-1$
21
	String function = ""; //$NON-NLS-1$
22
	String function = ""; //$NON-NLS-1$
22
	int line;
23
	int line;
23
24
24
	public Location(String f, String fnct, int l) {
25
	public Location(String f, String fnct, int l) {
25
		this(f, fnct, l, 0);
26
		this(f, fnct, l, null);
26
	}
27
	}
27
28
28
	public Location(String f, String fnct, int l, long a) {
29
	public Location(String f, String fnct, int l, IAddress a) {
29
		if (f != null)
30
		if (f != null)
30
			file = f;
31
			file = f;
31
		if (fnct != null)
32
		if (fnct != null)
Lines 34-47 Link Here
34
		addr = a;  
35
		addr = a;  
35
	}
36
	}
36
37
37
	public Location(long address) {
38
	public Location(IAddress address) {
38
		addr = address;
39
		addr = address;
39
	}
40
	}
40
41
41
	/**
42
	/**
42
	 * @see org.eclipse.cdt.debug.core.cdi.ICDILocation#getAddress()
43
	 * @see org.eclipse.cdt.debug.core.cdi.ICDILocation#getAddress()
43
	 */
44
	 */
44
	public long getAddress() {
45
	public IAddress getAddress() {
45
		return addr;
46
		return addr;
46
	}
47
	}
47
48
Lines 86-94 Link Here
86
				}
87
				}
87
			}
88
			}
88
		}
89
		}
89
		long oaddr = location.getAddress();
90
		IAddress oaddr = location.getAddress();
90
		if (addr != 0 && oaddr != 0) {
91
		if (addr != null && oaddr != null) { //IPF_TODO: check ZERO addresses
91
			if (addr == oaddr) {
92
			if (addr.equals(oaddr)) {
92
				return true;
93
				return true;
93
			}
94
			}
94
		}
95
		}
(-)workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/MemoryManager.java (-12 / +15 lines)
Lines 10-15 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.cdt.debug.mi.core.cdi;
11
package org.eclipse.cdt.debug.mi.core.cdi;
12
12
13
import java.math.BigInteger;
13
import java.util.ArrayList;
14
import java.util.ArrayList;
14
import java.util.Arrays;
15
import java.util.Arrays;
15
import java.util.Collections;
16
import java.util.Collections;
Lines 17-22 Link Here
17
import java.util.List;
18
import java.util.List;
18
import java.util.Map;
19
import java.util.Map;
19
20
21
import org.eclipse.cdt.core.IAddress;
20
import org.eclipse.cdt.debug.core.cdi.CDIException;
22
import org.eclipse.cdt.debug.core.cdi.CDIException;
21
import org.eclipse.cdt.debug.core.cdi.ICDIMemoryManager;
23
import org.eclipse.cdt.debug.core.cdi.ICDIMemoryManager;
22
import org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock;
24
import org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock;
Lines 100-111 Link Here
100
	/**
102
	/**
101
	 * update one Block.
103
	 * update one Block.
102
	 */
104
	 */
103
	public Long[] update(MemoryBlock block, List aList) throws CDIException {
105
	public IAddress[] update(MemoryBlock block, List aList) throws CDIException {
104
		Target target = (Target)block.getTarget();
106
		Target target = (Target)block.getTarget();
105
		MISession miSession = target.getMISession();
107
		MISession miSession = target.getMISession();
106
		MemoryBlock newBlock = cloneBlock(block);
108
		MemoryBlock newBlock = cloneBlock(block);
107
		boolean newAddress = ( newBlock.getStartAddress() != block.getStartAddress() );
109
		boolean newAddress = ( newBlock.getStartAddress() != block.getStartAddress() );
108
		Long[] array = compareBlocks(block, newBlock);
110
		IAddress[] array = compareBlocks(block, newBlock);
109
		// Update the block MIDataReadMemoryInfo.
111
		// Update the block MIDataReadMemoryInfo.
110
		block.setMIDataReadMemoryInfo(newBlock.getMIDataReadMemoryInfo());
112
		block.setMIDataReadMemoryInfo(newBlock.getMIDataReadMemoryInfo());
111
		if (array.length > 0 || newAddress) {
113
		if (array.length > 0 || newAddress) {
Lines 126-146 Link Here
126
	 * oldBlock.getLength() == newBlock.getLength();
128
	 * oldBlock.getLength() == newBlock.getLength();
127
	 * @return Long[] array of modified addresses.
129
	 * @return Long[] array of modified addresses.
128
	 */
130
	 */
129
	Long[] compareBlocks (MemoryBlock oldBlock, MemoryBlock newBlock) throws CDIException {
131
	IAddress[] compareBlocks (MemoryBlock oldBlock, MemoryBlock newBlock) throws CDIException {
130
		byte[] oldBytes = oldBlock.getBytes();
132
		byte[] oldBytes = oldBlock.getBytes();
131
		byte[] newBytes = newBlock.getBytes();
133
		byte[] newBytes = newBlock.getBytes();
132
		List aList = new ArrayList(newBytes.length);
134
		List aList = new ArrayList(newBytes.length);
133
		long diff = newBlock.getStartAddress() - oldBlock.getStartAddress();
135
		BigInteger distance = newBlock.getStartAddress().distance(oldBlock.getStartAddress());
134
		if ( Math.abs( diff ) < newBytes.length ) {
136
		//IPF_TODO enshure it is OK here
137
		int diff = distance.intValue();
138
		if ( Math.abs(diff) <  newBytes.length) {
135
			for (int i = 0; i < newBytes.length; i++) {
139
			for (int i = 0; i < newBytes.length; i++) {
136
				if (i + (int)diff < oldBytes.length && i + (int)diff >= 0) {
140
				if (i + diff < oldBytes.length && i + diff >= 0) {
137
					if (oldBytes[i + (int)diff] != newBytes[i]) {
141
					if (oldBytes[i + diff] != newBytes[i]) {
138
						aList.add(new Long(newBlock.getStartAddress() + i));
142
						aList.add(newBlock.getStartAddress().add(BigInteger.valueOf(i)));
139
					}
143
					}
140
				}
144
				}
141
			}
145
			}
142
		}
146
		}
143
		return (Long[])aList.toArray(new Long[0]);
147
		return (IAddress[])aList.toArray(new IAddress[0]);
144
	}
148
	}
145
149
146
	/**
150
	/**
Lines 176-185 Link Here
176
	/**
180
	/**
177
	 * @see org.eclipse.cdt.debug.core.cdi.ICDIMemoryManager#createMemoryBlock(long, int)
181
	 * @see org.eclipse.cdt.debug.core.cdi.ICDIMemoryManager#createMemoryBlock(long, int)
178
	 */
182
	 */
179
	public ICDIMemoryBlock createMemoryBlock(long address, int length)
183
	public ICDIMemoryBlock createMemoryBlock(IAddress address, int length)
180
		throws CDIException {
184
		throws CDIException {
181
		String addr = "0x" + Long.toHexString(address); //$NON-NLS-1$
185
		return createMemoryBlock(address.toHexAddressString(), length);
182
		return createMemoryBlock(addr, length);
183
	}
186
	}
184
		
187
		
185
	/**
188
	/**
(-)workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/Breakpoint.java (-1 / +1 lines)
Lines 153-159 Link Here
153
				fLocation = new Location (miBreakpoint.getFile(),
153
				fLocation = new Location (miBreakpoint.getFile(),
154
					miBreakpoint.getFunction(),
154
					miBreakpoint.getFunction(),
155
					miBreakpoint.getLine(),
155
					miBreakpoint.getLine(),
156
					miBreakpoint.getAddress());
156
					((Target)getTarget()).getAddressFactory().createAddress(miBreakpoint.getAddress()));
157
			}
157
			}
158
		}
158
		}
159
		return fLocation;
159
		return fLocation;
(-)workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/Instruction.java (-2 / +3 lines)
Lines 10-15 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.cdt.debug.mi.core.cdi.model;
11
package org.eclipse.cdt.debug.mi.core.cdi.model;
12
12
13
import org.eclipse.cdt.core.IAddress;
13
import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction;
14
import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction;
14
import org.eclipse.cdt.debug.mi.core.output.MIAsm;
15
import org.eclipse.cdt.debug.mi.core.output.MIAsm;
15
16
Lines 26-33 Link Here
26
	/**
27
	/**
27
	 * @see org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction#getAdress()
28
	 * @see org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction#getAdress()
28
	 */
29
	 */
29
	public long getAdress() {
30
	public IAddress getAdress() {
30
		return asm.getAddress();
31
		return ((Target)getTarget()).getAddressFactory().createAddress(asm.getAddress());
31
	}
32
	}
32
33
33
	/**
34
	/**
(-)workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/MemoryBlock.java (-7 / +11 lines)
Lines 11-19 Link Here
11
11
12
package org.eclipse.cdt.debug.mi.core.cdi.model;
12
package org.eclipse.cdt.debug.mi.core.cdi.model;
13
13
14
import java.math.BigInteger;
14
import java.util.ArrayList;
15
import java.util.ArrayList;
15
import java.util.List;
16
import java.util.List;
16
17
18
import org.eclipse.cdt.core.IAddress;
17
import org.eclipse.cdt.debug.core.cdi.CDIException;
19
import org.eclipse.cdt.debug.core.cdi.CDIException;
18
import org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock;
20
import org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock;
19
import org.eclipse.cdt.debug.mi.core.MIException;
21
import org.eclipse.cdt.debug.mi.core.MIException;
Lines 68-74 Link Here
68
	/**
70
	/**
69
	 * @return true if any address in the array is within the block.
71
	 * @return true if any address in the array is within the block.
70
	 */
72
	 */
71
	public boolean contains(Long[] adds) {
73
	public boolean contains(IAddress[] adds) {
72
		for (int i = 0; i < adds.length; i++) {
74
		for (int i = 0; i < adds.length; i++) {
73
			if (contains(adds[i])) {
75
			if (contains(adds[i])) {
74
				return true;
76
				return true;
Lines 80-89 Link Here
80
	/**
82
	/**
81
	 * @return true if the address is within the block.
83
	 * @return true if the address is within the block.
82
	 */
84
	 */
83
	public boolean contains(Long addr) {
85
	public boolean contains(IAddress addr) {
84
		long start = getStartAddress();
86
		IAddress start = getStartAddress();
85
		long length = getLength();
87
		long length = getLength();
86
		if (start <= addr.longValue() && addr.longValue() <= start + length) {
88
		if ( start.compareTo(addr) <= 0 && 
89
		     addr.compareTo(start.add(BigInteger.valueOf(length))) <= 0 ) 
90
		{
87
			return true;
91
			return true;
88
		}
92
		}
89
		return false;
93
		return false;
Lines 130-136 Link Here
130
		Target target = (Target)getTarget();
134
		Target target = (Target)getTarget();
131
		MemoryManager mgr = (MemoryManager)target.getSession().getMemoryManager();
135
		MemoryManager mgr = (MemoryManager)target.getSession().getMemoryManager();
132
		setDirty(true);
136
		setDirty(true);
133
		Long[] addresses = mgr.update(this, null);
137
		IAddress[] addresses = mgr.update(this, null);
134
		// Check if this affects other blocks.
138
		// Check if this affects other blocks.
135
		if (addresses.length > 0) {
139
		if (addresses.length > 0) {
136
			MemoryBlock[] blocks = mgr.getMemoryBlocks(target.getMISession());
140
			MemoryBlock[] blocks = mgr.getMemoryBlocks(target.getMISession());
Lines 154-161 Link Here
154
	/**
158
	/**
155
	 * @see org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock#getStartAddress()
159
	 * @see org.eclipse.cdt.debug.core.cdi.model.ICDIMemoryBlock#getStartAddress()
156
	 */
160
	 */
157
	public long getStartAddress() {
161
	public IAddress getStartAddress() {
158
		return mem.getAddress();
162
		return ((Target)getTarget()).getAddressFactory().createAddress(mem.getAddress());
159
	}
163
	}
160
164
161
	/**
165
	/**
(-)workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/SharedLibrary.java (-4 / +5 lines)
Lines 11-16 Link Here
11
11
12
package org.eclipse.cdt.debug.mi.core.cdi.model;
12
package org.eclipse.cdt.debug.mi.core.cdi.model;
13
13
14
import org.eclipse.cdt.core.IAddress;
14
import org.eclipse.cdt.debug.core.cdi.CDIException;
15
import org.eclipse.cdt.debug.core.cdi.CDIException;
15
import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary;
16
import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary;
16
import org.eclipse.cdt.debug.mi.core.cdi.Session;
17
import org.eclipse.cdt.debug.mi.core.cdi.Session;
Lines 47-61 Link Here
47
	/**
48
	/**
48
	 * @see org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary#getStartAddress()
49
	 * @see org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary#getStartAddress()
49
	 */
50
	 */
50
	public long getStartAddress() {
51
	public IAddress getStartAddress() {
51
		return miShared.getFrom();
52
		return ((Target)getTarget()).getAddressFactory().createAddress(miShared.getFrom());
52
	}
53
	}
53
54
54
	/**
55
	/**
55
	 * @see org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary#getEndAddress()
56
	 * @see org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary#getEndAddress()
56
	 */
57
	 */
57
	public long getEndAddress() {
58
	public IAddress getEndAddress() {
58
		return miShared.getTo();
59
		return ((Target)getTarget()).getAddressFactory().createAddress(miShared.getTo());
59
	}
60
	}
60
61
61
	/**
62
	/**
(-)workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/StackFrame.java (-3 / +5 lines)
Lines 130-139 Link Here
130
	 */
130
	 */
131
	public ICDILocation getLocation() {
131
	public ICDILocation getLocation() {
132
		if (frame != null) {
132
		if (frame != null) {
133
			return new Location(frame.getFile(), frame.getFunction(),
133
			return new Location(frame.getFile(), 
134
					frame.getLine(), frame.getAddress());
134
					            frame.getFunction(),
135
					            frame.getLine(),  
136
								((Target)getTarget()).getAddressFactory().createAddress(frame.getAddress()));
135
		}
137
		}
136
		return new Location("", "", 0, 0); //$NON-NLS-1$ //$NON-NLS-2$
138
		return new Location("", "", 0, ((Target)getTarget()).getAddressFactory().getZero()); //$NON-NLS-1$ //$NON-NLS-2$
137
	}
139
	}
138
140
139
	/**
141
	/**
(-)workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/Target.java (-7 / +45 lines)
Lines 13-18 Link Here
13
import java.util.ArrayList;
13
import java.util.ArrayList;
14
import java.util.List;
14
import java.util.List;
15
15
16
import org.eclipse.cdt.core.IAddress;
17
import org.eclipse.cdt.core.IAddressFactory;
16
import org.eclipse.cdt.debug.core.cdi.CDIException;
18
import org.eclipse.cdt.debug.core.cdi.CDIException;
17
import org.eclipse.cdt.debug.core.cdi.ICDICondition;
19
import org.eclipse.cdt.debug.core.cdi.ICDICondition;
18
import org.eclipse.cdt.debug.core.cdi.ICDILocation;
20
import org.eclipse.cdt.debug.core.cdi.ICDILocation;
Lines 26-31 Link Here
26
import org.eclipse.cdt.debug.mi.core.MIException;
28
import org.eclipse.cdt.debug.mi.core.MIException;
27
import org.eclipse.cdt.debug.mi.core.MISession;
29
import org.eclipse.cdt.debug.mi.core.MISession;
28
import org.eclipse.cdt.debug.mi.core.cdi.BreakpointManager;
30
import org.eclipse.cdt.debug.mi.core.cdi.BreakpointManager;
31
import org.eclipse.cdt.debug.mi.core.cdi.CdiResources;
29
import org.eclipse.cdt.debug.mi.core.cdi.MI2CDIException;
32
import org.eclipse.cdt.debug.mi.core.cdi.MI2CDIException;
30
import org.eclipse.cdt.debug.mi.core.cdi.RegisterManager;
33
import org.eclipse.cdt.debug.mi.core.cdi.RegisterManager;
31
import org.eclipse.cdt.debug.mi.core.cdi.Session;
34
import org.eclipse.cdt.debug.mi.core.cdi.Session;
Lines 52-58 Link Here
52
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
55
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
53
import org.eclipse.cdt.debug.mi.core.output.MIInfoThreadsInfo;
56
import org.eclipse.cdt.debug.mi.core.output.MIInfoThreadsInfo;
54
import org.eclipse.cdt.debug.mi.core.output.MIThreadSelectInfo;
57
import org.eclipse.cdt.debug.mi.core.output.MIThreadSelectInfo;
55
import org.eclipse.cdt.debug.mi.core.cdi.CdiResources;
56
58
57
/**
59
/**
58
 */
60
 */
Lines 63-73 Link Here
63
	Thread[] noThreads = new Thread[0];
65
	Thread[] noThreads = new Thread[0];
64
	Thread[] currentThreads;
66
	Thread[] currentThreads;
65
	int currentThreadId;
67
	int currentThreadId;
68
	IAddressFactory addressFactory;
66
	
69
	
67
	public Target(Session s, MISession mi) {
70
	public Target(Session s, MISession mi, IAddressFactory addrFactory) {
68
		session = s;
71
		session = s;
69
		miSession = mi;
72
		miSession = mi;
70
		currentThreads = noThreads;
73
		currentThreads = noThreads;
74
		addressFactory = addrFactory;
71
	}
75
	}
72
76
73
	public MISession getMISession() {
77
	public MISession getMISession() {
Lines 464-471 Link Here
464
			loc = location.getFile() + ":" + location.getLineNumber(); //$NON-NLS-1$
468
			loc = location.getFile() + ":" + location.getLineNumber(); //$NON-NLS-1$
465
		} else if (location.getFunction() != null && location.getFunction().length() > 0) {
469
		} else if (location.getFunction() != null && location.getFunction().length() > 0) {
466
			loc = location.getFunction();
470
			loc = location.getFunction();
467
		} else if (location.getAddress() != 0) {
471
		} else if ( ! location.getAddress().isZero() ) {
468
			loc = "*" + location.getAddress(); //$NON-NLS-1$
472
			loc = "*" + location.getAddress().toString(); //$NON-NLS-1$
469
		}
473
		}
470
		MIExecUntil until = factory.createMIExecUntil(loc);
474
		MIExecUntil until = factory.createMIExecUntil(loc);
471
		try {
475
		try {
Lines 575-582 Link Here
575
			loc = location.getFile() + ":" + location.getLineNumber(); //$NON-NLS-1$
579
			loc = location.getFile() + ":" + location.getLineNumber(); //$NON-NLS-1$
576
		} else if (location.getFunction() != null && location.getFunction().length() > 0) {
580
		} else if (location.getFunction() != null && location.getFunction().length() > 0) {
577
			loc = location.getFunction();
581
			loc = location.getFunction();
578
		} else if (location.getAddress() != 0) {
582
		} else if (! location.getAddress().isZero()) {
579
			loc = "*" + location.getAddress(); //$NON-NLS-1$
583
			loc = "*" + location.getAddress().toString(); //$NON-NLS-1$
580
		}
584
		}
581
		MIJump jump = factory.createMIJump(loc);
585
		MIJump jump = factory.createMIJump(loc);
582
		try {
586
		try {
Lines 742-751 Link Here
742
	/* (non-Javadoc)
746
	/* (non-Javadoc)
743
	 * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#createLocation(long)
747
	 * @see org.eclipse.cdt.debug.core.cdi.model.ICDITarget#createLocation(long)
744
	 */
748
	 */
745
	public ICDILocation createLocation(long address) {
749
	public ICDILocation createLocation(IAddress address) {
746
		BreakpointManager bMgr = ((Session)getSession()).getBreakpointManager();
750
		BreakpointManager bMgr = ((Session)getSession()).getBreakpointManager();
747
		return bMgr.createLocation(address);
751
		return bMgr.createLocation(address);
748
	}
752
	}
753
/*	
754
	private IAddressFactory createAddressFactory() throws CDIException 
755
	{
756
		MISession mi = ((Session)getSession()).getMISession();
757
		CommandFactory cf = mi.getCommandFactory();
758
		MIGDBShowAddressSize as = cf.createMIGDBShowAddressSize();
759
		try 
760
		{
761
			mi.postCommand(as );
762
			MIGDBShowAddressSizeInfo info = (MIGDBShowAddressSizeInfo)as.getMIInfo();
763
			if (info == null)
764
			{
765
				throw new CDIException("Target is not responding");
766
			}
767
			switch ( info.getAddressSize() )
768
			{
769
				case 32:
770
					return new Addr32Factory();
771
				case 64:
772
					return new Addr64Factory();
773
				default:
774
				    throw new CDIException("Undefined address size");
775
			}
776
		}
777
		catch (MIException e) 
778
		{
779
			throw new MI2CDIException(e);
780
		}
781
	}
782
*/
783
	public IAddressFactory getAddressFactory()
784
	{
785
		return addressFactory;
786
	}
749
787
750
	
788
	
751
}
789
}
(-)workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/type/PointerValue.java (-7 / +11 lines)
Lines 11-18 Link Here
11
11
12
package org.eclipse.cdt.debug.mi.core.cdi.model.type;
12
package org.eclipse.cdt.debug.mi.core.cdi.model.type;
13
13
14
import org.eclipse.cdt.core.IAddress;
14
import org.eclipse.cdt.debug.core.cdi.CDIException;
15
import org.eclipse.cdt.debug.core.cdi.CDIException;
15
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIPointerValue;
16
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIPointerValue;
17
import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
16
import org.eclipse.cdt.debug.mi.core.cdi.model.Variable;
18
import org.eclipse.cdt.debug.mi.core.cdi.model.Variable;
17
19
18
/**
20
/**
Lines 29-45 Link Here
29
	/* (non-Javadoc)
31
	/* (non-Javadoc)
30
	 * @see org.eclipse.cdt.debug.core.cdi.model.type.ICDIPointerValue#pointerValue()
32
	 * @see org.eclipse.cdt.debug.core.cdi.model.type.ICDIPointerValue#pointerValue()
31
	 */
33
	 */
32
	public long pointerValue() throws CDIException {
34
	public IAddress pointerValue() throws CDIException {
33
		long value = 0;
35
		String valueString = getValueString().trim();
34
		String valueString = getValueString();
35
		int space = valueString.indexOf(' ');
36
		int space = valueString.indexOf(' ');
36
		if (space != -1) {
37
		if (space != -1) {
37
			valueString = valueString.substring(0, space).trim();
38
			valueString = valueString.substring(0, space).trim();
38
		}
39
		}
39
		try {
40
		try{
40
			value = Long.decode(valueString).longValue();
41
			
41
		} catch (NumberFormatException e) {
42
			return ((Target)getTarget()).getAddressFactory().createAddress(valueString);
43
		}
44
		catch(Exception e)
45
		{
46
			return null;
42
		}
47
		}
43
		return value;
44
	}
48
	}
45
}
49
}
(-)workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/model/type/ReferenceValue.java (-6 / +11 lines)
Lines 11-18 Link Here
11
11
12
package org.eclipse.cdt.debug.mi.core.cdi.model.type;
12
package org.eclipse.cdt.debug.mi.core.cdi.model.type;
13
13
14
import org.eclipse.cdt.core.IAddress;
14
import org.eclipse.cdt.debug.core.cdi.CDIException;
15
import org.eclipse.cdt.debug.core.cdi.CDIException;
15
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIReferenceValue;
16
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIReferenceValue;
17
import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
16
import org.eclipse.cdt.debug.mi.core.cdi.model.Variable;
18
import org.eclipse.cdt.debug.mi.core.cdi.model.Variable;
17
19
18
/**
20
/**
Lines 32-39 Link Here
32
	/* (non-Javadoc)
34
	/* (non-Javadoc)
33
	 * @see org.eclipse.cdt.debug.core.cdi.model.type.ICDIReferenceValue#referenceValue()
35
	 * @see org.eclipse.cdt.debug.core.cdi.model.type.ICDIReferenceValue#referenceValue()
34
	 */
36
	 */
35
	public long referenceValue() throws CDIException {
37
	public IAddress referenceValue() throws CDIException {
36
		long value = 0;
37
		String valueString = getValueString().trim();
38
		String valueString = getValueString().trim();
38
		if ( valueString.startsWith("@") ) //$NON-NLS-1$
39
		if ( valueString.startsWith("@") ) //$NON-NLS-1$
39
			valueString = valueString.substring( 1 );
40
			valueString = valueString.substring( 1 );
Lines 41-50 Link Here
41
		if (space != -1) {
42
		if (space != -1) {
42
			valueString = valueString.substring(0, space).trim();
43
			valueString = valueString.substring(0, space).trim();
43
		}
44
		}
44
		try {
45
		try{
45
			value = Long.decode(valueString).longValue();
46
			
46
		} catch (NumberFormatException e) {
47
			return ((Target)getTarget()).getAddressFactory().createAddress(valueString);
48
		}
49
		catch(Exception e)
50
		{
51
			return null;
47
		}
52
		}
48
		return value;
53
		
49
	}
54
	}
50
}
55
}
(-)workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/Session.java (-4 / +5 lines)
Lines 13-18 Link Here
13
13
14
import java.util.Properties;
14
import java.util.Properties;
15
15
16
import org.eclipse.cdt.core.IAddressFactory;
16
import org.eclipse.cdt.debug.core.cdi.CDIException;
17
import org.eclipse.cdt.debug.core.cdi.CDIException;
17
import org.eclipse.cdt.debug.core.cdi.ICDIConfiguration;
18
import org.eclipse.cdt.debug.core.cdi.ICDIConfiguration;
18
import org.eclipse.cdt.debug.core.cdi.ICDIEventManager;
19
import org.eclipse.cdt.debug.core.cdi.ICDIEventManager;
Lines 54-72 Link Here
54
	SourceManager sourceManager;
55
	SourceManager sourceManager;
55
	ICDIConfiguration configuration;
56
	ICDIConfiguration configuration;
56
57
57
	public Session(MISession miSession, boolean attach) {
58
	public Session(MISession miSession, IAddressFactory addrFactory, boolean attach) {
58
		commonSetup();
59
		commonSetup();
59
		setConfiguration(new Configuration(miSession, attach));
60
		setConfiguration(new Configuration(miSession, attach));
60
61
61
		Target target = new Target(this, miSession);
62
		Target target = new Target(this, miSession, addrFactory);
62
		addTargets(new Target[] { target }, target);
63
		addTargets(new Target[] { target }, target);
63
	}
64
	}
64
65
65
	public Session(MISession miSession) {
66
	public Session(MISession miSession, IAddressFactory addrFactory) {
66
		commonSetup();
67
		commonSetup();
67
		setConfiguration(new CoreFileConfiguration());
68
		setConfiguration(new CoreFileConfiguration());
68
69
69
		Target target = new Target(this, miSession);
70
		Target target = new Target(this, miSession, addrFactory);
70
		addTargets(new Target[] { target }, target);
71
		addTargets(new Target[] { target }, target);
71
	}
72
	}
72
73
(-)workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/SharedLibraryManager.java (-2 / +4 lines)
Lines 17-22 Link Here
17
import java.util.List;
17
import java.util.List;
18
import java.util.Map;
18
import java.util.Map;
19
19
20
import org.eclipse.cdt.core.IAddressFactory;
20
import org.eclipse.cdt.debug.core.cdi.CDIException;
21
import org.eclipse.cdt.debug.core.cdi.CDIException;
21
import org.eclipse.cdt.debug.core.cdi.ICDIConfiguration;
22
import org.eclipse.cdt.debug.core.cdi.ICDIConfiguration;
22
import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager;
23
import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryManager;
Lines 145-153 Link Here
145
	}
146
	}
146
147
147
	public boolean hasSharedLibChanged(ICDISharedLibrary lib, MIShared miLib) {
148
	public boolean hasSharedLibChanged(ICDISharedLibrary lib, MIShared miLib) {
149
		IAddressFactory af = ((Target)getSession().getCurrentTarget()).getAddressFactory();
148
		return !miLib.getName().equals(lib.getFileName()) ||
150
		return !miLib.getName().equals(lib.getFileName()) ||
149
			miLib.getFrom() != lib.getStartAddress() ||
151
			!af.createAddress(miLib.getFrom()).equals(lib.getStartAddress())   ||
150
			miLib.getTo() != lib.getEndAddress() ||
152
		    !af.createAddress(miLib.getTo()).equals(lib.getEndAddress()) ||
151
			miLib.isRead() != lib.areSymbolsLoaded();
153
			miLib.isRead() != lib.areSymbolsLoaded();
152
	}
154
	}
153
155
(-)workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/cdi/SourceManager.java (-9 / +9 lines)
Lines 12-17 Link Here
12
12
13
import java.util.StringTokenizer;
13
import java.util.StringTokenizer;
14
14
15
import org.eclipse.cdt.core.IAddress;
15
import org.eclipse.cdt.debug.core.cdi.CDIException;
16
import org.eclipse.cdt.debug.core.cdi.CDIException;
16
import org.eclipse.cdt.debug.core.cdi.ICDISourceManager;
17
import org.eclipse.cdt.debug.core.cdi.ICDISourceManager;
17
import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction;
18
import org.eclipse.cdt.debug.core.cdi.model.ICDIInstruction;
Lines 142-157 Link Here
142
	/**
143
	/**
143
	 * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#getInstructions(long, long)
144
	 * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#getInstructions(long, long)
144
	 */
145
	 */
145
	public ICDIInstruction[] getInstructions(long start, long end) throws CDIException {
146
	public ICDIInstruction[] getInstructions(IAddress start, IAddress end) throws CDIException {
146
		Target target = (Target)getSession().getCurrentTarget();
147
		Target target = (Target)getSession().getCurrentTarget();
147
		return getInstructions(target, start, end);
148
		return getInstructions(target, start, end);
148
	}
149
	}
149
	public ICDIInstruction[] getInstructions(Target target, long start, long end) throws CDIException {
150
	public ICDIInstruction[] getInstructions(Target target, IAddress start, IAddress end) throws CDIException {
150
		MISession mi = target.getMISession();
151
		MISession mi = target.getMISession();
151
		CommandFactory factory = mi.getCommandFactory();
152
		CommandFactory factory = mi.getCommandFactory();
152
		String hex = "0x"; //$NON-NLS-1$
153
		String hex = "0x"; //$NON-NLS-1$
153
		String sa = hex + Long.toHexString(start);
154
		String sa = start.toHexAddressString();
154
		String ea = hex + Long.toHexString(end);
155
		String ea = end.toHexAddressString();
155
		MIDataDisassemble dis = factory.createMIDataDisassemble(sa, ea, false);
156
		MIDataDisassemble dis = factory.createMIDataDisassemble(sa, ea, false);
156
		try {
157
		try {
157
			mi.postCommand(dis);
158
			mi.postCommand(dis);
Lines 202-217 Link Here
202
	/**
203
	/**
203
	 * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#getMixedInstructions(long, long)
204
	 * @see org.eclipse.cdt.debug.core.cdi.ICDISourceManager#getMixedInstructions(long, long)
204
	 */
205
	 */
205
	public ICDIMixedInstruction[] getMixedInstructions(long start, long end) throws CDIException {	
206
	public ICDIMixedInstruction[] getMixedInstructions(IAddress start, IAddress end) throws CDIException {	
206
		Target target = (Target)getSession().getCurrentTarget();
207
		Target target = (Target)getSession().getCurrentTarget();
207
		return getMixedInstructions(target, start, end);
208
		return getMixedInstructions(target, start, end);
208
	}
209
	}
209
	public ICDIMixedInstruction[] getMixedInstructions(Target target, long start, long end) throws CDIException {
210
	public ICDIMixedInstruction[] getMixedInstructions(Target target, IAddress start, IAddress end) throws CDIException {
210
		MISession mi = target.getMISession();
211
		MISession mi = target.getMISession();
211
		CommandFactory factory = mi.getCommandFactory();
212
		CommandFactory factory = mi.getCommandFactory();
212
		String hex = "0x"; //$NON-NLS-1$
213
		String sa = start.toHexAddressString();
213
		String sa = hex + Long.toHexString(start);
214
		String ea = end.toHexAddressString();
214
		String ea = hex + Long.toHexString(end);
215
		MIDataDisassemble dis = factory.createMIDataDisassemble(sa, ea, true);
215
		MIDataDisassemble dis = factory.createMIDataDisassemble(sa, ea, true);
216
		try {
216
		try {
217
			mi.postCommand(dis);
217
			mi.postCommand(dis);
(-)workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/command/CommandFactory.java (+4 lines)
Lines 222-227 Link Here
222
		return new MIGDBShowSolibSearchPath();
222
		return new MIGDBShowSolibSearchPath();
223
	}
223
	}
224
224
225
	public MIGDBShowAddressSize createMIGDBShowAddressSize() {
226
		return new MIGDBShowAddressSize();
227
	}
228
225
	public MIStackInfoDepth createMIStackInfoDepth() {
229
	public MIStackInfoDepth createMIStackInfoDepth() {
226
		return new MIStackInfoDepth();
230
		return new MIStackInfoDepth();
227
	}
231
	}
(-)workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/command/MIGDBShowAddressSize.java (+38 lines)
Line 0 Link Here
1
/*
2
 * Created on Jun 4, 2004
3
 *
4
 * To change the template for this generated file go to
5
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
6
 */
7
package org.eclipse.cdt.debug.mi.core.command;
8
9
import org.eclipse.cdt.debug.mi.core.MIException;
10
import org.eclipse.cdt.debug.mi.core.output.MIGDBShowAddressSizeInfo;
11
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
12
import org.eclipse.cdt.debug.mi.core.output.MIOutput;
13
14
/**
15
 * @author root
16
 *
17
 * To change the template for this generated type comment go to
18
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
19
 */
20
public class MIGDBShowAddressSize extends MIGDBShow {
21
	
22
	public MIGDBShowAddressSize () {
23
		super(new String[] { "remoteaddresssize" });
24
	}
25
	
26
	public MIInfo getMIInfo() throws MIException {
27
		MIGDBShowAddressSizeInfo info = null;
28
		MIOutput out = getMIOutput();
29
		if (out != null) {
30
			info = new MIGDBShowAddressSizeInfo(out);
31
			if (info.isError()) {
32
				throwMIException(info, out);
33
			}
34
		}
35
		return info;
36
	}
37
38
}
(-)workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/event/MIMemoryChangedEvent.java (-5 / +5 lines)
Lines 12-18 Link Here
12
12
13
import org.eclipse.cdt.debug.mi.core.MISession;
13
import org.eclipse.cdt.debug.mi.core.MISession;
14
14
15
15
import org.eclipse.cdt.core.IAddress;
16
16
17
/**
17
/**
18
 * This can not be detected yet by gdb/mi.
18
 * This can not be detected yet by gdb/mi.
Lines 20-37 Link Here
20
 */
20
 */
21
public class MIMemoryChangedEvent extends MIChangedEvent {
21
public class MIMemoryChangedEvent extends MIChangedEvent {
22
22
23
	Long[] addresses;
23
	IAddress[] addresses;
24
24
25
	public MIMemoryChangedEvent(MISession source, Long[] addrs) {
25
	public MIMemoryChangedEvent(MISession source, IAddress[] addrs) {
26
		this(source, 0, addrs);
26
		this(source, 0, addrs);
27
	}
27
	}
28
28
29
	public MIMemoryChangedEvent(MISession source, int token, Long[] addrs) {
29
	public MIMemoryChangedEvent(MISession source, int token, IAddress[] addrs) {
30
		super(source, token);
30
		super(source, token);
31
		addresses = addrs;
31
		addresses = addrs;
32
	}
32
	}
33
33
34
	public Long[] getAddresses() {
34
	public IAddress[] getAddresses() {
35
		return addresses;
35
		return addresses;
36
	}
36
	}
37
}
37
}
(-)workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/event/MIMemoryCreatedEvent.java (-4 / +5 lines)
Lines 10-15 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.cdt.debug.mi.core.event;
11
package org.eclipse.cdt.debug.mi.core.event;
12
12
13
import org.eclipse.cdt.core.IAddress;
13
import org.eclipse.cdt.debug.mi.core.MISession;
14
import org.eclipse.cdt.debug.mi.core.MISession;
14
15
15
16
Lines 20-39 Link Here
20
 */
21
 */
21
public class MIMemoryCreatedEvent extends MICreatedEvent {
22
public class MIMemoryCreatedEvent extends MICreatedEvent {
22
23
23
	long address;
24
	IAddress address;
24
	long totalBytes;
25
	long totalBytes;
25
26
26
	public MIMemoryCreatedEvent(MISession source, long addr, long total) {
27
	public MIMemoryCreatedEvent(MISession source, IAddress addr, long total) {
27
		this(source, 0, addr, total);
28
		this(source, 0, addr, total);
28
	}
29
	}
29
30
30
	public MIMemoryCreatedEvent(MISession source, int token, long addr, long total) {
31
	public MIMemoryCreatedEvent(MISession source, int token, IAddress addr, long total) {
31
		super(source, token);
32
		super(source, token);
32
		address = addr;
33
		address = addr;
33
		totalBytes = total;
34
		totalBytes = total;
34
	}
35
	}
35
36
36
	public long getAddress() {
37
	public IAddress getAddress() {
37
		return address;
38
		return address;
38
	}
39
	}
39
40
(-)workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/GDBDebugger.java (-3 / +3 lines)
Lines 73-79 Link Here
73
			String gdb = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb"); //$NON-NLS-1$
73
			String gdb = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb"); //$NON-NLS-1$
74
			File cwd = exe.getProject().getLocation().toFile();
74
			File cwd = exe.getProject().getLocation().toFile();
75
			String gdbinit = config.getAttribute(IMILaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit"); //$NON-NLS-1$
75
			String gdbinit = config.getAttribute(IMILaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit"); //$NON-NLS-1$
76
			session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), cwd, gdbinit);
76
			session = (Session)MIPlugin.getDefault().createCSession(gdb, exe, cwd, gdbinit);
77
			initializeLibraries(config, session);
77
			initializeLibraries(config, session);
78
			return session;
78
			return session;
79
		} catch (IOException e) {
79
		} catch (IOException e) {
Lines 105-111 Link Here
105
			String gdb = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb"); //$NON-NLS-1$
105
			String gdb = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb"); //$NON-NLS-1$
106
			File cwd = exe.getProject().getLocation().toFile();
106
			File cwd = exe.getProject().getLocation().toFile();
107
			String gdbinit = config.getAttribute(IMILaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit"); //$NON-NLS-1$
107
			String gdbinit = config.getAttribute(IMILaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit"); //$NON-NLS-1$
108
			session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), pid, null, cwd, gdbinit);
108
			session = (Session)MIPlugin.getDefault().createCSession(gdb, exe, pid, null, cwd, gdbinit);
109
			initializeLibraries(config, session);
109
			initializeLibraries(config, session);
110
			return session;
110
			return session;
111
		} catch (IOException e) {
111
		} catch (IOException e) {
Lines 137-143 Link Here
137
			String gdb = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb"); //$NON-NLS-1$
137
			String gdb = config.getAttribute(IMILaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb"); //$NON-NLS-1$
138
			File cwd = exe.getProject().getLocation().toFile();
138
			File cwd = exe.getProject().getLocation().toFile();
139
			String gdbinit = config.getAttribute(IMILaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit"); //$NON-NLS-1$
139
			String gdbinit = config.getAttribute(IMILaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit"); //$NON-NLS-1$
140
			session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), corefile.toFile(), cwd, gdbinit);
140
			session = (Session)MIPlugin.getDefault().createCSession(gdb, exe, corefile.toFile(), cwd, gdbinit);
141
			initializeLibraries(config, session);
141
			initializeLibraries(config, session);
142
			return session;
142
			return session;
143
		} catch (IOException e) {
143
		} catch (IOException e) {
(-)workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/GDBServerDebugger.java (-2 / +2 lines)
Lines 69-75 Link Here
69
				remote += ":"; //$NON-NLS-1$
69
				remote += ":"; //$NON-NLS-1$
70
				remote += config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_PORT, "invalid"); //$NON-NLS-1$
70
				remote += config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_PORT, "invalid"); //$NON-NLS-1$
71
				String[] args = new String[] {"remote", remote}; //$NON-NLS-1$
71
				String[] args = new String[] {"remote", remote}; //$NON-NLS-1$
72
				session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), 0, args, cwd, gdbinit);
72
				session = (Session)MIPlugin.getDefault().createCSession(gdb, exe, 0, args, cwd, gdbinit);
73
			} else {
73
			} else {
74
				MIPlugin plugin = MIPlugin.getDefault();
74
				MIPlugin plugin = MIPlugin.getDefault();
75
				Preferences prefs = plugin.getPluginPreferences();
75
				Preferences prefs = plugin.getPluginPreferences();
Lines 77-83 Link Here
77
77
78
				String remote = config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_DEV, "invalid"); //$NON-NLS-1$
78
				String remote = config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_DEV, "invalid"); //$NON-NLS-1$
79
				String remoteBaud = config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_DEV_SPEED, "invalid"); //$NON-NLS-1$
79
				String remoteBaud = config.getAttribute(IGDBServerMILaunchConfigurationConstants.ATTR_DEV_SPEED, "invalid"); //$NON-NLS-1$
80
				session = (Session)MIPlugin.getDefault().createCSession(gdb, exe.getLocation().toFile(), -1, null, cwd, gdbinit);
80
				session = (Session)MIPlugin.getDefault().createCSession(gdb, exe, -1, null, cwd, gdbinit);
81
				ICDITarget[] targets = session.getTargets();
81
				ICDITarget[] targets = session.getTargets();
82
				for (int i = 0; i < targets.length; ++i) {
82
				for (int i = 0; i < targets.length; ++i) {
83
					Target target = (Target)targets[i];
83
					Target target = (Target)targets[i];
(-)workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/MIPlugin.java (-11 / +27 lines)
Lines 21-26 Link Here
21
import java.util.MissingResourceException;
21
import java.util.MissingResourceException;
22
import java.util.ResourceBundle;
22
import java.util.ResourceBundle;
23
23
24
import org.eclipse.cdt.core.CCorePlugin;
25
import org.eclipse.cdt.core.IAddressFactory;
26
import org.eclipse.cdt.core.model.IBinary;
27
import org.eclipse.cdt.core.model.ICElement;
24
import org.eclipse.cdt.debug.core.cdi.ICDISession;
28
import org.eclipse.cdt.debug.core.cdi.ICDISession;
25
import org.eclipse.cdt.debug.mi.core.cdi.Session;
29
import org.eclipse.cdt.debug.mi.core.cdi.Session;
26
import org.eclipse.cdt.debug.mi.core.command.CLICommand;
30
import org.eclipse.cdt.debug.mi.core.command.CLICommand;
Lines 30-35 Link Here
30
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
34
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
31
import org.eclipse.cdt.utils.pty.PTY;
35
import org.eclipse.cdt.utils.pty.PTY;
32
import org.eclipse.cdt.utils.spawner.ProcessFactory;
36
import org.eclipse.cdt.utils.spawner.ProcessFactory;
37
import org.eclipse.core.resources.IFile;
38
import org.eclipse.core.runtime.IPluginDescriptor;
33
import org.eclipse.core.runtime.Plugin;
39
import org.eclipse.core.runtime.Plugin;
34
import org.eclipse.core.runtime.Preferences;
40
import org.eclipse.core.runtime.Preferences;
35
import org.osgi.framework.BundleContext;
41
import org.osgi.framework.BundleContext;
Lines 113-119 Link Here
113
	 * @return ICDISession
119
	 * @return ICDISession
114
	 * @throws MIException
120
	 * @throws MIException
115
	 */
121
	 */
116
	public ICDISession createCSession(String gdb, File program, File cwd, String gdbinit) throws IOException, MIException {
122
	public ICDISession createCSession(String gdb, IFile program, File cwd, String gdbinit) throws IOException, MIException {
117
		PTY pty = null;
123
		PTY pty = null;
118
		boolean failed = false;
124
		boolean failed = false;
119
125
Lines 156-162 Link Here
156
	 * @return ICDISession
162
	 * @return ICDISession
157
	 * @throws IOException
163
	 * @throws IOException
158
	 */
164
	 */
159
	public ICDISession createCSession(String gdb, File program, File cwd, String gdbinit, PTY pty) throws IOException, MIException {
165
	public ICDISession createCSession(String gdb, IFile program, File cwd, String gdbinit, PTY pty) throws IOException, MIException {
160
		if (gdb == null || gdb.length() == 0) {
166
		if (gdb == null || gdb.length() == 0) {
161
			gdb =  GDB;
167
			gdb =  GDB;
162
		}
168
		}
Lines 170-182 Link Here
170
			if (program == null) {
176
			if (program == null) {
171
				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$
177
				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$
172
			} else {
178
			} else {
173
				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$
179
				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$
174
			}
180
			}
175
		} else {
181
		} else {
176
			if (program == null) {
182
			if (program == null) {
177
				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$
183
				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$
178
			} else {
184
			} else {
179
				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$
185
				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$
180
			}
186
			}
181
		}
187
		}
182
188
Lines 206-212 Link Here
206
			// If an exception is thrown that means ok
212
			// If an exception is thrown that means ok
207
			// we did not attach to any target.
213
			// we did not attach to any target.
208
		}
214
		}
209
		return new Session(session, false);
215
		return new Session(session, getAddressFactory(program), false);
210
	}
216
	}
211
217
212
	/**
218
	/**
Lines 216-222 Link Here
216
	 * @return ICDISession
222
	 * @return ICDISession
217
	 * @throws IOException
223
	 * @throws IOException
218
	 */
224
	 */
219
	public ICDISession createCSession(String gdb, File program, File core, File cwd, String gdbinit) throws IOException, MIException {
225
	public ICDISession createCSession(String gdb, IFile program, File core, File cwd, String gdbinit) throws IOException, MIException {
220
		if (gdb == null || gdb.length() == 0) {
226
		if (gdb == null || gdb.length() == 0) {
221
			gdb =  GDB;
227
			gdb =  GDB;
222
		}
228
		}
Lines 229-235 Link Here
229
		if (program == null) {
235
		if (program == null) {
230
			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$
236
			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$
231
		} else {
237
		} else {
232
			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$
238
			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$
233
		}
239
		}
234
		Process pgdb = getGDBProcess(args);
240
		Process pgdb = getGDBProcess(args);
235
		MISession session;
241
		MISession session;
Lines 239-245 Link Here
239
			pgdb.destroy();
245
			pgdb.destroy();
240
			throw e;
246
			throw e;
241
		}
247
		}
242
		return new Session(session);
248
		return new Session(session, getAddressFactory(program));
243
	}
249
	}
244
250
245
	/**
251
	/**
Lines 249-255 Link Here
249
	 * @return ICDISession
255
	 * @return ICDISession
250
	 * @throws IOException
256
	 * @throws IOException
251
	 */
257
	 */
252
	public ICDISession createCSession(String gdb, File program, int pid, String[] targetParams, File cwd, String gdbinit) throws IOException, MIException {
258
	public ICDISession createCSession(String gdb, IFile program, int pid, String[] targetParams, File cwd, String gdbinit) throws IOException, MIException {
253
		if (gdb == null || gdb.length() == 0) {
259
		if (gdb == null || gdb.length() == 0) {
254
			gdb =  GDB;
260
			gdb =  GDB;
255
		}
261
		}
Lines 262-268 Link Here
262
		if (program == null) {
268
		if (program == null) {
263
			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$
269
			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$
264
		} else {
270
		} else {
265
			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$
271
			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$
266
		}
272
		}
267
		Process pgdb = getGDBProcess(args);
273
		Process pgdb = getGDBProcess(args);
268
		MISession session;
274
		MISession session;
Lines 298-304 Link Here
298
		//@@@ We have to manually set the suspended state when we attach
304
		//@@@ We have to manually set the suspended state when we attach
299
		session.getMIInferior().setSuspended();
305
		session.getMIInferior().setSuspended();
300
		session.getMIInferior().update();
306
		session.getMIInferior().update();
301
		return new Session(session, true);
307
		return new Session(session, getAddressFactory(program), true);
302
	}
308
	}
303
309
304
	/**
310
	/**
Lines 423-428 Link Here
423
		getPluginPreferences().setDefault(IMIConstants.PREF_REQUEST_LAUNCH_TIMEOUT, IMIConstants.DEF_REQUEST_LAUNCH_TIMEOUT);
429
		getPluginPreferences().setDefault(IMIConstants.PREF_REQUEST_LAUNCH_TIMEOUT, IMIConstants.DEF_REQUEST_LAUNCH_TIMEOUT);
424
	}
430
	}
425
431
432
	protected IAddressFactory getAddressFactory(IFile exe)
433
	{
434
		ICElement cFile = CCorePlugin.getDefault().getCoreModel().create( exe );
435
		if ( cFile instanceof IBinary )
436
		{
437
			return ((IBinary)cFile).getAddressFactory();
438
		}
439
		return null;		 
440
	}
441
	
426
	/* (non-Javadoc)
442
	/* (non-Javadoc)
427
	 * @see org.eclipse.core.runtime.Plugin#shutdown()
443
	 * @see org.eclipse.core.runtime.Plugin#shutdown()
428
	 */
444
	 */
(-)workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIAsm.java (-4 / +4 lines)
Lines 14-20 Link Here
14
 * Represent a GDB Tuple MI assembly response.
14
 * Represent a GDB Tuple MI assembly response.
15
 */
15
 */
16
public class MIAsm {
16
public class MIAsm {
17
	long address;
17
	String address;
18
	String function = ""; //$NON-NLS-1$
18
	String function = ""; //$NON-NLS-1$
19
	String opcode = ""; //$NON-NLS-1$
19
	String opcode = ""; //$NON-NLS-1$
20
	String args = ""; //$NON-NLS-1$
20
	String args = ""; //$NON-NLS-1$
Lines 24-30 Link Here
24
		parse(tuple);
24
		parse(tuple);
25
	}
25
	}
26
26
27
	public long getAddress() {
27
	public String getAddress() {
28
		return address;
28
		return address;
29
	}
29
	}
30
30
Lines 43-49 Link Here
43
	public String toString() {
43
	public String toString() {
44
		StringBuffer buffer = new StringBuffer();
44
		StringBuffer buffer = new StringBuffer();
45
		buffer.append('{');
45
		buffer.append('{');
46
		buffer.append("address=\"" + Long.toHexString(address) +"\"");  //$NON-NLS-1$//$NON-NLS-2$
46
		buffer.append("address=\"" + address +"\"");  //$NON-NLS-1$//$NON-NLS-2$
47
		buffer.append(",func-name=\"" + function + "\"");  //$NON-NLS-1$//$NON-NLS-2$
47
		buffer.append(",func-name=\"" + function + "\"");  //$NON-NLS-1$//$NON-NLS-2$
48
		buffer.append(",offset=\"").append(offset).append('"'); //$NON-NLS-1$
48
		buffer.append(",offset=\"").append(offset).append('"'); //$NON-NLS-1$
49
		buffer.append(",inst=\"" + getInstruction() + "\"");  //$NON-NLS-1$//$NON-NLS-2$
49
		buffer.append(",inst=\"" + getInstruction() + "\"");  //$NON-NLS-1$//$NON-NLS-2$
Lines 64-70 Link Here
64
64
65
			if (var.equals("address")) { //$NON-NLS-1$
65
			if (var.equals("address")) { //$NON-NLS-1$
66
				try {
66
				try {
67
					address = Long.decode(str.trim()).longValue();
67
					address = str.trim();
68
				} catch (NumberFormatException e) {
68
				} catch (NumberFormatException e) {
69
				}
69
				}
70
			} else if (var.equals("func-name")) { //$NON-NLS-1$
70
			} else if (var.equals("func-name")) { //$NON-NLS-1$
(-)workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIBreakpoint.java (-3 / +3 lines)
Lines 54-60 Link Here
54
	String type = ""; //$NON-NLS-1$
54
	String type = ""; //$NON-NLS-1$
55
	String disp = ""; //$NON-NLS-1$
55
	String disp = ""; //$NON-NLS-1$
56
	boolean enabled;
56
	boolean enabled;
57
	long address;
57
	String address;
58
	String func = "";  //$NON-NLS-1$
58
	String func = "";  //$NON-NLS-1$
59
	String file = ""; //$NON-NLS-1$
59
	String file = ""; //$NON-NLS-1$
60
	int line;
60
	int line;
Lines 146-152 Link Here
146
		enabled = e;
146
		enabled = e;
147
	}
147
	}
148
148
149
	public long getAddress() {
149
	public String getAddress() {
150
		return address;
150
		return address;
151
	}
151
	}
152
152
Lines 228-234 Link Here
228
				enabled = str.equals("y"); //$NON-NLS-1$
228
				enabled = str.equals("y"); //$NON-NLS-1$
229
			} else if (var.equals("addr")) { //$NON-NLS-1$
229
			} else if (var.equals("addr")) { //$NON-NLS-1$
230
				try {
230
				try {
231
					address = Long.decode(str.trim()).longValue();
231
					address = str.trim();
232
				} catch (NumberFormatException e) {
232
				} catch (NumberFormatException e) {
233
				}
233
				}
234
			} else if (var.equals("func")) { //$NON-NLS-1$
234
			} else if (var.equals("func")) { //$NON-NLS-1$
(-)workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIDataReadMemoryInfo.java (-3 / +3 lines)
Lines 18-24 Link Here
18
 */
18
 */
19
public class MIDataReadMemoryInfo extends MIInfo {
19
public class MIDataReadMemoryInfo extends MIInfo {
20
20
21
	long addr;
21
	String addr;
22
	long nextRow;
22
	long nextRow;
23
	long prevRow;
23
	long prevRow;
24
	long nextPage;
24
	long nextPage;
Lines 33-39 Link Here
33
		parse();
33
		parse();
34
	}
34
	}
35
35
36
	public long getAddress() {
36
	public String getAddress() {
37
		return addr;
37
		return addr;
38
	}
38
	}
39
39
Lines 96-102 Link Here
96
96
97
					if (var.equals("addr")) { //$NON-NLS-1$
97
					if (var.equals("addr")) { //$NON-NLS-1$
98
						try {
98
						try {
99
							addr = Long.decode(str.trim()).longValue();
99
							addr = str.trim();
100
						} catch (NumberFormatException e) {
100
						} catch (NumberFormatException e) {
101
						}
101
						}
102
					} else if (var.equals("nr-bytes")) { //$NON-NLS-1$
102
					} else if (var.equals("nr-bytes")) { //$NON-NLS-1$
(-)workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIFrame.java (-4 / +4 lines)
Lines 16-22 Link Here
16
public class MIFrame {
16
public class MIFrame {
17
17
18
	int level;
18
	int level;
19
	long addr;
19
	String addr;
20
	String func = ""; //$NON-NLS-1$
20
	String func = ""; //$NON-NLS-1$
21
	String file = ""; //$NON-NLS-1$
21
	String file = ""; //$NON-NLS-1$
22
	int line;
22
	int line;
Lines 42-48 Link Here
42
		return line;
42
		return line;
43
	}
43
	}
44
44
45
	public long getAddress() {
45
	public String getAddress() {
46
		return addr;
46
		return addr;
47
	}
47
	}
48
48
Lines 53-59 Link Here
53
	public String toString() {
53
	public String toString() {
54
		StringBuffer buffer = new StringBuffer();
54
		StringBuffer buffer = new StringBuffer();
55
		buffer.append("level=\"" + level + "\"");  //$NON-NLS-1$//$NON-NLS-2$
55
		buffer.append("level=\"" + level + "\"");  //$NON-NLS-1$//$NON-NLS-2$
56
		buffer.append(",addr=\"" + Long.toHexString(addr) + "\"");  //$NON-NLS-1$//$NON-NLS-2$
56
		buffer.append(",addr=\"" + addr + "\"");  //$NON-NLS-1$//$NON-NLS-2$
57
		buffer.append(",func=\"" + func + "\"");  //$NON-NLS-1$//$NON-NLS-2$
57
		buffer.append(",func=\"" + func + "\"");  //$NON-NLS-1$//$NON-NLS-2$
58
		buffer.append(",file=\"" + file + "\"");  //$NON-NLS-1$//$NON-NLS-2$
58
		buffer.append(",file=\"" + file + "\"");  //$NON-NLS-1$//$NON-NLS-2$
59
		buffer.append(",line=\"").append(line).append('"'); //$NON-NLS-1$
59
		buffer.append(",line=\"").append(line).append('"'); //$NON-NLS-1$
Lines 86-92 Link Here
86
				}
86
				}
87
			} else if (var.equals("addr")) { //$NON-NLS-1$
87
			} else if (var.equals("addr")) { //$NON-NLS-1$
88
				try {
88
				try {
89
					addr = Long.decode(str.trim()).longValue();
89
					addr = str.trim();
90
				} catch (NumberFormatException e) {
90
				} catch (NumberFormatException e) {
91
				}
91
				}
92
			} else if (var.equals("func")) { //$NON-NLS-1$
92
			} else if (var.equals("func")) { //$NON-NLS-1$
(-)workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIGDBShowAddressSizeInfo.java (+25 lines)
Line 0 Link Here
1
/*
2
 * Created on Jun 7, 2004
3
 *
4
 * To change the template for this generated file go to
5
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
6
 */
7
package org.eclipse.cdt.debug.mi.core.output;
8
9
/**
10
 * @author root
11
 *
12
 * To change the template for this generated type comment go to
13
 * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
14
 */
15
public class MIGDBShowAddressSizeInfo extends MIGDBShowInfo {
16
17
	public MIGDBShowAddressSizeInfo(MIOutput o) {
18
		super(o);
19
	}
20
21
	public int getAddressSize()
22
	{
23
		return Integer.parseInt(getValue()); 
24
	}
25
}
(-)workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIInfoSharedLibraryInfo.java (-16 / +7 lines)
Lines 80-87 Link Here
80
		if (str.length() > 0) {
80
		if (str.length() > 0) {
81
			// Pass the header
81
			// Pass the header
82
			int index = -1;
82
			int index = -1;
83
			long from = 0;
83
			String from = "";
84
			long to = 0;
84
			String to = "";
85
			boolean syms = false;
85
			boolean syms = false;
86
			String name = ""; //$NON-NLS-1$
86
			String name = ""; //$NON-NLS-1$
87
87
Lines 102-117 Link Here
102
						}
102
						}
103
						break;
103
						break;
104
					case 2 : // second column is "To"
104
					case 2 : // second column is "To"
105
						try {
105
							to = sub;
106
							to = Long.decode(sub).longValue();
107
						} catch (NumberFormatException e) {
108
						}
109
						break;
106
						break;
110
					case 3 : // first column is "From"
107
					case 3 : // first column is "From"
111
						try {
108
							from = sub;
112
							from = Long.decode(sub).longValue();
113
						} catch (NumberFormatException e) {
114
						}
115
						break;
109
						break;
116
				}
110
				}
117
			}
111
			}
Lines 123-130 Link Here
123
	}
117
	}
124
118
125
	void parseWinShared(String str, List aList) {
119
	void parseWinShared(String str, List aList) {
126
		long from = 0;
120
		String from = "";
127
		long to = 0;
121
		String to = "";
128
		boolean syms = true;
122
		boolean syms = true;
129
123
130
		int index = str.lastIndexOf(' ');
124
		int index = str.lastIndexOf(' ');
Lines 134-143 Link Here
134
			if (!sub.startsWith("0x")) { //$NON-NLS-1$
128
			if (!sub.startsWith("0x")) { //$NON-NLS-1$
135
				sub = "0x" + sub; //$NON-NLS-1$
129
				sub = "0x" + sub; //$NON-NLS-1$
136
			}
130
			}
137
			try {
131
			from = sub;
138
				from = Long.decode(sub).longValue();
139
			} catch (NumberFormatException e) {
140
			}
141
			str = str.substring(0, index).trim();
132
			str = str.substring(0, index).trim();
142
		}
133
		}
143
		MIShared s = new MIShared(from, to, syms, str.trim());
134
		MIShared s = new MIShared(from, to, syms, str.trim());
(-)workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIMemory.java (-4 / +4 lines)
Lines 14-20 Link Here
14
 * GDB/MI memory parsing.
14
 * GDB/MI memory parsing.
15
 */
15
 */
16
public class MIMemory {
16
public class MIMemory {
17
	long addr;
17
	String addr;
18
	long [] data = new long[0];
18
	long [] data = new long[0];
19
	String ascii = ""; //$NON-NLS-1$
19
	String ascii = ""; //$NON-NLS-1$
20
20
Lines 22-28 Link Here
22
		parse(tuple);
22
		parse(tuple);
23
	}
23
	}
24
24
25
	public long getAddress() {
25
	public String getAddress() {
26
		return addr;
26
		return addr;
27
	}
27
	}
28
28
Lines 36-42 Link Here
36
36
37
	public String toSting() {
37
	public String toSting() {
38
		StringBuffer buffer = new StringBuffer();
38
		StringBuffer buffer = new StringBuffer();
39
		buffer.append("addr=\"" + Long.toHexString(addr) + "\""); //$NON-NLS-1$ //$NON-NLS-2$
39
		buffer.append("addr=\"" + addr + "\""); //$NON-NLS-1$ //$NON-NLS-2$
40
		buffer.append("data=[");  //$NON-NLS-1$
40
		buffer.append("data=[");  //$NON-NLS-1$
41
		for (int i = 0 ; i < data.length; i++) {
41
		for (int i = 0 ; i < data.length; i++) {
42
			if (i != 0) {
42
			if (i != 0) {
Lines 63-69 Link Here
63
63
64
			if (var.equals("addr")) { //$NON-NLS-1$
64
			if (var.equals("addr")) { //$NON-NLS-1$
65
				try {
65
				try {
66
					addr = Long.decode(str.trim()).longValue();
66
					addr = str.trim();
67
				} catch (NumberFormatException e) {
67
				} catch (NumberFormatException e) {
68
				}
68
				}
69
			} else if (var.equals("data")) { //$NON-NLS-1$
69
			} else if (var.equals("data")) { //$NON-NLS-1$
(-)workspace-old/org.eclipse.cdt.debug.mi.core/src-cdtmicore/org/eclipse/cdt/debug/mi/core/output/MIShared.java (-5 / +5 lines)
Lines 16-38 Link Here
16
 */
16
 */
17
public class MIShared {
17
public class MIShared {
18
18
19
	long from;
19
	String from;
20
	long to;
20
	String to;
21
	boolean isread;
21
	boolean isread;
22
	String name;
22
	String name;
23
23
24
	public MIShared (long start, long end, boolean read, String location) {
24
	public MIShared (String start, String end, boolean read, String location) {
25
		from = start;
25
		from = start;
26
		to = end;
26
		to = end;
27
		isread = read;
27
		isread = read;
28
		name = location;
28
		name = location;
29
	}
29
	}
30
30
31
	public long getFrom() {
31
	public String getFrom() {
32
		return from;
32
		return from;
33
	}
33
	}
34
34
35
	public long getTo() {
35
	public String getTo() {
36
		return to;
36
		return to;
37
	}
37
	}
38
38

Return to bug 74058