1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

Bug 414519: [Memory View] user specified start address is not honored.

Change-Id: I0e72b6a4d685197191427c93b67b9a96d80da682
Signed-off-by: Ling Wang <ling.wang@silabs.com>
Reviewed-on: https://git.eclipse.org/r/15214
Reviewed-by: Marc Khouzam <marc.khouzam@ericsson.com>
IP-Clean: Marc Khouzam <marc.khouzam@ericsson.com>
Tested-by: Marc Khouzam <marc.khouzam@ericsson.com>
This commit is contained in:
Ling Wang 2013-08-07 01:32:48 -05:00 committed by Marc Khouzam
parent f7d49e5bde
commit 06854adaef
2 changed files with 31 additions and 6 deletions

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2006, 2010, 2012 Wind River Systems, Inc. and others. * Copyright (c) 2006, 2014 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -167,13 +167,24 @@ public class Rendering extends Composite implements IDebugEventSetListener
if (fParent.getMemoryBlock() != null) if (fParent.getMemoryBlock() != null)
{ {
// This is base address from user.
// Honor it if the block has no limits or the base is within the block limits.
// Fix Bug 414519.
BigInteger base = fParent.getBigBaseAddress();
fViewportAddress = fParent.getMemoryBlockStartAddress(); fViewportAddress = fParent.getMemoryBlockStartAddress();
// The viewport address will be null if memory may be retrieved at any // The viewport address will be null if memory may be retrieved at any
// address less than this memory block's base. If so use the base address. // address less than this memory block's base. If so use the base address.
if (fViewportAddress == null) if (fViewportAddress == null)
fViewportAddress = fParent.getBigBaseAddress(); fViewportAddress = base;
else {
BigInteger blockEndAddr = fParent.getMemoryBlockEndAddress();
if (base.compareTo(fViewportAddress) > 0) {
if (blockEndAddr == null || base.compareTo(blockEndAddr) < 0)
fViewportAddress = base;
}
}
fBaseAddress = fViewportAddress; fBaseAddress = fViewportAddress;
} }
@ -755,10 +766,10 @@ public class Rendering extends Composite implements IDebugEventSetListener
} }
@SuppressWarnings("hiding") @SuppressWarnings("hiding")
private HashMap<BigInteger, FPMemoryByte[]> fEditBuffer = new HashMap<BigInteger, FPMemoryByte[]>(); private HashMap<BigInteger, FPMemoryByte[]> fEditBuffer = new HashMap<>();
private boolean fDisposed = false; private boolean fDisposed = false;
private Object fLastQueued = null; private Object fLastQueued = null;
private Vector<Object> fQueue = new Vector<Object>(); private Vector<Object> fQueue = new Vector<>();
protected MemoryUnit fCache = null; protected MemoryUnit fCache = null;
protected MemoryUnit fHistoryCache[] = new MemoryUnit[0]; protected MemoryUnit fHistoryCache[] = new MemoryUnit[0];
protected int fHistoryDepth = 0; protected int fHistoryDepth = 0;

View file

@ -8,6 +8,7 @@
* Contributors: * Contributors:
* Ted R Williams (Wind River Systems, Inc.) - initial implementation * Ted R Williams (Wind River Systems, Inc.) - initial implementation
* Alvaro Sanchez-Leon (Ericsson AB) - [Memory] Support 16 bit addressable size (Bug 426730) * Alvaro Sanchez-Leon (Ericsson AB) - [Memory] Support 16 bit addressable size (Bug 426730)
* Ling Wang (Silicon Laboratories) - Honor start address (Bug 414519)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.debug.ui.memory.traditional; package org.eclipse.cdt.debug.ui.memory.traditional;
@ -176,12 +177,25 @@ public class Rendering extends Composite implements IDebugEventSetListener
// initialize the viewport start // initialize the viewport start
if(fParent.getMemoryBlock() != null) if(fParent.getMemoryBlock() != null)
{ {
// This is base address from user.
// Honor it if the block has no limits or the base is within the block limits.
// Fix Bug 414519.
BigInteger base = fParent.getBigBaseAddress();
fViewportAddress = fParent.getMemoryBlockStartAddress(); fViewportAddress = fParent.getMemoryBlockStartAddress();
// this will be null if memory may be retrieved at any address less than // this will be null if memory may be retrieved at any address less than
// this memory block's base. if so use the base address. // this memory block's base. if so use the base address.
if (fViewportAddress == null) if (fViewportAddress == null)
fViewportAddress = fParent.getBigBaseAddress(); fViewportAddress = base;
else {
BigInteger blockEndAddr = fParent.getMemoryBlockEndAddress();
if (base.compareTo(fViewportAddress) > 0) {
if (blockEndAddr == null || base.compareTo(blockEndAddr) < 0)
fViewportAddress = base;
}
}
fBaseAddress = fViewportAddress; fBaseAddress = fViewportAddress;
} }