diff options
author | Darin Wright | 2010-09-24 21:17:56 +0000 |
---|---|---|
committer | Darin Wright | 2010-09-24 21:17:56 +0000 |
commit | 60eed8be58af6a1378c2f7e62049e3ac705e139c (patch) | |
tree | 06be8c4b9c6116cf1c278209fab44301fa154ca3 /org.eclipse.debug.examples.core | |
parent | cbacf44a4092b759d29aeb53c2fab97e1cbf96ff (diff) | |
download | eclipse.platform.debug-60eed8be58af6a1378c2f7e62049e3ac705e139c.tar.gz eclipse.platform.debug-60eed8be58af6a1378c2f7e62049e3ac705e139c.tar.xz eclipse.platform.debug-60eed8be58af6a1378c2f7e62049e3ac705e139c.zip |
Bug 326152 - [Memory View] new monitors added while Memory view is hidden or closed are not shown in the tree
Diffstat (limited to 'org.eclipse.debug.examples.core')
3 files changed, 84 insertions, 3 deletions
diff --git a/org.eclipse.debug.examples.core/META-INF/MANIFEST.MF b/org.eclipse.debug.examples.core/META-INF/MANIFEST.MF index a7f7a8a56..af515714a 100644 --- a/org.eclipse.debug.examples.core/META-INF/MANIFEST.MF +++ b/org.eclipse.debug.examples.core/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Example Debug Core Plug-in Bundle-SymbolicName: org.eclipse.debug.examples.core;singleton:=true -Bundle-Version: 1.2.0.qualifier +Bundle-Version: 1.3.0.qualifier Bundle-Activator: org.eclipse.debug.examples.core.pda.DebugCorePlugin Require-Bundle: org.eclipse.core.runtime, org.eclipse.core.resources, diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugTarget.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugTarget.java index 92a5a9955..cd275b7ff 100644 --- a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugTarget.java +++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDADebugTarget.java @@ -394,13 +394,13 @@ public class PDADebugTarget extends PDADebugElement implements IDebugTarget, IBr * @see org.eclipse.debug.core.model.IMemoryBlockRetrieval#supportsStorageRetrieval() */ public boolean supportsStorageRetrieval() { - return false; + return true; } /* (non-Javadoc) * @see org.eclipse.debug.core.model.IMemoryBlockRetrieval#getMemoryBlock(long, long) */ public IMemoryBlock getMemoryBlock(long startAddress, long length) throws DebugException { - return null; + return new PDAMemoryBlock(this, startAddress, length); } /** diff --git a/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAMemoryBlock.java b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAMemoryBlock.java new file mode 100644 index 000000000..822f5faf4 --- /dev/null +++ b/org.eclipse.debug.examples.core/src/org/eclipse/debug/examples/core/pda/model/PDAMemoryBlock.java @@ -0,0 +1,81 @@ +/******************************************************************************* + * Copyright (c) 2010 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.debug.examples.core.pda.model; + +import org.eclipse.debug.core.DebugEvent; +import org.eclipse.debug.core.DebugException; +import org.eclipse.debug.core.model.IMemoryBlock; + +/** + * Example memory block + */ +public class PDAMemoryBlock extends PDADebugElement implements IMemoryBlock { + + /** + * The bytes + */ + private byte[] fBytes = null; + private long fStart, fLength; + + /** + * Constructs a new memory block + */ + public PDAMemoryBlock(PDADebugTarget target, long start, long length) { + super(target); + fBytes = new byte[(int)length]; + fStart = start; + fLength = length; + byte b = 0; + for (int i = 0; i < fBytes.length; i++) { + fBytes[i] = b++; + } + } + + /* (non-Javadoc) + * @see org.eclipse.debug.core.model.IMemoryBlock#getStartAddress() + */ + public long getStartAddress() { + return fStart; + } + + /* (non-Javadoc) + * @see org.eclipse.debug.core.model.IMemoryBlock#getLength() + */ + public long getLength() { + return fLength; + } + + /* (non-Javadoc) + * @see org.eclipse.debug.core.model.IMemoryBlock#getBytes() + */ + public byte[] getBytes() throws DebugException { + return fBytes; + } + + /* (non-Javadoc) + * @see org.eclipse.debug.core.model.IMemoryBlock#supportsValueModification() + */ + public boolean supportsValueModification() { + return true; + } + + /* (non-Javadoc) + * @see org.eclipse.debug.core.model.IMemoryBlock#setValue(long, byte[]) + */ + public void setValue(long offset, byte[] bytes) throws DebugException { + int i = 0; + while (offset < fBytes.length && i < bytes.length) { + fBytes[(int)offset++] = bytes[i++]; + } + fireChangeEvent(DebugEvent.CONTENT); + } + +} |