From d702a8f9474364f96a35aebaffebbeb2d3533520 Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Thu, 5 Mar 2015 15:26:53 -0500 Subject: [PATCH] Bug 425698: Refresh Traditional rendering in memory view when stepping Change-Id: I61c4b502a161139f98d7b73026a863dcf4f2ad52 Signed-off-by: Marc Khouzam --- .../ui/memory/traditional/Rendering.java | 39 ++++++++++--------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/Rendering.java b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/Rendering.java index db8ba619c0b..fc5e7cfa651 100755 --- a/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/Rendering.java +++ b/memory/org.eclipse.cdt.debug.ui.memory.traditional/src/org/eclipse/cdt/debug/ui/memory/traditional/Rendering.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2014 Wind River Systems, Inc. and others. + * Copyright (c) 2006, 2015 Wind River Systems, Inc. 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 @@ -601,26 +601,27 @@ public class Rendering extends Composite implements IDebugEventSetListener final int kind = events[i].getKind(); final int detail = events[i].getDetail(); final IDebugElement source = (IDebugElement) events[i].getSource(); - /* - * We have to make sure we are comparing memory blocks here. It pretty much is now the - * case that the IDebugTarget is always null. Almost no one in the Embedded Space is - * using anything but CDT/DSF or CDT/TCF at this point. The older CDI stuff will still - * be using the old Debug Model API. But this will generate the same memory block and - * a legitimate IDebugTarget which will match properly. - */ - if(source.equals( getMemoryBlock() ) && source.getDebugTarget() == getMemoryBlock().getDebugTarget() ) + + if(source.getDebugTarget() == getMemoryBlock().getDebugTarget()) { - if((detail & DebugEvent.BREAKPOINT) != 0) - isBreakpointHit = true; - if(kind == DebugEvent.SUSPEND) + /* For CDT/DSF or CDT/TCF the IDebugTarget interface is not longer used, + * and returns null. In such a case, we should check that we are dealing + * with the correct memory block instead. + */ + if (source.getDebugTarget() != null || source.equals(getMemoryBlock())) { - handleSuspendEvent(detail); - isSuspend = true; - } - else if(kind == DebugEvent.CHANGE) - { - handleChangeEvent(); - isChangeOnly = true; + if((detail & DebugEvent.BREAKPOINT) != 0) + isBreakpointHit = true; + if(kind == DebugEvent.SUSPEND) + { + handleSuspendEvent(detail); + isSuspend = true; + } + else if(kind == DebugEvent.CHANGE) + { + handleChangeEvent(); + isChangeOnly = true; + } } } }