mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Fixed 187308. Expect and gracefully handle a NumberFormatException when creating a memory block from an expression.
This commit is contained in:
parent
b6e3d64778
commit
fddd30f6bc
1 changed files with 10 additions and 6 deletions
|
@ -136,13 +136,17 @@ public class CMemoryBlockRetrievalExtension extends PlatformObject implements IM
|
||||||
private void createMemoryBlocks( String[] expressions, String[] memorySpaceIDs ) {
|
private void createMemoryBlocks( String[] expressions, String[] memorySpaceIDs ) {
|
||||||
ArrayList list = new ArrayList( expressions.length );
|
ArrayList list = new ArrayList( expressions.length );
|
||||||
for ( int i = 0; i < expressions.length; ++i ) {
|
for ( int i = 0; i < expressions.length; ++i ) {
|
||||||
IAddress address = getDebugTarget().getAddressFactory().createAddress( expressions[i] );
|
try {
|
||||||
if ( address != null ) {
|
IAddress address = getDebugTarget().getAddressFactory().createAddress( expressions[i] );
|
||||||
if (memorySpaceIDs[i] == null) {
|
if ( address != null ) {
|
||||||
list.add( new CMemoryBlockExtension( getDebugTarget(), address.toHexAddressString(), address.getValue() ) );
|
if (memorySpaceIDs[i] == null) {
|
||||||
} else {
|
list.add( new CMemoryBlockExtension( getDebugTarget(), address.toHexAddressString(), address.getValue() ) );
|
||||||
list.add( new CMemoryBlockExtension( getDebugTarget(), address.getValue(), memorySpaceIDs[i] ) );
|
} else {
|
||||||
|
list.add( new CMemoryBlockExtension( getDebugTarget(), address.getValue(), memorySpaceIDs[i] ) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (NumberFormatException exc) {
|
||||||
|
CDebugCorePlugin.log(exc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DebugPlugin.getDefault().getMemoryBlockManager().addMemoryBlocks( (IMemoryBlock[])list.toArray( new IMemoryBlock[list.size()] ) );
|
DebugPlugin.getDefault().getMemoryBlockManager().addMemoryBlocks( (IMemoryBlock[])list.toArray( new IMemoryBlock[list.size()] ) );
|
||||||
|
|
Loading…
Add table
Reference in a new issue