mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42: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 ) {
|
||||
ArrayList list = new ArrayList( expressions.length );
|
||||
for ( int i = 0; i < expressions.length; ++i ) {
|
||||
IAddress address = getDebugTarget().getAddressFactory().createAddress( expressions[i] );
|
||||
if ( address != null ) {
|
||||
if (memorySpaceIDs[i] == null) {
|
||||
list.add( new CMemoryBlockExtension( getDebugTarget(), address.toHexAddressString(), address.getValue() ) );
|
||||
} else {
|
||||
list.add( new CMemoryBlockExtension( getDebugTarget(), address.getValue(), memorySpaceIDs[i] ) );
|
||||
try {
|
||||
IAddress address = getDebugTarget().getAddressFactory().createAddress( expressions[i] );
|
||||
if ( address != null ) {
|
||||
if (memorySpaceIDs[i] == null) {
|
||||
list.add( new CMemoryBlockExtension( getDebugTarget(), address.toHexAddressString(), address.getValue() ) );
|
||||
} 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()] ) );
|
||||
|
|
Loading…
Add table
Reference in a new issue