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 189768 Details for
Bug 338136
[debug view] Don't show the inferior process in the debug view
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]
Prototype using a new preference
zpatch.multiInferiorPref.txt (text/plain), 15.45 KB, created by
Marc Khouzam
on 2011-02-24 21:32:10 EST
(
hide
)
Description:
Prototype using a new preference
Filename:
MIME Type:
Creator:
Marc Khouzam
Created:
2011-02-24 21:32:10 EST
Size:
15.45 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.dsf.gdb >Index: src/org/eclipse/cdt/dsf/gdb/IGdbDebugPreferenceConstants.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/gdb/IGdbDebugPreferenceConstants.java,v >retrieving revision 1.6 >diff -u -r1.6 IGdbDebugPreferenceConstants.java >--- src/org/eclipse/cdt/dsf/gdb/IGdbDebugPreferenceConstants.java 3 Feb 2011 17:08:09 -0000 1.6 >+++ src/org/eclipse/cdt/dsf/gdb/IGdbDebugPreferenceConstants.java 24 Feb 2011 19:29:27 -0000 >@@ -38,6 +38,12 @@ > public static final String PREF_AUTO_TERMINATE_GDB = "autoTerminateGdb"; //$NON-NLS-1$ > > /** >+ * Boolean preference whether to show inferior processes in the debug view. Default is <code>true</code>. >+ * @since 4.0 >+ */ >+ public static final String PREF_SHOW_INFERIORS = "showInferiors"; //$NON-NLS-1$ >+ >+ /** > * Boolean preference whether to use the advanced Inspect debug text hover. Default is <code>true</code>. > * @since 3.0 > */ >#P org.eclipse.cdt.dsf.gdb.ui >Index: src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/GdbDebugPreferencePage.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/GdbDebugPreferencePage.java,v >retrieving revision 1.9 >diff -u -r1.9 GdbDebugPreferencePage.java >--- src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/GdbDebugPreferencePage.java 7 Feb 2011 15:30:52 -0000 1.9 >+++ src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/GdbDebugPreferencePage.java 24 Feb 2011 19:29:27 -0000 >@@ -177,6 +177,22 @@ > group.setLayout(groupLayout); > > group= new Group(parent, SWT.NONE); >+ group.setText(MessagesForPreferences.GdbDebugPreferencePage_display_label); >+ groupLayout= new GridLayout(3, false); >+ group.setLayout(groupLayout); >+ group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); >+ >+ boolField= new BooleanFieldEditor( >+ IGdbDebugPreferenceConstants.PREF_SHOW_INFERIORS, >+ MessagesForPreferences.GdbDebugPreferencePage_showInferiors_label, >+ group); >+ >+ boolField.fillIntoGrid(group, 3); >+ addField(boolField); >+ // need to set layout again >+ group.setLayout(groupLayout); >+ >+ group= new Group(parent, SWT.NONE); > group.setText(MessagesForPreferences.GdbDebugPreferencePage_hover_label); > groupLayout= new GridLayout(3, false); > group.setLayout(groupLayout); >Index: src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/GdbPreferenceInitializer.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/GdbPreferenceInitializer.java,v >retrieving revision 1.6 >diff -u -r1.6 GdbPreferenceInitializer.java >--- src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/GdbPreferenceInitializer.java 3 Feb 2011 17:08:12 -0000 1.6 >+++ src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/GdbPreferenceInitializer.java 24 Feb 2011 19:29:27 -0000 >@@ -27,6 +27,7 @@ > store.setDefault(IGdbDebugPreferenceConstants.PREF_TRACES_ENABLE, true); > store.setDefault(IGdbDebugPreferenceConstants.PREF_MAX_GDB_TRACES, 500000); > store.setDefault(IGdbDebugPreferenceConstants.PREF_AUTO_TERMINATE_GDB, true); >+ store.setDefault(IGdbDebugPreferenceConstants.PREF_SHOW_INFERIORS, true); > store.setDefault(IGdbDebugPreferenceConstants.PREF_USE_INSPECTOR_HOVER, true); > store.setDefault(IGdbDebugPreferenceConstants.PREF_ENABLE_PRETTY_PRINTING, true); > store.setDefault(IGdbDebugPreferenceConstants.PREF_INITIAL_CHILD_COUNT_LIMIT_FOR_COLLECTIONS, 100); >Index: src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/MessagesForPreferences.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/MessagesForPreferences.java,v >retrieving revision 1.7 >diff -u -r1.7 MessagesForPreferences.java >--- src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/MessagesForPreferences.java 3 Feb 2011 17:08:12 -0000 1.7 >+++ src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/MessagesForPreferences.java 24 Feb 2011 19:29:27 -0000 >@@ -24,6 +24,10 @@ > public static String GdbDebugPreferencePage_maxGdbTraces_label; > public static String GdbDebugPreferencePage_termination_label; > public static String GdbDebugPreferencePage_autoTerminateGdb_label; >+ /** @since 2.2 */ >+ public static String GdbDebugPreferencePage_display_label; >+ /** @since 2.2 */ >+ public static String GdbDebugPreferencePage_showInferiors_label; > public static String GdbDebugPreferencePage_hover_label; > public static String GdbDebugPreferencePage_useInspectorHover_label; > /** @since 2.2 */ >Index: src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/MessagesForPreferences.properties >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/MessagesForPreferences.properties,v >retrieving revision 1.5 >diff -u -r1.5 MessagesForPreferences.properties >--- src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/MessagesForPreferences.properties 7 Feb 2011 15:30:52 -0000 1.5 >+++ src/org/eclipse/cdt/dsf/gdb/internal/ui/preferences/MessagesForPreferences.properties 24 Feb 2011 19:29:27 -0000 >@@ -17,7 +17,8 @@ > GdbDebugPreferencePage_maxGdbTraces_label=Limit GDB traces output (number of characters): > GdbDebugPreferencePage_termination_label=Termination > GdbDebugPreferencePage_autoTerminateGdb_label=Terminate GDB when last process exits >- >+GdbDebugPreferencePage_display_label=Display >+GdbDebugPreferencePage_showInferiors_label=Show inferiors in the debug view > GdbDebugPreferencePage_hover_label=Debug Text Hover > GdbDebugPreferencePage_useInspectorHover_label=Use enhanced debug hover > >Index: src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/launch/GdbStandardProcessVMNode.java >=================================================================== >RCS file: src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/launch/GdbStandardProcessVMNode.java >diff -N src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/launch/GdbStandardProcessVMNode.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/launch/GdbStandardProcessVMNode.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,200 @@ >+/******************************************************************************* >+ * Copyright (c) 2011 Ericsson 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: >+ * Ericsson - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.cdt.dsf.gdb.internal.ui.viewmodel.launch; >+ >+import org.eclipse.cdt.dsf.concurrent.RequestMonitor; >+import org.eclipse.cdt.dsf.debug.ui.viewmodel.launch.StandardProcessVMNode; >+import org.eclipse.cdt.dsf.gdb.IGdbDebugPreferenceConstants; >+import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin; >+import org.eclipse.cdt.dsf.gdb.launching.GDBProcess; >+import org.eclipse.cdt.dsf.ui.viewmodel.AbstractVMProvider; >+import org.eclipse.cdt.dsf.ui.viewmodel.VMDelta; >+import org.eclipse.debug.core.DebugEvent; >+import org.eclipse.debug.core.ILaunch; >+import org.eclipse.debug.core.model.IProcess; >+import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenCountUpdate; >+import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate; >+import org.eclipse.debug.internal.ui.viewers.model.provisional.IHasChildrenUpdate; >+import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta; >+import org.eclipse.jface.preference.IPreferenceStore; >+import org.eclipse.jface.util.IPropertyChangeListener; >+import org.eclipse.jface.util.PropertyChangeEvent; >+import org.eclipse.jface.viewers.TreePath; >+ >+/** >+ * Layout node for the standard platform debug model IProcess object. This >+ * node requires that an ILaunch object be found as an ancestor of this node. >+ * It does not implement the label provider functionality, so the default >+ * adapters should be used to retrieve the label. >+ */ >+public class GdbStandardProcessVMNode extends StandardProcessVMNode { >+ >+ private Class<?> fProcessType = IProcess.class; >+ >+ private IPropertyChangeListener fPropertyListener = new IPropertyChangeListener() { >+ public void propertyChange(PropertyChangeEvent event) { >+ if (event.getProperty().equals(IGdbDebugPreferenceConstants.PREF_SHOW_INFERIORS)) { >+ showInferiors((Boolean)event.getNewValue()); >+ // khouzam, need to refresh the debug view... >+ } >+ } >+ }; >+ >+ public GdbStandardProcessVMNode(AbstractVMProvider provider) { >+ super(provider); >+ >+ IPreferenceStore store = GdbUIPlugin.getDefault().getPreferenceStore(); >+ showInferiors(store.getBoolean(IGdbDebugPreferenceConstants.PREF_SHOW_INFERIORS)); >+ store.addPropertyChangeListener(fPropertyListener); >+ } >+ >+ @Override >+ public String toString() { >+ return "GdbStandardProcessVMNode"; //$NON-NLS-1$ >+ } >+ >+ @Override >+ public void dispose() { >+ GdbUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(fPropertyListener); >+ super.dispose(); >+ } >+ >+ >+ private void showInferiors(boolean show) { >+ if (show) { >+ fProcessType = IProcess.class; >+ } else { >+ fProcessType = GDBProcess.class; >+ } >+ } >+ >+ @Override >+ public void update(IChildrenUpdate[] updates) { >+ for (IChildrenUpdate update : updates) { >+ ILaunch launch = findLaunch(update.getElementPath()); >+ if (launch == null) { >+ // There is no launch in the parent of this node. This means that the >+ // layout is misconfigured. >+ assert false; >+ update.done(); >+ continue; >+ } >+ >+ /* >+ * Assume that the process objects are stored within the launch, and >+ * retrieve them on dispatch thread. >+ */ >+ int count = 0; >+ for (IProcess process : launch.getProcesses()) { >+ if (fProcessType.isAssignableFrom(process.getClass())) { >+ update.setChild(process, count++); >+ } >+ } >+ update.done(); >+ } >+ } >+ >+ @Override >+ public void update(final IChildrenCountUpdate[] updates) { >+ for (IChildrenCountUpdate update : updates) { >+ if (!checkUpdate(update)) continue; >+ ILaunch launch = findLaunch(update.getElementPath()); >+ if (launch == null) { >+ assert false; >+ update.setChildCount(0); >+ update.done(); >+ return; >+ } >+ >+ int count = 0; >+ for (IProcess process : launch.getProcesses()) { >+ if (fProcessType.isAssignableFrom(process.getClass())) { >+ count++; >+ } >+ } >+ update.setChildCount(count); >+ update.done(); >+ } >+ } >+ >+ // @see org.eclipse.cdt.dsf.ui.viewmodel.IViewModelLayoutNode#hasElements(org.eclipse.cdt.dsf.ui.viewmodel.IVMContext, org.eclipse.cdt.dsf.concurrent.DataRequestMonitor) >+ @Override >+ public void update(IHasChildrenUpdate[] updates) { >+ for (IHasChildrenUpdate update : updates) { >+ ILaunch launch = findLaunch(update.getElementPath()); >+ if (launch == null) { >+ assert false; >+ update.setHasChilren(false); >+ update.done(); >+ return; >+ } >+ >+ boolean hasChildren = false; >+ for (IProcess process : launch.getProcesses()) { >+ if (fProcessType.isAssignableFrom(process.getClass())) { >+ hasChildren = true; >+ break; >+ } >+ } >+ >+ update.setHasChilren(hasChildren); >+ update.done(); >+ } >+ } >+ >+ /** >+ * Recursively searches the VMC for Launch VMC, and returns its ILaunch. >+ * Returns null if an ILaunch is not found. >+ */ >+ private ILaunch findLaunch(TreePath path) { >+ for (int i = path.getSegmentCount() - 1; i >= 0; i--) { >+ if (path.getSegment(i) instanceof ILaunch) { >+ return (ILaunch)path.getSegment(i); >+ } >+ } >+ return null; >+ } >+ >+ @Override >+ public int getDeltaFlags(Object e) { >+ int myFlags = 0; >+ if (e instanceof DebugEvent) { >+ DebugEvent de = (DebugEvent)e; >+ if (fProcessType.isAssignableFrom(de.getSource().getClass()) && >+ (de.getKind() == DebugEvent.CHANGE || >+ de.getKind() == DebugEvent.CREATE || >+ de.getKind() == DebugEvent.TERMINATE) ) >+ { >+ myFlags = IModelDelta.STATE; >+ } >+ } >+ return myFlags; >+ } >+ >+ @Override >+ public void buildDelta(Object e, VMDelta parent, int nodeOffset, RequestMonitor requestMonitor) { >+ if (e instanceof DebugEvent && fProcessType.isAssignableFrom(((DebugEvent)e).getSource().getClass())) { >+ DebugEvent de = (DebugEvent)e; >+ if (de.getKind() == DebugEvent.CHANGE) { >+ handleChange(de, parent); >+ } else if (de.getKind() == DebugEvent.CREATE) { >+ handleCreate(de, parent); >+ } else if (de.getKind() == DebugEvent.TERMINATE) { >+ handleTerminate(de, parent); >+ } >+ /* >+ * No other node should need to process events related to process. >+ * Therefore, just invoke the request monitor without calling super.buildDelta(). >+ */ >+ } >+ requestMonitor.done(); >+ } >+} >Index: src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/launch/LaunchVMProvider.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/launch/LaunchVMProvider.java,v >retrieving revision 1.4 >diff -u -r1.4 LaunchVMProvider.java >--- src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/launch/LaunchVMProvider.java 3 Jun 2010 00:11:22 -0000 1.4 >+++ src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/launch/LaunchVMProvider.java 24 Feb 2011 19:29:28 -0000 >@@ -25,7 +25,6 @@ > import org.eclipse.cdt.dsf.debug.ui.viewmodel.launch.AbstractLaunchVMProvider; > import org.eclipse.cdt.dsf.debug.ui.viewmodel.launch.LaunchRootVMNode; > import org.eclipse.cdt.dsf.debug.ui.viewmodel.launch.StackFramesVMNode; >-import org.eclipse.cdt.dsf.debug.ui.viewmodel.launch.StandardProcessVMNode; > import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin; > import org.eclipse.cdt.dsf.gdb.service.IGDBTraceControl.ITracingStartedDMEvent; > import org.eclipse.cdt.dsf.gdb.service.IGDBTraceControl.ITracingStoppedDMEvent; >@@ -56,7 +55,7 @@ > > // Container node to contain all processes and threads > IVMNode containerNode = new ContainerVMNode(this, getSession()); >- IVMNode processesNode = new StandardProcessVMNode(this); >+ IVMNode processesNode = new GdbStandardProcessVMNode(this); > addChildNodes(launchNode, new IVMNode[] { containerNode, processesNode}); > > IVMNode threadsNode = new ThreadVMNode(this, getSession());
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
Flags:
marc.khouzam
:
iplog-
Actions:
View
|
Diff
Attachments on
bug 338136
: 189768 |
189886
|
189966
|
190539
|
190561
|
190695