Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357208 - Traditional memory view does not highlight changed bytes when single steping
Summary: Traditional memory view does not highlight changed bytes when single steping
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-memory (show other bugs)
Version: 8.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: cdt-debug-inbox@eclipse.org CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-09 05:42 EDT by Phil Mason CLA
Modified: 2020-09-04 15:19 EDT (History)
3 users (show)

See Also:


Attachments
Patch that resolves the bug (2.10 KB, patch)
2011-09-09 05:45 EDT, Phil Mason CLA
no flags Details | Diff
Improved patch that runs archiveDeltas asyncronously (2.31 KB, patch)
2011-09-09 10:20 EDT, Phil Mason CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Phil Mason CLA 2011-09-09 05:42:01 EDT
Build Identifier: I20110613-1736

Single stepping through code that changes memory whilst looking at it in a traditional memory view shows the bytes as changing but does not highlight them as expected.

This seems to be because handleSuspend is being called twice each time the step occurs and highlights the changes the first time but the second call overwrites the display removing the highlight.

Reproducible: Always

Steps to Reproduce:
1. create a project that changes memory
2. open a traditional memory view looking at the memory that will change
3. single step through the code
Comment 1 Phil Mason CLA 2011-09-09 05:45:27 EDT
Created attachment 203046 [details]
Patch that resolves the bug

On my system this patch resolves the issue. 

The change is that now archiveDeltas is called on resume.
Comment 2 Phil Mason CLA 2011-09-09 10:12:53 EDT
Comment on attachment 203046 [details]
Patch that resolves the bug

From 44d6cd7e2ea5233c1141bf45c7dc131dd6b5eef1 Mon Sep 17 00:00:00 2001
From: Phil Mason <pmason@broadcom.com>
Date: Fri, 9 Sep 2011 14:44:57 +0100
Subject: [PATCH] Modified debug event handling so that historyCache is only
 updated on continue.

---
 .../cdt/debug/ui/memory/traditional/Rendering.java |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 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 3dfd908..c3dd8a9 100644
--- 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
@@ -570,6 +570,7 @@ public class Rendering extends Composite implements IDebugEventSetListener
     	boolean isChangeOnly = false;
     	boolean isSuspend = false;
     	boolean isBreakpointHit = false;
+    	boolean isContinue = false;
     	
     	for(int i = 0; i < events.length; i++)
         {	
@@ -583,6 +584,8 @@ public class Rendering extends Composite implements IDebugEventSetListener
                 if(source.getDebugTarget() == getMemoryBlock()
                         .getDebugTarget())
                 {
+                	if ((detail & DebugEvent.RESUME) != 0)
+                		isContinue = true;
                 	if((detail & DebugEvent.BREAKPOINT) != 0)
                 		isBreakpointHit = true;
                 	if(kind == DebugEvent.SUSPEND)
@@ -599,6 +602,15 @@ public class Rendering extends Composite implements IDebugEventSetListener
             }
         }
     	
+    	if (isContinue)
+    		Display.getDefault().asyncExec(new Runnable()
+            {
+                public void run()
+                {
+                	archiveDeltas();
+                }
+            });
+
     	if(isSuspend)
     		handleSuspend(isBreakpointHit);
     	else if(isChangeOnly)
@@ -614,7 +626,6 @@ public class Rendering extends Composite implements IDebugEventSetListener
             {
                 public void run()
                 {
-                	archiveDeltas();
                     refresh();
                 }
             });
-- 
1.7.6
Comment 3 Phil Mason CLA 2011-09-09 10:16:50 EDT
(In reply to comment #2)
Sorry, I thought I was editing the previous patch to replace it with an improved version. I'll add the new patch as an attachment and mark the old one as obsolete.
Comment 4 Phil Mason CLA 2011-09-09 10:20:49 EDT
Created attachment 203065 [details]
Improved patch that runs archiveDeltas asyncronously

Old patch called archiveDeltas directly. Now it uses asyncExec as it should have done.