KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > core > memory > IExtendedMemoryBlock


1 /*******************************************************************************
2  * Copyright (c) 2004 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.debug.internal.core.memory;
12
13 import java.math.BigInteger JavaDoc;
14 import org.eclipse.debug.core.DebugException;
15 import org.eclipse.debug.core.model.IMemoryBlock;
16 import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
17
18 /**
19  * Represents a memory block.
20  *
21  * When the memory block is changed, fire a CHANGE Debug Event.
22  *
23  * When firing change event, be aware of the following:
24  * - whenever a change event is fired, the content provider for Memory View / Memory Rendering
25  * view checks to see if memory has actually changed.
26  * - If memory has actually changed, a refresh will commence. Changes to the memory block
27  * will be computed and will be shown with the delta icons.
28  * - If memory has not changed, content will not be refreshed. However, previous delta information
29  * will be erased. The screen will be refreshed to show that no memory has been changed. (All
30  * delta icons will be removed.)
31  *
32  * Please note that these APIs will be called multiple times by the Memory View.
33  * To improve performance, debug adapters need to cache the content of its memory block and only
34  * retrieve updated data when necessary.
35  * @since 3.0
36  */

37 public interface IExtendedMemoryBlock extends IMemoryBlock {
38     
39     /**
40      * Returns the expression of this memory block.
41      * The expression will be used to construct the tab label of the memory view.
42      *
43      * @return expression of the memory block.
44      * @exception DebugException if this method fails. Reasons include:
45      * <ul><li>Failure communicating with the engine. The DebugException's
46      * status code contains the underlying exception responsible for
47      * the failure.</li>
48      */

49     public String JavaDoc getExpression() throws DebugException;
50     
51     /**
52      * Get the base address of this memory block in BigInteger
53      * @return
54      */

55     public BigInteger JavaDoc getBigBaseAddress();
56     
57     /**
58      * @return address size in number of bytes
59      */

60     public int getAddressSize();
61     
62     
63     /**
64      * Indicate if the base address of this memory block block could be modified
65      * If return true, setBaseAddress will be used to change the base address
66      * of this memory block.
67      * * @return
68      */

69     public boolean supportBaseAddressModification();
70     
71     /**
72      * @return true to indicate that the memory block manages the changes in the
73      * memory block. If the memory block manages changes, the memory block is
74      * expected to cache the MemoryByte array returned by getBytesFromOffset and
75      * getBytesFromAddress. The change information will not be calculated by
76      * the memory view. Intead, the memory block keeps track of the bytes
77      * and marks the bytes as changed/unchanged. Turn off both the CHANGE and UNCHANGED
78      * bits if the memory block does not contain history for the address.
79      *
80      * If this function returns false, the Memory View will calculate
81      * delta information for each byte based on its history.
82      */

83     public boolean isMemoryChangesManaged();
84     
85     /**
86      * Set the base address of this memory block
87      * @param address
88      * @throws DebugException if the method fails. Reasons inlucde:
89      * <ul><li>Failure communicating with the engine. The DebugException's
90      * status code contains the underlying exception responsible for
91      * the failure.</li>
92      */

93     public void setBaseAddress(BigInteger JavaDoc address) throws DebugException;
94
95     
96     /**
97      * Get bytes based on offset and length. Memory at base address + offset
98      * should be returned.
99      * Return an array of IMemory. Each IMemory object represents a section of the
100      * memory block. The IMemory object allows debug adapters to provide more information
101      * about a section of memory. Refer to IMemory for details.
102      *
103      * @param offset
104      * @param length
105      * @return
106      * @throws DebugException if the method fails.
107      */

108     public MemoryByte[] getBytesFromOffset(long offset, long length) throws DebugException;
109     
110     
111     /**
112      * Get bytes based on a given address.
113      *
114      * Return an array of IMemory. Each IMemory object represents a section of the
115      * memory block. The IMemory object allows debug adapters to provide more information
116      * about a section of memory. Refer to IMemory for details.
117      *
118      * @param address
119      * @param length
120      * @return
121      * @throws DebugException if method fails
122      */

123     public MemoryByte[] getBytesFromAddress(BigInteger JavaDoc address, long length) throws DebugException;
124
125     /**
126      * @return true if the platform is big endian, false otherwise
127      */

128     public boolean isBigEndian();
129
130     
131     /**
132      * Enable this memory block. Block is enabled when its view tab is in focus.
133      */

134     public void enable();
135     
136     
137     /**
138      * Disable this memory block. Block is disabled when its view tab loses focus.
139      */

140     public void disable();
141     
142     /**
143      * Indicate if this memory block is enabled/disabled.
144      * @return
145      */

146     public boolean isEnabled();
147     
148     
149     /**
150      * Delete this memory block.
151      */

152     public void delete();
153     
154     /**
155      * Return the IMemoryBlockRetrieval responsible for getting
156      * this memory block.
157      * @return
158      */

159     public IMemoryBlockRetrieval getMemoryBlockRetrieval();
160 }
161
Popular Tags