|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.cmpware.gdb.RSP
com.cmpware.gdb.FIF
public class FIF
This class provides a Funtional interFace (FIF) to the GDB server. It makes use of the underlying Remote Serial Protocol (RSP). This interface is mostly read / write registers / memory. Methods make use of caching to improve performance over the serial protocol. Note that while reads may be cached, writes are always direct. This resembles a 'write through' protocol.
Copyright (c) 2007 Cmpware, Inc. All Rights Reserved.
| Field Summary | |
|---|---|
protected int |
cacheSize
The cache size / maximum buffer size |
protected int |
cacheStartAddr
The current memory cache start address |
static java.lang.String |
copyright
Copyright string |
static boolean |
DEBUG
The debug flag |
protected java.lang.String |
memCache
The memory cache |
protected java.lang.String |
regCache
The register cache |
protected int |
regSize
The register size (in bytes) |
| Fields inherited from class com.cmpware.gdb.RSP |
|---|
in, out, socket |
| Constructor Summary | |
|---|---|
FIF()
|
|
| Method Summary | |
|---|---|
long[] |
getDebugRegisters()
This method returns an array of longs representing the general purpose registers. |
long |
getRegister(int i)
This method returns a long representing a register. |
long |
getRegisterImm(int i)
This method returns a long representing a general purpose register. |
int[] |
getRegisters()
This method returns an array of integers representing the general purpose registers. |
int |
getRegisterSize()
This method returns the regiser size, in bytes. |
static void |
main(java.lang.String[] args)
This main program is used for testing. |
long |
read(int addr,
int bytes)
This method reads data and returns a long. |
long |
readImm(int addr,
int bytes)
This method reads data and returns a long. |
void |
setRegister(int i,
long data)
This method sets a register. |
void |
setRegisterSize(int regSize)
This method sets the register size. |
void |
step(int i)
This method steps the target. |
void |
write(int addr,
byte[] data)
This method writes a buffer of data to the host. |
void |
write(int addr,
int bytes,
long data)
This method is used to write between one and eight bytes of data to the target. |
| Methods inherited from class com.cmpware.gdb.RSP |
|---|
checksum, connect, disconnect, isError, isOk, isPacket, recv, recvPacket, send, sendPacket |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final boolean DEBUG
public static final java.lang.String copyright
protected int cacheSize
protected int cacheStartAddr
protected java.lang.String memCache
protected java.lang.String regCache
protected int regSize
| Constructor Detail |
|---|
public FIF()
| Method Detail |
|---|
public static void main(java.lang.String[] args)
public void setRegisterSize(int regSize)
regSize - the register size, in bytes.public int getRegisterSize()
public int[] getRegisters()
throws java.io.IOException
java.io.IOException - if there is a communication error.
public long[] getDebugRegisters()
throws java.io.IOException
java.io.IOException - if there is a communication error.
public long getRegister(int i)
throws java.io.IOException
i - the index of the register.
java.io.IOException - if there is a communication error.
public long getRegisterImm(int i)
throws java.io.IOException
i - the index of the register.
java.io.IOException - if there is a communication error.
public void setRegister(int i,
long data)
throws java.io.IOException
i - the register numberdata - the register data to be written.
java.io.IOException - if there is a communication error.
public long readImm(int addr,
int bytes)
throws java.io.IOException
addr - the memory address.bytes - the number of bytes to read (should be 1 - 8).
java.io.IOException - is thrown if any communication
errors occur during this method call.
public long read(int addr,
int bytes)
throws java.io.IOException
addr - the memory address.bytes - the number of bytes to read (should be 1 - 8).
java.io.IOException - is thrown if any communication
errors occur during this method call.
public void write(int addr,
int bytes,
long data)
throws java.io.IOException
addr - the address th which the data is written.bytes - the number of bytes to be written. Should
be a value between one and eight.data - the data to be written, in the form of a 64-bit
long integer.
java.io.IOException - is thrown if any communication
errors occur during this method call.
public void write(int addr,
byte[] data)
throws java.io.IOException
addr - the address to which to write the buffer.data - the data to be written.
java.io.IOException - is thrown if any communication
errors occur during this method call.
public void step(int i)
throws java.io.IOException
i - the number of cycles to step the tareget.
java.io.IOException - is thrown if any communication
errors occur during this method call.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||