Skip to main content
summaryrefslogtreecommitdiffstats
path: root/dsf
diff options
context:
space:
mode:
authorPatrick Chuong2011-12-14 16:05:27 -0500
committerPatrick Chuong2011-12-14 16:05:27 -0500
commitcffc23093a9a22dc9a4b5e1a32a70772eccc37b7 (patch)
tree59d823c2f9aa1380440d97d1290333ad8fe97a9d /dsf
parentc1e775df38a76c1ccf7c78e3c1e3510525ac08c2 (diff)
downloadorg.eclipse.cdt-cffc23093a9a22dc9a4b5e1a32a70772eccc37b7.tar.gz
org.eclipse.cdt-cffc23093a9a22dc9a4b5e1a32a70772eccc37b7.tar.xz
org.eclipse.cdt-cffc23093a9a22dc9a4b5e1a32a70772eccc37b7.zip
Bug 353351 - DisassemblyBackendDsf.retrieveFrameAddressInSessionThread()
shows an error message to the user if stack.getFrameData fails.
Diffstat (limited to 'dsf')
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java29
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsfFactory.java15
2 files changed, 21 insertions, 23 deletions
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java
index 326aecac24..19b84a4110 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsf.java
@@ -9,8 +9,9 @@
* Wind River Systems - initial API and implementation
* Freescale Semiconductor - refactoring
* Patrick Chuong (Texas Instruments) - Bug 323279
- * Patrick Chuong (Texas Instruments) - Bug fix (329682)
+ * Patrick Chuong (Texas Instruments) - Bug 329682
* Patrick Chuong (Texas Instruments) - Bug 328168
+ * Patrick Chuong (Texas Instruments) - Bug 353351
*******************************************************************************/
package org.eclipse.cdt.dsf.debug.internal.ui.disassembly;
@@ -67,7 +68,6 @@ import org.eclipse.cdt.dsf.ui.viewmodel.datamodel.IDMVMContext;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.Position;
@@ -336,11 +336,7 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
} else {
final IStatus status= getStatus();
if (status != null && !status.isOK()) {
- fCallback.asyncExec(new Runnable() {
- public void run() {
- ErrorDialog.openError(fCallback.getSite().getShell(), "Error", null, getStatus()); //$NON-NLS-1$
- }
- });
+ DisassemblyBackendDsf.this.handleError(getStatus());
}
}
}
@@ -967,12 +963,8 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
rm.setStatus(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, IDsfStatusConstants.REQUEST_FAILED, "", null)); //$NON-NLS-1$
if (!suppressError) {
- fCallback.asyncExec(new Runnable() {
- public void run() {
- ErrorDialog.openError(fCallback.getSite().getShell(), "Error", null, //$NON-NLS-1$
- new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, IDsfStatusConstants.REQUEST_FAILED,
- DisassemblyMessages.Disassembly_log_error_expression_eval + " (" + e.getMessage() + ")", null)); //$NON-NLS-1$ //$NON-NLS-2$
- }});
+ DisassemblyBackendDsf.this.handleError(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, IDsfStatusConstants.REQUEST_FAILED,
+ DisassemblyMessages.Disassembly_log_error_expression_eval + " (" + e.getMessage() + ")", null)); //$NON-NLS-1$ //$NON-NLS-2$
}
}
rm.setData(address);
@@ -981,10 +973,7 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
@Override
protected void handleError() {
if (!suppressError) {
- fCallback.asyncExec(new Runnable() {
- public void run() {
- ErrorDialog.openError(fCallback.getSite().getShell(), "Error", null, getStatus()); //$NON-NLS-1$
- }});
+ DisassemblyBackendDsf.this.handleError(getStatus());
}
rm.setStatus(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, IDsfStatusConstants.REQUEST_FAILED, "", null)); //$NON-NLS-1$
rm.done();
@@ -1043,11 +1032,7 @@ public class DisassemblyBackendDsf extends AbstractDisassemblyBackend implements
} else {
final IStatus status= getStatus();
if (status != null && !status.isOK()) {
- fCallback.asyncExec(new Runnable() {
- public void run() {
- ErrorDialog.openError(fCallback.getSite().getShell(), "Error", null, getStatus()); //$NON-NLS-1$
- }
- });
+ DisassemblyBackendDsf.this.handleError(getStatus());
}
fCallback.setUpdatePending(false);
}
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsfFactory.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsfFactory.java
index 41b172ca4d..b24b8189d4 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsfFactory.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyBackendDsfFactory.java
@@ -7,10 +7,13 @@
*
* Contributors:
* Freescale Semiconductor - initial API and implementation
+ * Patrick Chuong (Texas Instruments) - Bug 353351
*******************************************************************************/
package org.eclipse.cdt.dsf.debug.internal.ui.disassembly;
import org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyBackend;
+import org.eclipse.cdt.dsf.service.DsfSession;
+import org.eclipse.cdt.dsf.ui.viewmodel.datamodel.IDMVMContext;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IAdapterFactory;
@@ -22,8 +25,18 @@ public class DisassemblyBackendDsfFactory implements IAdapterFactory {
@SuppressWarnings("rawtypes")
public Object getAdapter(Object adaptableObject, Class adapterType) {
- if (IDisassemblyBackend.class.equals(adapterType)) {
+ if (IDisassemblyBackend.class.equals(adapterType)) {
if (adaptableObject instanceof IAdaptable && DisassemblyBackendDsf.supportsDebugContext_((IAdaptable)adaptableObject)) {
+ String sessionId = ((IDMVMContext) adaptableObject).getDMContext().getSessionId();
+ DsfSession session = DsfSession.getSession(sessionId);
+ if (session.isActive()) {
+ IAdapterFactory factory = (IAdapterFactory) session.getModelAdapter(IAdapterFactory.class);
+ if (factory != null) {
+ Object adapter = factory.getAdapter(adaptableObject, adapterType);
+ if (adapter != null)
+ return adapter;
+ }
+ }
return new DisassemblyBackendDsf();
}
}

Back to the top