Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 9c5a18ede5a7b55872e7c02f1da4332e529c6a1b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*******************************************************************************
 * Copyright (c) 2006, 2010, 2012 Wind River Systems, Inc. and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Ted R Williams (Wind River Systems, Inc.) - initial implementation
 *     Randy Rohrbach (Wind River Systems, Inc.) - Copied and modified to create the floating point plugin
 *******************************************************************************/
package org.eclipse.cdt.debug.ui.memory.floatingpoint;

import org.eclipse.debug.core.model.MemoryByte;

public class FPMemoryByte extends MemoryByte implements FPIMemoryByte
{
	private boolean isEdited = false;
	
	private boolean[] changeHistory = new boolean[0];
	
	public FPMemoryByte()
	{
		super();
	}
	
	public FPMemoryByte(byte byteValue)
	{
		super(byteValue);
	}
	
	public FPMemoryByte(byte byteValue, byte byteFlags)
	{
		super(byteValue, byteFlags);
	}
	
	@Override
    public boolean isEdited()
	{
		return isEdited;
	}
	
	@Override
    public void setEdited(boolean edited)
	{
		isEdited = edited;
	}
	
	public boolean isChanged(int historyDepth)
	{
		return changeHistory.length > historyDepth && changeHistory[historyDepth];
	}
	
	public void setChanged(int historyDepth, boolean changed)
	{
		if(historyDepth >= changeHistory.length)
		{
			boolean newChangeHistory[] = new boolean[historyDepth + 1];
			System.arraycopy(changeHistory, 0, newChangeHistory, 0, changeHistory.length);
			changeHistory = newChangeHistory;
		}
		
		changeHistory[historyDepth] = changed;
		
		if(historyDepth == 0)
			this.setChanged(changed);
	}
}

Back to the top