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 159054 Details for
Bug 300096
[expressions][run control][cdi] DSF is missing certain debug actions from editor's context menu
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]
Final fix
zpatch.txt (text/plain), 45.91 KB, created by
Marc Khouzam
on 2010-02-12 21:35:11 EST
(
hide
)
Description:
Final fix
Filename:
MIME Type:
Creator:
Marc Khouzam
Created:
2010-02-12 21:35:11 EST
Size:
45.91 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.debug.ui >Index: src/org/eclipse/cdt/debug/internal/ui/actions/MoveToLineActionDelegate.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/MoveToLineActionDelegate.java,v >retrieving revision 1.1 >diff -u -r1.1 MoveToLineActionDelegate.java >--- src/org/eclipse/cdt/debug/internal/ui/actions/MoveToLineActionDelegate.java 7 Jul 2008 18:44:04 -0000 1.1 >+++ src/org/eclipse/cdt/debug/internal/ui/actions/MoveToLineActionDelegate.java 13 Feb 2010 02:20:52 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2008 Freescale Secmiconductor and others. >+ * Copyright (c) 2008, 2010 Freescale Secmiconductor 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 >@@ -7,14 +7,21 @@ > * > * Contributors: > * Freescale Semiconductor - Initial API and implementation >+ * Ericsson - Updated to latest platform code > *******************************************************************************/ > package org.eclipse.cdt.debug.internal.ui.actions; > >+import org.eclipse.cdt.debug.ui.CDebugUIPlugin; > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IAdapterManager; > import org.eclipse.core.runtime.Platform; >+import org.eclipse.debug.core.DebugPlugin; > import org.eclipse.debug.core.model.ISuspendResume; >-import org.eclipse.debug.ui.IDebugUIConstants; >+import org.eclipse.debug.ui.DebugUITools; >+import org.eclipse.debug.ui.contexts.DebugContextEvent; >+import org.eclipse.debug.ui.contexts.IDebugContextListener; >+import org.eclipse.debug.ui.contexts.IDebugContextManager; >+import org.eclipse.debug.ui.contexts.IDebugContextService; > import org.eclipse.jface.action.IAction; > import org.eclipse.jface.dialogs.ErrorDialog; > import org.eclipse.jface.viewers.ISelection; >@@ -24,146 +31,154 @@ > import org.eclipse.ui.IActionDelegate2; > import org.eclipse.ui.IEditorActionDelegate; > import org.eclipse.ui.IEditorPart; >-import org.eclipse.ui.ISelectionListener; > import org.eclipse.ui.IViewActionDelegate; > import org.eclipse.ui.IViewPart; > import org.eclipse.ui.IWorkbenchPart; > import org.eclipse.ui.IWorkbenchPartSite; >+import org.eclipse.ui.IWorkbenchWindow; > > /** > * A move to line action that can be contributed to a an editor. The action > * will perform the "move to line" operation for editors that provide > * an appropriate <code>IMoveToLineTarget</code> adapter. > */ >-public class MoveToLineActionDelegate implements IEditorActionDelegate, IViewActionDelegate, IActionDelegate2 { >- >+public class MoveToLineActionDelegate implements IEditorActionDelegate, IActionDelegate2, IViewActionDelegate { >+ > private IWorkbenchPart fActivePart = null; >- > private IMoveToLineTarget fPartTarget = null; >- > private IAction fAction = null; >+ private DebugContextListener fContextListener = new DebugContextListener(); >+ private ISuspendResume fTargetElement = null; >+ >+ class DebugContextListener implements IDebugContextListener { > >- private ISelectionListener fSelectionListener = new DebugSelectionListener(); >- >- protected ISuspendResume fTargetElement = null; >- >- class DebugSelectionListener implements ISelectionListener { >- >- /* (non-Javadoc) >- * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection) >- */ >- public void selectionChanged( IWorkbenchPart part, ISelection selection ) { >+ protected void contextActivated(ISelection selection) { > fTargetElement = null; >- if ( selection instanceof IStructuredSelection ) { >- IStructuredSelection ss = (IStructuredSelection)selection; >- if ( ss.size() == 1 ) { >- Object object = ss.getFirstElement(); >- if ( object instanceof ISuspendResume ) { >- fTargetElement = (ISuspendResume)object; >- } >+ if (selection instanceof IStructuredSelection) { >+ IStructuredSelection ss = (IStructuredSelection) selection; >+ if (ss.size() == 1) { >+ fTargetElement = (ISuspendResume) >+ DebugPlugin.getAdapter(ss.getFirstElement(), ISuspendResume.class); > } > } > update(); > } >- } >- >- /* (non-Javadoc) >- * @see org.eclipse.ui.IEditorActionDelegate#setActiveEditor(org.eclipse.jface.action.IAction, org.eclipse.ui.IEditorPart) >- */ >- public void setActiveEditor( IAction action, IEditorPart targetEditor ) { >- init( action ); >- bindTo( targetEditor ); >- } > >- /* (non-Javadoc) >- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction) >- */ >- public void init( IAction action ) { >- this.fAction = action; >- } >- >- /* (non-Javadoc) >+ public void debugContextChanged(DebugContextEvent event) { >+ contextActivated(event.getContext()); >+ } >+ >+ } >+ >+ /*(non-Javadoc) > * @see org.eclipse.ui.IActionDelegate2#dispose() > */ > public void dispose() { >- fActivePart.getSite().getWorkbenchWindow().getSelectionService().removeSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, fSelectionListener ); >+ DebugUITools.getDebugContextManager().getContextService(fActivePart.getSite().getWorkbenchWindow()).removeDebugContextListener(fContextListener); > fActivePart = null; > fPartTarget = null; >+ > } >- >- /* (non-Javadoc) >- * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event) >- */ >- public void runWithEvent( IAction action, Event event ) { >- run( action ); >- } >- > /* (non-Javadoc) > * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) > */ >- public void run( IAction action ) { >- if ( fPartTarget != null && fTargetElement != null ) { >+ public void run(IAction action) { >+ if (fPartTarget != null && fTargetElement != null) { > try { >- fPartTarget.moveToLine( fActivePart, fActivePart.getSite().getSelectionProvider().getSelection(), fTargetElement ); >- } >- catch( CoreException e ) { >+ fPartTarget.moveToLine(fActivePart, fActivePart.getSite().getSelectionProvider().getSelection(), fTargetElement); >+ } catch (CoreException e) { > ErrorDialog.openError( fActivePart.getSite().getWorkbenchWindow().getShell(), ActionMessages.getString( "MoveToLineActionDelegate.1" ), ActionMessages.getString( "MoveToLineActionDelegate.2" ), e.getStatus() ); //$NON-NLS-1$ //$NON-NLS-2$ > } > } > } >- > /* (non-Javadoc) > * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection) > */ >- public void selectionChanged( IAction action, ISelection selection ) { >+ public void selectionChanged(IAction action, ISelection selection) { > this.fAction = action; > update(); > } >- >- protected void update() { >- if ( fAction == null ) { >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.texteditor.IUpdate#update() >+ */ >+ public void update() { >+ if (fAction == null) { > return; > } >- boolean enabled = false; >- if ( fPartTarget != null && fTargetElement != null ) { >- IWorkbenchPartSite site = fActivePart.getSite(); >- if ( site != null ) { >- ISelectionProvider selectionProvider = site.getSelectionProvider(); >- if ( selectionProvider != null ) { >- ISelection selection = selectionProvider.getSelection(); >- enabled = fTargetElement.isSuspended() && fPartTarget.canMoveToLine( fActivePart, selection, fTargetElement ); >+ Runnable r = new Runnable() { >+ public void run() { >+ boolean enabled = false; >+ if (fPartTarget != null && fTargetElement != null) { >+ IWorkbenchPartSite site = fActivePart.getSite(); >+ if (site != null) { >+ ISelectionProvider selectionProvider = site.getSelectionProvider(); >+ if (selectionProvider != null) { >+ ISelection selection = selectionProvider.getSelection(); >+ enabled = fTargetElement.isSuspended() && fPartTarget.canMoveToLine(fActivePart, selection, fTargetElement); >+ } >+ } > } >+ fAction.setEnabled(enabled); > } >- } >- fAction.setEnabled( enabled ); >+ }; >+ CDebugUIPlugin.getStandardDisplay().asyncExec(r); > } >- >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction) >+ */ >+ public void init(IAction action) { >+ this.fAction = action; >+ } >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event) >+ */ >+ public void runWithEvent(IAction action, Event event) { >+ run(action); >+ } >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.IEditorActionDelegate#setActiveEditor(org.eclipse.jface.action.IAction, org.eclipse.ui.IEditorPart) >+ */ >+ public void setActiveEditor(IAction action, IEditorPart targetEditor) { >+ init(action); >+ bindTo(targetEditor); >+ } >+ > /* (non-Javadoc) > * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart) > */ >- public void init( IViewPart view ) { >- bindTo( view ); >+ public void init(IViewPart view) { >+ bindTo(view); > } >- >+ > /** > * Binds this action to operate on the given part's run to line adapter. >+ * >+ * @param part > */ >- private void bindTo( IWorkbenchPart part ) { >+ private void bindTo(IWorkbenchPart part) { >+ IDebugContextManager manager = DebugUITools.getDebugContextManager(); >+ if (fActivePart != null && !fActivePart.equals(part)) { >+ manager.getContextService(fActivePart.getSite().getWorkbenchWindow()).removeDebugContextListener(fContextListener); >+ } >+ fPartTarget = null; > fActivePart = part; >- if ( part != null ) { >- part.getSite().getWorkbenchWindow().getSelectionService().addSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, fSelectionListener ); >- fPartTarget = (IMoveToLineTarget)part.getAdapter( IMoveToLineTarget.class ); >- if ( fPartTarget == null ) { >+ if (part != null) { >+ IWorkbenchWindow workbenchWindow = part.getSite().getWorkbenchWindow(); >+ IDebugContextService service = manager.getContextService(workbenchWindow); >+ service.addDebugContextListener(fContextListener); >+ fPartTarget = (IMoveToLineTarget) part.getAdapter(IMoveToLineTarget.class); >+ if (fPartTarget == null) { > IAdapterManager adapterManager = Platform.getAdapterManager(); > // TODO: we could restrict loading to cases when the debugging context is on >- if ( adapterManager.hasAdapter( part, IMoveToLineTarget.class.getName() ) ) { >- fPartTarget = (IMoveToLineTarget)adapterManager.loadAdapter( part, IMoveToLineTarget.class.getName() ); >+ if (adapterManager.hasAdapter(part, IMoveToLineTarget.class.getName())) { >+ fPartTarget = (IMoveToLineTarget) adapterManager.loadAdapter(part, IMoveToLineTarget.class.getName()); > } > } >- // Force the selection update >- ISelection selection = part.getSite().getWorkbenchWindow().getSelectionService().getSelection( IDebugUIConstants.ID_DEBUG_VIEW ); >- fSelectionListener.selectionChanged( part, selection ); >+ ISelection activeContext = service.getActiveContext(); >+ fContextListener.contextActivated(activeContext); > } >- update(); >+ update(); > } > } >Index: src/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineActionDelegate.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineActionDelegate.java,v >retrieving revision 1.9 >diff -u -r1.9 ResumeAtLineActionDelegate.java >--- src/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineActionDelegate.java 7 Jul 2008 18:44:04 -0000 1.9 >+++ src/org/eclipse/cdt/debug/internal/ui/actions/ResumeAtLineActionDelegate.java 13 Feb 2010 02:20:52 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2004, 2005 QNX Software Systems and others. >+ * Copyright (c) 2004, 2010 QNX Software Systems 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 >@@ -7,14 +7,21 @@ > * > * Contributors: > * QNX Software Systems - Initial API and implementation >+ * Ericsson - Updated to latest platform code > *******************************************************************************/ > package org.eclipse.cdt.debug.internal.ui.actions; > >+import org.eclipse.cdt.debug.ui.CDebugUIPlugin; > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IAdapterManager; > import org.eclipse.core.runtime.Platform; >+import org.eclipse.debug.core.DebugPlugin; > import org.eclipse.debug.core.model.ISuspendResume; >-import org.eclipse.debug.ui.IDebugUIConstants; >+import org.eclipse.debug.ui.DebugUITools; >+import org.eclipse.debug.ui.contexts.DebugContextEvent; >+import org.eclipse.debug.ui.contexts.IDebugContextListener; >+import org.eclipse.debug.ui.contexts.IDebugContextManager; >+import org.eclipse.debug.ui.contexts.IDebugContextService; > import org.eclipse.jface.action.IAction; > import org.eclipse.jface.dialogs.ErrorDialog; > import org.eclipse.jface.viewers.ISelection; >@@ -24,146 +31,154 @@ > import org.eclipse.ui.IActionDelegate2; > import org.eclipse.ui.IEditorActionDelegate; > import org.eclipse.ui.IEditorPart; >-import org.eclipse.ui.ISelectionListener; > import org.eclipse.ui.IViewActionDelegate; > import org.eclipse.ui.IViewPart; > import org.eclipse.ui.IWorkbenchPart; > import org.eclipse.ui.IWorkbenchPartSite; >+import org.eclipse.ui.IWorkbenchWindow; > > /** > * A resume at line action that can be contributed to a an editor. The action > * will perform the "resume at line" operation for editors that provide > * an appropriate <code>IResumeAtLineTarget</code> adapter. > */ >-public class ResumeAtLineActionDelegate implements IEditorActionDelegate, IViewActionDelegate, IActionDelegate2 { >- >+public class ResumeAtLineActionDelegate implements IEditorActionDelegate, IActionDelegate2, IViewActionDelegate { >+ > private IWorkbenchPart fActivePart = null; >- > private IResumeAtLineTarget fPartTarget = null; >- > private IAction fAction = null; >+ private DebugContextListener fContextListener = new DebugContextListener(); >+ private ISuspendResume fTargetElement = null; >+ >+ class DebugContextListener implements IDebugContextListener { > >- private ISelectionListener fSelectionListener = new DebugSelectionListener(); >- >- protected ISuspendResume fTargetElement = null; >- >- class DebugSelectionListener implements ISelectionListener { >- >- /* (non-Javadoc) >- * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection) >- */ >- public void selectionChanged( IWorkbenchPart part, ISelection selection ) { >+ protected void contextActivated(ISelection selection) { > fTargetElement = null; >- if ( selection instanceof IStructuredSelection ) { >- IStructuredSelection ss = (IStructuredSelection)selection; >- if ( ss.size() == 1 ) { >- Object object = ss.getFirstElement(); >- if ( object instanceof ISuspendResume ) { >- fTargetElement = (ISuspendResume)object; >- } >+ if (selection instanceof IStructuredSelection) { >+ IStructuredSelection ss = (IStructuredSelection) selection; >+ if (ss.size() == 1) { >+ fTargetElement = (ISuspendResume) >+ DebugPlugin.getAdapter(ss.getFirstElement(), ISuspendResume.class); > } > } > update(); > } >- } >- >- /* (non-Javadoc) >- * @see org.eclipse.ui.IEditorActionDelegate#setActiveEditor(org.eclipse.jface.action.IAction, org.eclipse.ui.IEditorPart) >- */ >- public void setActiveEditor( IAction action, IEditorPart targetEditor ) { >- init( action ); >- bindTo( targetEditor ); >- } > >- /* (non-Javadoc) >- * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction) >- */ >- public void init( IAction action ) { >- this.fAction = action; >- } >- >- /* (non-Javadoc) >+ public void debugContextChanged(DebugContextEvent event) { >+ contextActivated(event.getContext()); >+ } >+ >+ } >+ >+ /*(non-Javadoc) > * @see org.eclipse.ui.IActionDelegate2#dispose() > */ > public void dispose() { >- fActivePart.getSite().getWorkbenchWindow().getSelectionService().removeSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, fSelectionListener ); >+ DebugUITools.getDebugContextManager().getContextService(fActivePart.getSite().getWorkbenchWindow()).removeDebugContextListener(fContextListener); > fActivePart = null; > fPartTarget = null; >+ > } >- >- /* (non-Javadoc) >- * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event) >- */ >- public void runWithEvent( IAction action, Event event ) { >- run( action ); >- } >- > /* (non-Javadoc) > * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction) > */ >- public void run( IAction action ) { >- if ( fPartTarget != null && fTargetElement != null ) { >+ public void run(IAction action) { >+ if (fPartTarget != null && fTargetElement != null) { > try { >- fPartTarget.resumeAtLine( fActivePart, fActivePart.getSite().getSelectionProvider().getSelection(), fTargetElement ); >- } >- catch( CoreException e ) { >+ fPartTarget.resumeAtLine(fActivePart, fActivePart.getSite().getSelectionProvider().getSelection(), fTargetElement); >+ } catch (CoreException e) { > ErrorDialog.openError( fActivePart.getSite().getWorkbenchWindow().getShell(), ActionMessages.getString( "ResumeAtLineActionDelegate.1" ), ActionMessages.getString( "ResumeAtLineActionDelegate.2" ), e.getStatus() ); //$NON-NLS-1$ //$NON-NLS-2$ > } > } > } >- > /* (non-Javadoc) > * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection) > */ >- public void selectionChanged( IAction action, ISelection selection ) { >+ public void selectionChanged(IAction action, ISelection selection) { > this.fAction = action; > update(); > } >- >- protected void update() { >- if ( fAction == null ) { >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.texteditor.IUpdate#update() >+ */ >+ public void update() { >+ if (fAction == null) { > return; > } >- boolean enabled = false; >- if ( fPartTarget != null && fTargetElement != null ) { >- IWorkbenchPartSite site = fActivePart.getSite(); >- if ( site != null ) { >- ISelectionProvider selectionProvider = site.getSelectionProvider(); >- if ( selectionProvider != null ) { >- ISelection selection = selectionProvider.getSelection(); >- enabled = fTargetElement.isSuspended() && fPartTarget.canResumeAtLine( fActivePart, selection, fTargetElement ); >+ Runnable r = new Runnable() { >+ public void run() { >+ boolean enabled = false; >+ if (fPartTarget != null && fTargetElement != null) { >+ IWorkbenchPartSite site = fActivePart.getSite(); >+ if (site != null) { >+ ISelectionProvider selectionProvider = site.getSelectionProvider(); >+ if (selectionProvider != null) { >+ ISelection selection = selectionProvider.getSelection(); >+ enabled = fTargetElement.isSuspended() && fPartTarget.canResumeAtLine(fActivePart, selection, fTargetElement); >+ } >+ } > } >+ fAction.setEnabled(enabled); > } >- } >- fAction.setEnabled( enabled ); >+ }; >+ CDebugUIPlugin.getStandardDisplay().asyncExec(r); > } >- >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.IActionDelegate2#init(org.eclipse.jface.action.IAction) >+ */ >+ public void init(IAction action) { >+ this.fAction = action; >+ } >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.IActionDelegate2#runWithEvent(org.eclipse.jface.action.IAction, org.eclipse.swt.widgets.Event) >+ */ >+ public void runWithEvent(IAction action, Event event) { >+ run(action); >+ } >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.IEditorActionDelegate#setActiveEditor(org.eclipse.jface.action.IAction, org.eclipse.ui.IEditorPart) >+ */ >+ public void setActiveEditor(IAction action, IEditorPart targetEditor) { >+ init(action); >+ bindTo(targetEditor); >+ } >+ > /* (non-Javadoc) > * @see org.eclipse.ui.IViewActionDelegate#init(org.eclipse.ui.IViewPart) > */ >- public void init( IViewPart view ) { >- bindTo( view ); >+ public void init(IViewPart view) { >+ bindTo(view); > } >- >+ > /** > * Binds this action to operate on the given part's run to line adapter. >+ * >+ * @param part > */ >- private void bindTo( IWorkbenchPart part ) { >+ private void bindTo(IWorkbenchPart part) { >+ IDebugContextManager manager = DebugUITools.getDebugContextManager(); >+ if (fActivePart != null && !fActivePart.equals(part)) { >+ manager.getContextService(fActivePart.getSite().getWorkbenchWindow()).removeDebugContextListener(fContextListener); >+ } >+ fPartTarget = null; > fActivePart = part; >- if ( part != null ) { >- part.getSite().getWorkbenchWindow().getSelectionService().addSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, fSelectionListener ); >- fPartTarget = (IResumeAtLineTarget)part.getAdapter( IResumeAtLineTarget.class ); >- if ( fPartTarget == null ) { >+ if (part != null) { >+ IWorkbenchWindow workbenchWindow = part.getSite().getWorkbenchWindow(); >+ IDebugContextService service = manager.getContextService(workbenchWindow); >+ service.addDebugContextListener(fContextListener); >+ fPartTarget = (IResumeAtLineTarget) part.getAdapter(IResumeAtLineTarget.class); >+ if (fPartTarget == null) { > IAdapterManager adapterManager = Platform.getAdapterManager(); > // TODO: we could restrict loading to cases when the debugging context is on >- if ( adapterManager.hasAdapter( part, IResumeAtLineTarget.class.getName() ) ) { >- fPartTarget = (IResumeAtLineTarget)adapterManager.loadAdapter( part, IResumeAtLineTarget.class.getName() ); >+ if (adapterManager.hasAdapter(part, IResumeAtLineTarget.class.getName())) { >+ fPartTarget = (IResumeAtLineTarget) adapterManager.loadAdapter(part, IResumeAtLineTarget.class.getName()); > } > } >- // Force the selection update >- ISelection selection = part.getSite().getWorkbenchWindow().getSelectionService().getSelection( IDebugUIConstants.ID_DEBUG_VIEW ); >- fSelectionListener.selectionChanged( part, selection ); >+ ISelection activeContext = service.getActiveContext(); >+ fContextListener.contextActivated(activeContext); > } >- update(); >+ update(); > } > } >#P org.eclipse.cdt.dsf.gdb.ui >Index: icons/full/obj16/move_to_line.gif >=================================================================== >RCS file: icons/full/obj16/move_to_line.gif >diff -N icons/full/obj16/move_to_line.gif >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ icons/full/obj16/move_to_line.gif 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,2 @@ >+GIF89a¥koBRkhsµw½{½ÿçÿç¥ÿïÿïµÿï½ÿ÷Æÿ÷Îÿ÷Öÿÿÿ!ù,9ðÉI«½8[Ã{æNYa >+©IÄB¬R ¼p?+@ <hâ;+¤`r$?çÒâL®; >\ No newline at end of file >Index: icons/full/obj16/resume_at_line.gif >=================================================================== >RCS file: icons/full/obj16/resume_at_line.gif >diff -N icons/full/obj16/resume_at_line.gif >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ icons/full/obj16/resume_at_line.gif 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,2 @@ >+GIF89a¥koNZso{µsµ{½ÿçÿç¥ÿïÿïµÿï½ÿ÷Æÿ÷Îÿ÷Öÿÿÿ!ù,>ðÉI«½8[Ã{æNYa >+©IÅ¢®?B<Qg/H<ì,$P(îá¤>£]uÅÅD; >\ No newline at end of file >Index: icons/full/obj16/watch_exp.gif >=================================================================== >RCS file: icons/full/obj16/watch_exp.gif >diff -N icons/full/obj16/watch_exp.gif >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ icons/full/obj16/watch_exp.gif 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,3 @@ >+GIF89a¢9efÅt?ʱիÄßÈØêÕáïÿÿÿ!ù,BxºÜ >+ãÐè;d¢Ä²-VÚ!¬Y[zXÒ9§No;VáBb= >+Á^3ó ÀPÉL©$vKý1; >\ No newline at end of file >Index: plugin.properties >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/plugin.properties,v >retrieving revision 1.9 >diff -u -r1.9 plugin.properties >--- plugin.properties 27 Jan 2010 19:05:44 -0000 1.9 >+++ plugin.properties 13 Feb 2010 02:20:53 -0000 >@@ -30,6 +30,11 @@ > tracepoints.property.common=Common > tracepoints.property.actions=Actions > >+popup.addExpression.label=Add Watch Expression... >+popup.resumeAtLine.label=Resume At Li&ne >+popup.moveToLine.label=&Move To Line >+popup.runToLine.label=Run To &Line >+ > # Tracepoints > view.traceControl.name=Trace Control > toolbar.startTracing.name=Start Tracing >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/plugin.xml,v >retrieving revision 1.23 >diff -u -r1.23 plugin.xml >--- plugin.xml 11 Feb 2010 16:26:57 -0000 1.23 >+++ plugin.xml 13 Feb 2010 02:20:53 -0000 >@@ -414,4 +414,82 @@ > </command> > </menuContribution> > </extension> >+ <extension >+ point="org.eclipse.ui.popupMenus"> >+ <viewerContribution >+ id="org.eclipse.cdt.debug.ui.editor.actions.popup" >+ targetID="#CEditorContext"> >+ <visibility> >+ <and> >+ <systemProperty >+ name="org.eclipse.cdt.dsf.gdb.ui.debuggerActive" >+ value="true"> >+ </systemProperty> >+ <objectClass >+ name="org.eclipse.jface.text.ITextSelection"> >+ </objectClass> >+ </and> >+ </visibility> >+ <action >+ class="org.eclipse.cdt.debug.internal.ui.actions.AddExpressionEditorActionDelegate" >+ helpContextId="add_expression_action_context" >+ icon="icons/full/obj16/watch_exp.gif" >+ id="org.eclipse.cdt.dsf.gdb.ui.actions.popup.AddWathExpression" >+ label="%popup.addExpression.label" >+ menubarPath="additions"> >+ </action> >+ <action >+ class="org.eclipse.cdt.debug.internal.ui.actions.ResumeAtLineActionDelegate" >+ helpContextId="resume_at_line_action_context" >+ icon="icons/full/obj16/resume_at_line.gif" >+ id="org.eclipse.cdt.dsf.gdb.ui.actions.popup.ResumeAtLine" >+ label="%popup.resumeAtLine.label" >+ menubarPath="additions"> >+ </action> >+ <action >+ class="org.eclipse.cdt.debug.internal.ui.actions.MoveToLineActionDelegate" >+ helpContextId="move_to_line_action_context" >+ icon="icons/full/obj16/move_to_line.gif" >+ id="org.eclipse.cdt.dsf.gdb.ui.actions.popup.MoveToLine" >+ label="%popup.moveToLine.label" >+ menubarPath="additions"> >+ </action> >+ <action >+ class="org.eclipse.debug.ui.actions.RunToLineActionDelegate" >+ definitionId="org.eclipse.debug.ui.commands.RunToLine" >+ helpContextId="run_to_line_action_context" >+ id="org.eclipse.cdt.dsf.gdb.ui.actions.popup.RunToLine" >+ label="%popup.runToLine.label" >+ menubarPath="additions"> >+ </action> >+ </viewerContribution> >+ <viewerContribution >+ id="org.eclipse.cdt.debug.ui.disassembly.actions.popup" >+ targetID="#DisassemblyPartContext"> >+ <action >+ class="org.eclipse.cdt.debug.internal.ui.actions.ResumeAtLineActionDelegate" >+ helpContextId="resume_at_line_action_context" >+ icon="icons/full/obj16/resume_at_line.gif" >+ id="org.eclipse.cdt.dsf.gdb.ui.actions.popup.ResumeAtLine" >+ label="%popup.resumeAtLine.label" >+ menubarPath="additions"> >+ </action> >+ <action >+ class="org.eclipse.cdt.debug.internal.ui.actions.MoveToLineActionDelegate" >+ helpContextId="move_to_line_action_context" >+ icon="icons/full/obj16/move_to_line.gif" >+ id="org.eclipse.cdt.dsf.gdb.ui.actions.popup.MoveToLine" >+ label="%popup.moveToLine.label" >+ menubarPath="additions"> >+ </action> >+ <action >+ class="org.eclipse.debug.ui.actions.RunToLineActionDelegate" >+ definitionId="org.eclipse.debug.ui.commands.RunToLine" >+ helpContextId="run_to_line_action_context" >+ id="org.eclipse.cdt.dsf.gdb.ui.actions.popup.RunToLine" >+ label="%popup.runToLine.label" >+ menubarPath="additions"> >+ </action> >+ </viewerContribution> >+ </extension> > </plugin> >Index: src/org/eclipse/cdt/dsf/gdb/internal/ui/EvaluationContextManager.java >=================================================================== >RCS file: src/org/eclipse/cdt/dsf/gdb/internal/ui/EvaluationContextManager.java >diff -N src/org/eclipse/cdt/dsf/gdb/internal/ui/EvaluationContextManager.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/cdt/dsf/gdb/internal/ui/EvaluationContextManager.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,231 @@ >+/******************************************************************************* >+ * Copyright (c) 2004, 2010 QNX Software Systems 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: >+ * QNX Software Systems - Initial API and implementation >+ * Ericsson - DSF-GDB version >+ *******************************************************************************/ >+package org.eclipse.cdt.dsf.gdb.internal.ui; >+ >+import java.util.HashMap; >+import java.util.Map; >+ >+import org.eclipse.cdt.dsf.ui.viewmodel.datamodel.IDMVMContext; >+import org.eclipse.debug.ui.IDebugUIConstants; >+import org.eclipse.jface.viewers.ISelection; >+import org.eclipse.jface.viewers.IStructuredSelection; >+import org.eclipse.swt.widgets.Display; >+import org.eclipse.ui.IPageListener; >+import org.eclipse.ui.IPartListener2; >+import org.eclipse.ui.ISelectionListener; >+import org.eclipse.ui.IWindowListener; >+import org.eclipse.ui.IWorkbench; >+import org.eclipse.ui.IWorkbenchPage; >+import org.eclipse.ui.IWorkbenchPart; >+import org.eclipse.ui.IWorkbenchPartReference; >+import org.eclipse.ui.IWorkbenchWindow; >+import org.eclipse.ui.PlatformUI; >+ >+/** >+ * Manages the current evaluation context (stack frame) for evaluation actions. >+ * In each page, the selection is tracked in each debug view (if any). When a debug >+ * target selection exists, the "debuggerActive" System property is set to true. >+ * This property is used to make the "Run To Line", "Resume At Line", >+ * "Move To Line" and "Add Watch Expression" actions >+ * visible in editors only if there is a running debug session. >+ */ >+public class EvaluationContextManager implements IWindowListener, IPageListener, ISelectionListener, IPartListener2 { >+ >+ // Must use a different ID than for CDI >+ private final static String DEBUGGER_ACTIVE = GdbUIPlugin.getUniqueIdentifier() + ".debuggerActive"; //$NON-NLS-1$ >+ >+ protected static EvaluationContextManager fgManager; >+ >+ private Map<IWorkbenchPage,IDMVMContext> fContextsByPage = null; >+ >+ protected EvaluationContextManager() { >+ } >+ >+ public static void startup() { >+ Runnable r = new Runnable() { >+ >+ public void run() { >+ if ( fgManager == null ) { >+ fgManager = new EvaluationContextManager(); >+ IWorkbench workbench = PlatformUI.getWorkbench(); >+ IWorkbenchWindow[] windows = workbench.getWorkbenchWindows(); >+ for( int i = 0; i < windows.length; i++ ) { >+ fgManager.windowOpened( windows[i] ); >+ } >+ workbench.addWindowListener( fgManager ); >+ } >+ } >+ }; >+ Display display = Display.getCurrent(); >+ if ( display == null ) >+ display = Display.getDefault(); >+ display.asyncExec( r ); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.IWindowListener#windowActivated(org.eclipse.ui.IWorkbenchWindow) >+ */ >+ public void windowActivated( IWorkbenchWindow window ) { >+ windowOpened( window ); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.IWindowListener#windowDeactivated(org.eclipse.ui.IWorkbenchWindow) >+ */ >+ public void windowDeactivated( IWorkbenchWindow window ) { >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.IWindowListener#windowClosed(org.eclipse.ui.IWorkbenchWindow) >+ */ >+ public void windowClosed( IWorkbenchWindow window ) { >+ window.removePageListener( this ); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.IWindowListener#windowOpened(org.eclipse.ui.IWorkbenchWindow) >+ */ >+ public void windowOpened( IWorkbenchWindow window ) { >+ IWorkbenchPage[] pages = window.getPages(); >+ for( int i = 0; i < pages.length; i++ ) { >+ window.addPageListener( this ); >+ pageOpened( pages[i] ); >+ } >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.IPageListener#pageActivated(org.eclipse.ui.IWorkbenchPage) >+ */ >+ public void pageActivated( IWorkbenchPage page ) { >+ pageOpened( page ); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.IPageListener#pageClosed(org.eclipse.ui.IWorkbenchPage) >+ */ >+ public void pageClosed( IWorkbenchPage page ) { >+ page.removeSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this ); >+ page.removePartListener( this ); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.IPageListener#pageOpened(org.eclipse.ui.IWorkbenchPage) >+ */ >+ public void pageOpened( IWorkbenchPage page ) { >+ page.addSelectionListener( IDebugUIConstants.ID_DEBUG_VIEW, this ); >+ page.addPartListener( this ); >+ IWorkbenchPartReference ref = page.getActivePartReference(); >+ if ( ref != null ) { >+ partActivated( ref ); >+ } >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection) >+ */ >+ public void selectionChanged( IWorkbenchPart part, ISelection selection ) { >+ IWorkbenchPage page = part.getSite().getPage(); >+ if ( selection instanceof IStructuredSelection ) { >+ IStructuredSelection ss = (IStructuredSelection)selection; >+ if ( ss.size() == 1 ) { >+ Object element = ss.getFirstElement(); >+ if ( element instanceof IDMVMContext ) { >+ setContext( page, (IDMVMContext)element ); >+ return; >+ } >+ } >+ } >+ // no context in the given view >+ removeContext( page ); >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.IPartListener2#partActivated(org.eclipse.ui.IWorkbenchPartReference) >+ */ >+ public void partActivated( IWorkbenchPartReference partRef ) { >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.IPartListener2#partBroughtToTop(org.eclipse.ui.IWorkbenchPartReference) >+ */ >+ public void partBroughtToTop( IWorkbenchPartReference partRef ) { >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.IPartListener2#partClosed(org.eclipse.ui.IWorkbenchPartReference) >+ */ >+ public void partClosed( IWorkbenchPartReference partRef ) { >+ if ( IDebugUIConstants.ID_DEBUG_VIEW.equals( partRef.getId() ) ) { >+ removeContext( partRef.getPage() ); >+ } >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.IPartListener2#partDeactivated(org.eclipse.ui.IWorkbenchPartReference) >+ */ >+ public void partDeactivated( IWorkbenchPartReference partRef ) { >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.IPartListener2#partOpened(org.eclipse.ui.IWorkbenchPartReference) >+ */ >+ public void partOpened( IWorkbenchPartReference partRef ) { >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.IPartListener2#partHidden(org.eclipse.ui.IWorkbenchPartReference) >+ */ >+ public void partHidden( IWorkbenchPartReference partRef ) { >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.IPartListener2#partVisible(org.eclipse.ui.IWorkbenchPartReference) >+ */ >+ public void partVisible( IWorkbenchPartReference partRef ) { >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.IPartListener2#partInputChanged(org.eclipse.ui.IWorkbenchPartReference) >+ */ >+ public void partInputChanged( IWorkbenchPartReference partRef ) { >+ } >+ >+ /** >+ * Sets the evaluation context for the given page, and notes that >+ * a valid execution context exists. >+ * >+ * @param page >+ * @param frame >+ */ >+ private void setContext( IWorkbenchPage page, IDMVMContext target ) { >+ if ( fContextsByPage == null ) { >+ fContextsByPage = new HashMap<IWorkbenchPage,IDMVMContext>(); >+ } >+ fContextsByPage.put( page, target ); >+ System.setProperty( DEBUGGER_ACTIVE, Boolean.TRUE.toString() ); >+ } >+ >+ /** >+ * Removes an evaluation context for the given page, and determines if >+ * any valid execution context remain. >+ * >+ * @param page >+ */ >+ private void removeContext( IWorkbenchPage page ) { >+ if ( fContextsByPage != null ) { >+ fContextsByPage.remove( page ); >+ if ( fContextsByPage.isEmpty() ) { >+ System.setProperty( DEBUGGER_ACTIVE, Boolean.FALSE.toString() ); >+ } >+ } >+ } >+} >Index: src/org/eclipse/cdt/dsf/gdb/internal/ui/GdbSuspendResumeAdapterFactory.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/GdbSuspendResumeAdapterFactory.java,v >retrieving revision 1.3 >diff -u -r1.3 GdbSuspendResumeAdapterFactory.java >--- src/org/eclipse/cdt/dsf/gdb/internal/ui/GdbSuspendResumeAdapterFactory.java 12 Feb 2010 01:04:14 -0000 1.3 >+++ src/org/eclipse/cdt/dsf/gdb/internal/ui/GdbSuspendResumeAdapterFactory.java 13 Feb 2010 02:20:54 -0000 >@@ -1,88 +1,91 @@ >-/******************************************************************************* >- * Copyright (c) 2009, 2010 Wind River Systems 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: >- * Wind River Systems - initial API and implementation >- * Ericsson - Updated to support Move-To-Line >- *******************************************************************************/ >-package org.eclipse.cdt.dsf.gdb.internal.ui; >- >-import org.eclipse.cdt.dsf.datamodel.DMContexts; >-import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerDMContext; >-import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMContext; >-import org.eclipse.cdt.dsf.gdb.internal.ui.actions.GdbMoveToLine; >-import org.eclipse.cdt.dsf.gdb.internal.ui.actions.GdbResumeAtLine; >-import org.eclipse.cdt.dsf.gdb.internal.ui.actions.GdbRunToLine; >-import org.eclipse.cdt.dsf.ui.viewmodel.datamodel.IDMVMContext; >-import org.eclipse.core.runtime.IAdaptable; >-import org.eclipse.core.runtime.IAdapterFactory; >-import org.eclipse.debug.core.DebugException; >-import org.eclipse.debug.core.model.ISuspendResume; >- >-/** >- * Adapter factory for Run-To-Line, Move-To-Line >- * and Resume-At-Line >- * >- * @since 2.1 >- */ >-public class GdbSuspendResumeAdapterFactory implements IAdapterFactory { >- >- static class GdbSuspendResume implements ISuspendResume, IAdaptable { >- >- private final GdbRunToLine fRunToLine; >- private final GdbMoveToLine fMoveToLine; >- private final GdbResumeAtLine fResumeAtLine; >- >- GdbSuspendResume(IExecutionDMContext execCtx) { >- fRunToLine = new GdbRunToLine(execCtx); >- fMoveToLine = new GdbMoveToLine(execCtx); >- fResumeAtLine = new GdbResumeAtLine(execCtx); >- } >- >- @SuppressWarnings("rawtypes") >- public Object getAdapter(Class adapter) { >- if (adapter.isInstance(fRunToLine)) { >- return fRunToLine; >- } >- if (adapter.isInstance(fMoveToLine)) { >- return fMoveToLine; >- } >- if (adapter.isInstance(fResumeAtLine)) { >- return fResumeAtLine; >- } >- return null; >- } >- >- public boolean canResume() { return false; } >- public boolean canSuspend() { return false; } >- public boolean isSuspended() { return false; } >- public void resume() throws DebugException {} >- public void suspend() throws DebugException {} >- } >- >- @SuppressWarnings("rawtypes") >- public Object getAdapter(Object adaptableObject, Class adapterType) { >- if (ISuspendResume.class.equals(adapterType)) { >- if (adaptableObject instanceof IDMVMContext) { >- IExecutionDMContext execDmc = DMContexts.getAncestorOfType( >- ((IDMVMContext)adaptableObject).getDMContext(), >- IExecutionDMContext.class); >- // It only makes sense to RunToLine, MoveToLine or >- // ResumeAtLine if we are dealing with a thread, not a container >- if (execDmc != null && !(execDmc instanceof IContainerDMContext)) { >- return new GdbSuspendResume(execDmc); >- } >- } >- } >- return null; >- } >- >- @SuppressWarnings("rawtypes") >- public Class[] getAdapterList() { >- return new Class[] { ISuspendResume.class }; >- } >+/******************************************************************************* >+ * Copyright (c) 2009, 2010 Wind River Systems 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: >+ * Wind River Systems - initial API and implementation >+ * Ericsson - Updated to support Move-To-Line >+ *******************************************************************************/ >+package org.eclipse.cdt.dsf.gdb.internal.ui; >+ >+import org.eclipse.cdt.dsf.datamodel.DMContexts; >+import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerDMContext; >+import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMContext; >+import org.eclipse.cdt.dsf.gdb.internal.ui.actions.GdbMoveToLine; >+import org.eclipse.cdt.dsf.gdb.internal.ui.actions.GdbResumeAtLine; >+import org.eclipse.cdt.dsf.gdb.internal.ui.actions.GdbRunToLine; >+import org.eclipse.cdt.dsf.ui.viewmodel.datamodel.IDMVMContext; >+import org.eclipse.core.runtime.IAdaptable; >+import org.eclipse.core.runtime.IAdapterFactory; >+import org.eclipse.debug.core.DebugException; >+import org.eclipse.debug.core.model.ISuspendResume; >+ >+/** >+ * Adapter factory for Run-To-Line, Move-To-Line >+ * and Resume-At-Line >+ * >+ * @since 2.1 >+ */ >+public class GdbSuspendResumeAdapterFactory implements IAdapterFactory { >+ >+ static class GdbSuspendResume implements ISuspendResume, IAdaptable { >+ >+ private final GdbRunToLine fRunToLine; >+ private final GdbMoveToLine fMoveToLine; >+ private final GdbResumeAtLine fResumeAtLine; >+ >+ GdbSuspendResume(IExecutionDMContext execCtx) { >+ fRunToLine = new GdbRunToLine(execCtx); >+ fMoveToLine = new GdbMoveToLine(execCtx); >+ fResumeAtLine = new GdbResumeAtLine(execCtx); >+ } >+ >+ @SuppressWarnings("rawtypes") >+ public Object getAdapter(Class adapter) { >+ if (adapter.isInstance(fRunToLine)) { >+ return fRunToLine; >+ } >+ if (adapter.isInstance(fMoveToLine)) { >+ return fMoveToLine; >+ } >+ if (adapter.isInstance(fResumeAtLine)) { >+ return fResumeAtLine; >+ } >+ return null; >+ } >+ >+ public boolean canResume() { return false; } >+ public boolean canSuspend() { return false; } >+ // This must return true because the platform >+ // RunToLineActionDelegate will only enable the >+ // action if we are suspended >+ public boolean isSuspended() { return true; } >+ public void resume() throws DebugException {} >+ public void suspend() throws DebugException {} >+ } >+ >+ @SuppressWarnings("rawtypes") >+ public Object getAdapter(Object adaptableObject, Class adapterType) { >+ if (ISuspendResume.class.equals(adapterType)) { >+ if (adaptableObject instanceof IDMVMContext) { >+ IExecutionDMContext execDmc = DMContexts.getAncestorOfType( >+ ((IDMVMContext)adaptableObject).getDMContext(), >+ IExecutionDMContext.class); >+ // It only makes sense to RunToLine, MoveToLine or >+ // ResumeAtLine if we are dealing with a thread, not a container >+ if (execDmc != null && !(execDmc instanceof IContainerDMContext)) { >+ return new GdbSuspendResume(execDmc); >+ } >+ } >+ } >+ return null; >+ } >+ >+ @SuppressWarnings("rawtypes") >+ public Class[] getAdapterList() { >+ return new Class[] { ISuspendResume.class }; >+ } > } >\ No newline at end of file >Index: src/org/eclipse/cdt/dsf/gdb/internal/ui/GdbUIPlugin.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/dsf-gdb/org.eclipse.cdt.dsf.gdb.ui/src/org/eclipse/cdt/dsf/gdb/internal/ui/GdbUIPlugin.java,v >retrieving revision 1.2 >diff -u -r1.2 GdbUIPlugin.java >--- src/org/eclipse/cdt/dsf/gdb/internal/ui/GdbUIPlugin.java 28 Feb 2009 08:26:30 -0000 1.2 >+++ src/org/eclipse/cdt/dsf/gdb/internal/ui/GdbUIPlugin.java 13 Feb 2010 02:20:54 -0000 >@@ -55,6 +55,8 @@ > super.start(context); > plugin = this; > >+ EvaluationContextManager.startup(); >+ > fTracingConsoleManager = new TracingConsoleManager(); > fTracingConsoleManager.startup(); > }
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 300096
:
156549
|
159033
| 159054 |
160115