mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 00:45:28 +02:00
Minor refactoring.
This commit is contained in:
parent
dbc7af08fd
commit
dc43232b88
2 changed files with 24 additions and 17 deletions
|
@ -1,3 +1,7 @@
|
|||
2005-05-21 Mikhail Khodjaiants
|
||||
Minor refactoring.
|
||||
* CMemoryBlockExtension.java
|
||||
|
||||
2005-05-21 Mikhail Khodjaiants
|
||||
Bug 91374: CDT launch should set ATTR_PROCESS_TYPE.
|
||||
* ICDTLaunchConfigurationConstants.java
|
||||
|
|
|
@ -155,23 +155,7 @@ public class CMemoryBlockExtension extends CDebugElement implements IMemoryBlock
|
|||
}
|
||||
fBytes = new MemoryByte[bytes.length];
|
||||
for ( int i = 0; i < bytes.length; ++i ) {
|
||||
byte cdiFlags = getCDIBlock().getFlags( i );
|
||||
byte flags = 0;
|
||||
if ( (cdiFlags & ICDIMemoryBlock.VALID) != 0 ) {
|
||||
flags |= MemoryByte.HISTORY_KNOWN | MemoryByte.ENDIANESS_KNOWN;
|
||||
if ( (cdiFlags & ICDIMemoryBlock.READ_ONLY) != 0 ) {
|
||||
flags |= MemoryByte.READABLE;
|
||||
}
|
||||
else {
|
||||
flags |= MemoryByte.READABLE | MemoryByte.WRITABLE;
|
||||
}
|
||||
if ( isBigEndian() ) {
|
||||
flags |= MemoryByte.BIG_ENDIAN;
|
||||
}
|
||||
if ( hasChanged( getRealBlockAddress().add( BigInteger.valueOf( i ) ) ) )
|
||||
flags |= MemoryByte.CHANGED;
|
||||
}
|
||||
fBytes[i] = new MemoryByte( bytes[i], flags );
|
||||
fBytes[i] = createMemoryByte( bytes[i], getCDIBlock().getFlags( i ), hasChanged( getRealBlockAddress().add( BigInteger.valueOf( i ) ) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -453,4 +437,23 @@ public class CMemoryBlockExtension extends CDebugElement implements IMemoryBlock
|
|||
}
|
||||
return BigInteger.ZERO;
|
||||
}
|
||||
|
||||
private MemoryByte createMemoryByte( byte value, byte cdiFlags, boolean changed ) {
|
||||
byte flags = 0;
|
||||
if ( (cdiFlags & ICDIMemoryBlock.VALID) != 0 ) {
|
||||
flags |= MemoryByte.HISTORY_KNOWN | MemoryByte.ENDIANESS_KNOWN;
|
||||
if ( (cdiFlags & ICDIMemoryBlock.READ_ONLY) != 0 ) {
|
||||
flags |= MemoryByte.READABLE;
|
||||
}
|
||||
else {
|
||||
flags |= MemoryByte.READABLE | MemoryByte.WRITABLE;
|
||||
}
|
||||
if ( isBigEndian() ) {
|
||||
flags |= MemoryByte.BIG_ENDIAN;
|
||||
}
|
||||
if ( changed )
|
||||
flags |= MemoryByte.CHANGED;
|
||||
}
|
||||
return new MemoryByte( value, flags );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue