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 159821 Details for
Bug 248606
[menu][breakpoints][cdi] Add support for toggling watchpoints in the variables and expressions views.
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]
Patched holes in error handling
patch_248606_4 (text/plain), 12.52 KB, created by
John Cortell
on 2010-02-22 12:48:08 EST
(
hide
)
Description:
Patched holes in error handling
Filename:
MIME Type:
Creator:
John Cortell
Created:
2010-02-22 12:48:08 EST
Size:
12.52 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.debug.core >Index: src/org/eclipse/cdt/debug/internal/core/CRequest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CRequest.java,v >retrieving revision 1.2 >diff -u -r1.2 CRequest.java >--- src/org/eclipse/cdt/debug/internal/core/CRequest.java 22 Feb 2010 15:07:48 -0000 1.2 >+++ src/org/eclipse/cdt/debug/internal/core/CRequest.java 22 Feb 2010 17:39:55 -0000 >@@ -56,4 +56,16 @@ > public void setStatus(IStatus status) { > fStatus= status; > } >+ >+ /** >+ * Checks whether the request completed successfully or not. If the request >+ * monitor was canceled it is considered a failure, regardless of the >+ * status. If the status has a severity higher than INFO (i.e., WARNING, >+ * ERROR or CANCEL), it is considered a failure. Note that as per IRequest >+ * documentation, a null status object is equivalent to IStatu#OK. >+ */ >+ public boolean isSuccess() { >+ IStatus status = getStatus(); >+ return !isCanceled() && (status == null || status.getSeverity() <= IStatus.INFO); >+ } > } >#P org.eclipse.cdt.debug.ui >Index: src/org/eclipse/cdt/debug/internal/ui/actions/ActionMessages.properties >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/ActionMessages.properties,v >retrieving revision 1.40 >diff -u -r1.40 ActionMessages.properties >--- src/org/eclipse/cdt/debug/internal/ui/actions/ActionMessages.properties 9 Feb 2010 15:58:48 -0000 1.40 >+++ src/org/eclipse/cdt/debug/internal/ui/actions/ActionMessages.properties 22 Feb 2010 17:39:56 -0000 >@@ -99,6 +99,8 @@ > AddWatchpointDialog.4=Read > AddWatchpointDialog.5=Memory space: > AddWatchpointDialog.6=Units: >+AddWatchpointOnVariableActionDelegate.No_Element_Size=Failed to get variable/expression size >+AddWatchpointOnVariableActionDelegate.Error_Dlg_Title=Error > ResumeAtLineAdapter.0=Empty editor > ResumeAtLineAdapter.1=Missing document > ResumeAtLineAdapter.2=Empty editor >Index: src/org/eclipse/cdt/debug/internal/ui/actions/AddWatchpointOnVariableActionDelegate.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/actions/AddWatchpointOnVariableActionDelegate.java,v >retrieving revision 1.5 >diff -u -r1.5 AddWatchpointOnVariableActionDelegate.java >--- src/org/eclipse/cdt/debug/internal/ui/actions/AddWatchpointOnVariableActionDelegate.java 22 Feb 2010 15:07:47 -0000 1.5 >+++ src/org/eclipse/cdt/debug/internal/ui/actions/AddWatchpointOnVariableActionDelegate.java 22 Feb 2010 17:39:56 -0000 >@@ -19,6 +19,7 @@ > import org.eclipse.core.runtime.Status; > import org.eclipse.debug.core.DebugPlugin; > import org.eclipse.jface.action.IAction; >+import org.eclipse.jface.dialogs.ErrorDialog; > import org.eclipse.jface.viewers.ISelection; > import org.eclipse.jface.viewers.StructuredSelection; > import org.eclipse.jface.viewers.TreeSelection; >@@ -33,11 +34,12 @@ > */ > public class AddWatchpointOnVariableActionDelegate extends AddWatchpointActionDelegate implements IObjectActionDelegate { > >- /** >- * The target variable/expression >- */ >+ /** The target variable/expression */ > private ICWatchpointTarget fVar; > >+ /** The view where fVar was selected */ >+ private IWorkbenchPart fActivePart; >+ > /** > * Constructor > */ >@@ -49,7 +51,7 @@ > * @see org.eclipse.ui.IObjectActionDelegate#setActivePart(org.eclipse.jface.action.IAction, org.eclipse.ui.IWorkbenchPart) > */ > public void setActivePart(IAction action, IWorkbenchPart targetPart) { >- // Don't care. Our logic is agnostic to the view we're invoked from. >+ fActivePart = targetPart; > } > > private static class GetSizeRequest extends CRequest implements ICWatchpointTarget.GetSizeRequest { >@@ -81,26 +83,40 @@ > // synchronously) > final ICWatchpointTarget.GetSizeRequest request = new GetSizeRequest() { > public void done() { >- // Now that we have the size, put up a dialog to create the watchpoint >- final int size = getSize(); >- assert size > 0 : "unexpected variale/expression size"; //$NON-NLS-1$ >- WorkbenchJob job = new WorkbenchJob("open watchpoint dialog") { //$NON-NLS-1$ >- @Override >- public IStatus runInUIThread(IProgressMonitor monitor) { >- AddWatchpointDialog dlg = new AddWatchpointDialog(CDebugUIPlugin.getActiveWorkbenchShell(), >- getMemorySpaceManagement()); >- dlg.setExpression(expr); >- dlg.initializeRange(false, Integer.toString(size)); >- if (dlg.open() == Window.OK) { >- addWatchpoint(dlg.getWriteAccess(), dlg.getReadAccess(), dlg.getExpression(), dlg.getMemorySpace(), dlg.getRange()); >+ if (isSuccess()) { >+ // Now that we have the size, put up a dialog to create the watchpoint >+ final int size = getSize(); >+ assert size > 0 : "unexpected variale/expression size"; //$NON-NLS-1$ >+ WorkbenchJob job = new WorkbenchJob("open watchpoint dialog") { //$NON-NLS-1$ >+ @Override >+ public IStatus runInUIThread(IProgressMonitor monitor) { >+ AddWatchpointDialog dlg = new AddWatchpointDialog(CDebugUIPlugin.getActiveWorkbenchShell(), >+ getMemorySpaceManagement()); >+ dlg.setExpression(expr); >+ dlg.initializeRange(false, Integer.toString(size)); >+ if (dlg.open() == Window.OK) { >+ addWatchpoint(dlg.getWriteAccess(), dlg.getReadAccess(), dlg.getExpression(), dlg.getMemorySpace(), dlg.getRange()); >+ } >+ return Status.OK_STATUS; > } >- return Status.OK_STATUS; >- } >- }; >- job.setSystem(true); >- job.schedule(); >+ }; >+ job.setSystem(true); >+ job.schedule(); >+ } >+ else { >+ WorkbenchJob job = new WorkbenchJob("watchpoint error") { //$NON-NLS-1$ >+ @Override >+ public IStatus runInUIThread(IProgressMonitor monitor) { >+ if (fActivePart != null) { >+ ErrorDialog.openError( fActivePart.getSite().getWorkbenchWindow().getShell(), ActionMessages.getString( "AddWatchpointOnVariableActionDelegate.Error_Dlg_Title" ), ActionMessages.getString( "AddWatchpointOnVariableActionDelegate.No_Element_Size" ), getStatus() ); //$NON-NLS-1$ //$NON-NLS-2$ >+ } >+ return Status.OK_STATUS; >+ } >+ }; >+ job.setSystem(true); >+ job.schedule(); >+ } > } >- > }; > fVar.getSize(request); > } >Index: src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/DisassemblyBackendCdi.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt/all/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/DisassemblyBackendCdi.java,v >retrieving revision 1.3 >diff -u -r1.3 DisassemblyBackendCdi.java >--- src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/DisassemblyBackendCdi.java 19 Feb 2010 23:47:04 -0000 1.3 >+++ src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/DisassemblyBackendCdi.java 22 Feb 2010 17:39:56 -0000 >@@ -201,7 +201,7 @@ > @Override > public void done() { > fCallback.setUpdatePending(false); >- if (!isCanceled()) { >+ if (isSuccess()) { > BigInteger address= getAddress(); > if (targetFrame == 0) { > fCallback.updatePC(address); >@@ -269,7 +269,7 @@ > final IDisassemblyRetrieval.DisassemblyRequest disassemblyRequest= new DisassemblyRequest() { > @Override > public void done() { >- if (!isCanceled() && getDisassemblyBlock() != null) { >+ if (isSuccess() && getDisassemblyBlock() != null) { > insertDisassembly(startAddress, getDisassemblyBlock(), mixed, showSymbols, showDisassembly); > } else { > final IStatus status= getStatus(); >@@ -381,7 +381,7 @@ > final IDisassemblyRetrieval.DisassemblyRequest disassemblyRequest= new DisassemblyRequest() { > @Override > public void done() { >- if (!isCanceled() && getDisassemblyBlock() != null) { >+ if (isSuccess() && getDisassemblyBlock() != null) { > insertDisassembly(null, getDisassemblyBlock(), mixed, showSymbols, showDisassembly); > } else { > final IStatus status= getStatus(); >#P org.eclipse.cdt.dsf.gdb.ui >Index: src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/GdbVariableVMNode.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/GdbVariableVMNode.java,v >retrieving revision 1.2 >diff -u -r1.2 GdbVariableVMNode.java >--- src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/GdbVariableVMNode.java 22 Feb 2010 15:07:46 -0000 1.2 >+++ src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/GdbVariableVMNode.java 22 Feb 2010 17:39:56 -0000 >@@ -19,9 +19,11 @@ > import org.eclipse.cdt.dsf.debug.service.IExpressions.IExpressionDMContext; > import org.eclipse.cdt.dsf.debug.ui.viewmodel.variable.SyncVariableDataAccess; > import org.eclipse.cdt.dsf.debug.ui.viewmodel.variable.VariableVMNode; >+import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin; > import org.eclipse.cdt.dsf.service.DsfSession; > import org.eclipse.cdt.dsf.ui.viewmodel.datamodel.AbstractDMVMProvider; > import org.eclipse.cdt.dsf.ui.viewmodel.datamodel.IDMVMContext; >+import org.eclipse.core.runtime.Status; > > /** > * Specialization of DSF's VariableVMNode. See >@@ -70,6 +72,7 @@ > if (isSuccess()) { > request.setSize(getData().getSize()); > } >+ request.setStatus(getStatus()); > request.done(); > } > }; >@@ -77,12 +80,14 @@ > expressionService.getExpressionAddressData(exprDmc, drm); > } > else { >+ request.setStatus(internalError()); > request.done(); > } > } > }); > } > else { >+ request.setStatus(internalError()); > request.done(); > } > } >@@ -108,6 +113,7 @@ > assert getData().getSize() > 0; > request.setCanCreate(true); > } >+ request.setStatus(getStatus()); > request.done(); > } > }; >@@ -115,18 +121,26 @@ > expressionService.getExpressionAddressData(exprDmc, drm); > } > else { >+ request.setStatus(internalError()); > request.done(); > } > } > }); > } > else { >+ request.setStatus(internalError()); > request.done(); > } > } > }; > > /** >+ * Utility method to create an IStatus object for an internal error >+ */ >+ private static Status internalError() { >+ return new Status(Status.ERROR, GdbUIPlugin.getUniqueIdentifier(), Messages.Internal_Error); >+ } >+ /** > * Constructor (passthru) > */ > public GdbVariableVMNode(AbstractDMVMProvider provider, DsfSession session, >Index: src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/Messages.java >=================================================================== >RCS file: src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/Messages.java >diff -N src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/Messages.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/Messages.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,16 @@ >+package org.eclipse.cdt.dsf.gdb.internal.ui.viewmodel; >+ >+import org.eclipse.osgi.util.NLS; >+ >+ >+public class Messages extends NLS { >+ >+ static { >+ // initialize resource bundle >+ NLS.initializeMessages(Messages.class.getName(), Messages.class); >+ } >+ >+ private Messages() {} >+ >+ public static String Internal_Error; >+} >Index: src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/messages.properties >=================================================================== >RCS file: src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/messages.properties >diff -N src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/messages.properties >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/cdt/dsf/gdb/internal/ui/viewmodel/messages.properties 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,1 @@ >+Internal_Error=Internal Error
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:
john.cortell
:
iplog-
john.cortell
:
review?
Actions:
View
|
Diff
Attachments on
bug 248606
:
159245
|
159459
|
159500
|
159725
| 159821