Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 220917 Details for
Bug 389197
[debug view] If user expands stack trace, it should re-expand after a suspended event.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch with fix.
0001-Bug-389197-debug-view-If-user-expands-stack-trace-it.patch (text/plain), 7.11 KB, created by
Pawel Piech
on 2012-09-10 18:06:47 EDT
(
hide
)
Description:
Patch with fix.
Filename:
MIME Type:
Creator:
Pawel Piech
Created:
2012-09-10 18:06:47 EDT
Size:
7.11 KB
patch
obsolete
>From c1e700662b1a6f53e7449931999b1eee4b1e4deb Mon Sep 17 00:00:00 2001 >From: Pawel Piech <pawel.piech@windriver.com> >Date: Mon, 10 Sep 2012 14:21:48 -0700 >Subject: [PATCH] Bug 389197 - [debug view] If user expands stack trace, it > should re-expand after a suspended event > >--- > .../tcf/internal/debug/ui/model/TCFModel.java | 9 ++- > .../tcf/internal/debug/ui/model/TCFModelProxy.java | 52 +++++++++++++++++++- > 2 files changed, 57 insertions(+), 4 deletions(-) > >diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java >index 2ed4a32..4bb90c1 100644 >--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java >+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java >@@ -158,6 +158,9 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab > UPDATE_POLICY_MANUAL = 1, > UPDATE_POLICY_BREAKPOINT = 2; > >+ /** View property indicating whether to expand a stack trace on suspend. */ >+ public static final String PROP_EXPAND_ON_SUSPEND = Activator.PLUGIN_ID + ".PROP_EXPAND_ON_SUSPEND"; >+ > /** > * A dummy editor input to open the disassembly view as editor. > */ >@@ -1529,14 +1532,14 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab > if (node.isDisposed()) return; > runSuspendTrigger(node); > if (reason == null) return; >- if (reason.equals(IRunControl.REASON_USER_REQUEST)) return; > for (TCFModelProxy proxy : model_proxies.values()) { > if (proxy.getPresentationContext().getId().equals(IDebugUIConstants.ID_DEBUG_VIEW)) { > proxy.setSelection(node); >- if (reason.equals(IRunControl.REASON_STEP)) continue; > if (reason.equals(IRunControl.REASON_CONTAINER)) continue; >+ if (expanded_nodes.add(node.id) || proxy.getExpandStack()) proxy.expand(node); >+ if (reason.equals(IRunControl.REASON_USER_REQUEST)) continue; >+ if (reason.equals(IRunControl.REASON_STEP)) continue; > if (delay_stack_update_until_last_step && launch.getContextActionsCount(node.id) != 0) continue; >- if (expanded_nodes.add(node.id)) proxy.expand(node); > } > if (reason.equals(IRunControl.REASON_BREAKPOINT)) { > IWorkbenchPart part = proxy.getPresentationContext().getPart(); >diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModelProxy.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModelProxy.java >index c59f7d2..1a21e27 100644 >--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModelProxy.java >+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModelProxy.java >@@ -32,7 +32,10 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdateList > import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta; > import org.eclipse.debug.internal.ui.viewers.provisional.AbstractModelProxy; > import org.eclipse.debug.ui.IDebugUIConstants; >+import org.eclipse.jface.viewers.ITreeViewerListener; >+import org.eclipse.jface.viewers.TreeExpansionEvent; > import org.eclipse.jface.viewers.TreePath; >+import org.eclipse.jface.viewers.TreeViewer; > import org.eclipse.swt.graphics.Device; > import org.eclipse.swt.widgets.Display; > import org.eclipse.tcf.internal.debug.model.TCFLaunch; >@@ -44,7 +47,7 @@ import org.eclipse.tcf.protocol.Protocol; > * Model proxy listeners are debuggers views. > */ > @SuppressWarnings("restriction") >-public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Runnable { >+public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Runnable, ITreeViewerListener { > > private static final TCFNode[] EMPTY_NODE_ARRAY = new TCFNode[0]; > >@@ -67,6 +70,7 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru > private boolean enable_auto_expand; > private Set<TCFNode> auto_expand_removed_nodes; > private Set<TCFNode> auto_expand_created_nodes; >+ private boolean expand_stack; > > private final Runnable timer = new Runnable() { > >@@ -202,6 +206,10 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru > IDebugUIConstants.ID_DEBUG_VIEW.equals(getPresentationContext().getId()) && > viewer instanceof InternalTreeModelViewer; > viewer.addViewerUpdateListener(update_listener); >+ if (viewer instanceof TreeViewer) { >+ ((TreeViewer)viewer).addTreeListener(this); >+ } >+ expand_stack = Boolean.TRUE.equals( getPresentationContext().getProperty(TCFModel.PROP_EXPAND_ON_SUSPEND) ); > Protocol.invokeAndWait(new Runnable() { > public void run() { > assert !installed; >@@ -226,6 +234,9 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru > } > }); > viewer.removeViewerUpdateListener(update_listener); >+ if (viewer instanceof TreeViewer) { >+ ((TreeViewer)viewer).removeTreeListener(this); >+ } > super.dispose(); > } > >@@ -281,6 +292,13 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru > } > > /** >+ * Returns true if stack trace should be expanded upon a suspended event. >+ */ >+ boolean getExpandStack() { >+ return expand_stack; >+ } >+ >+ /** > * Get current value of the view input. > * @return view input object. > */ >@@ -566,4 +584,36 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru > launch.removePendingClient(this); > } > } >+ >+ @Override >+ public void treeCollapsed(TreeExpansionEvent event) { >+ updateExpandStack(event, false); >+ } >+ >+ @Override >+ public void treeExpanded(TreeExpansionEvent event) { >+ updateExpandStack(event, true); >+ } >+ >+ private void updateExpandStack(TreeExpansionEvent event, final boolean expand) { >+ if (event.getElement() instanceof TCFNodeExecContext) { >+ final TCFNodeExecContext node = (TCFNodeExecContext)event.getElement(); >+ if ( !model.equals(node.getModel()) ) return; >+ Protocol.invokeLater(new Runnable() { >+ @Override >+ public void run() { >+ Boolean hasStack = node.getStackTrace().checkHasChildren(this); >+ if (hasStack == null) return; >+ if (hasStack && expand_stack != expand) { >+ expand_stack = expand; >+ viewer.getDisplay().asyncExec(new Runnable() { >+ public void run() { >+ getPresentationContext().setProperty(TCFModel.PROP_EXPAND_ON_SUSPEND, expand_stack); >+ } >+ }); >+ } >+ } >+ }); >+ } >+ } > } >-- >1.7.5.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 389197
:
220917
|
220953
|
221006