KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > core > model > IMemoryBlock


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

11 package org.eclipse.debug.core.model;
12
13
14 import org.eclipse.debug.core.DebugException;
15  
16 /**
17  * A contiguous segment of memory in an execution context.
18  * A memory block is represented by a starting memory address
19  * and a length. Not all debug architectures support the retrieval
20  * of memory blocks.
21  * <p>
22  * Clients may implement this interface.
23  * </p>
24  * @see IMemoryBlockRetrieval
25  * @since 2.0
26  */

27 public interface IMemoryBlock extends IDebugElement {
28     
29     /**
30      * Returns the start address of this memory block.
31      *
32      * @return the start address of this memory block
33      */

34     public long getStartAddress();
35     
36     /**
37      * Returns the length of this memory block in bytes.
38      *
39      * @return the length of this memory block in bytes
40      */

41     public long getLength();
42     
43     /**
44      * Returns the values of the bytes currently contained
45      * in this this memory block.
46      *
47      * @return the values of the bytes currently contained
48      * in this this memory block
49      * @exception DebugException if this method fails. Reasons include:
50      * <ul><li>Failure communicating with the debug target. The DebugException's
51      * status code contains the underlying exception responsible for
52      * the failure.</li>
53      * </ul>
54      */

55     public byte[] getBytes() throws DebugException;
56     
57     /**
58      * Returns whether this memory block supports value modification
59      *
60      * @return whether this memory block supports value modification
61      */

62     public boolean supportsValueModification();
63     
64     /**
65      * Sets the value of the bytes in this memory block at the specified
66      * offset within this memory block to the specified bytes.
67      * The offset is zero based.
68      *
69      * @param offset the offset at which to set the new values
70      * @param bytes the new values
71      * @exception DebugException if this method fails. Reasons include:
72      * <ul><li>Failure communicating with the debug target. The DebugException's
73      * status code contains the underlying exception responsible for
74      * the failure.</li>
75      * <li>This memory block does not support value modification</li>
76      * <li>The specified offset is greater than or equal to the length
77      * of this memory block, or the number of bytes specified goes
78      * beyond the end of this memory block (index of out of range)</li>
79      * </ul>
80      */

81     public void setValue(long offset, byte[] bytes) throws DebugException;
82     
83 }
84
85
Popular Tags