Skip to main content
summaryrefslogtreecommitdiffstats
path: root/dsf
diff options
context:
space:
mode:
authorScott Tepavich2011-09-16 03:56:50 -0400
committerAnton Leherbauer2011-09-16 03:56:50 -0400
commit9fe6dfee8e88f4ff160c14863f635cf4d8e19816 (patch)
tree4d82c3ff4e9f275090dd63144d65e71240bedd71 /dsf
parent1f971379691d4b19285fd8ada25959e2c146e4ab (diff)
downloadorg.eclipse.cdt-9fe6dfee8e88f4ff160c14863f635cf4d8e19816.tar.gz
org.eclipse.cdt-9fe6dfee8e88f4ff160c14863f635cf4d8e19816.tar.xz
org.eclipse.cdt-9fe6dfee8e88f4ff160c14863f635cf4d8e19816.zip
Bug 357612 - [disassembly] Missing register tool-tips
Diffstat (limited to 'dsf')
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java22
-rw-r--r--dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyTextHover.java37
2 files changed, 43 insertions, 16 deletions
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java
index be6f711096..efe6dcaead 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyPart.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 Wind River Systems and others.
+ * Copyright (c) 2007, 2011 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
@@ -3021,6 +3021,26 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
}
/**
+ * A pass through to process the text to populate into a text hover.
+ */
+ public String getHoverInfoData(AddressRangePosition pos, String ident) {
+ if (fBackend != null ) {
+ return fBackend.getHoverInfoData(pos, ident);
+ }
+ return ""; //$NON-NLS-1$
+ }
+
+ /**
+ * A passthru from the text hover code to the backend.
+ */
+ public String evaluateRegister(String register) {
+ if (fBackend != null) {
+ return fBackend.evaluateRegister(register);
+ }
+ return ""; //$NON-NLS-1$
+ }
+
+ /**
* A passthru from the text hover code to the backend.
*/
public String evaluateExpression(String expr) {
diff --git a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyTextHover.java b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyTextHover.java
index 463d947eb9..81b867f58d 100644
--- a/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyTextHover.java
+++ b/dsf/org.eclipse.cdt.dsf.ui/src/org/eclipse/cdt/dsf/debug/internal/ui/disassembly/DisassemblyTextHover.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2010 Wind River Systems and others.
+ * Copyright (c) 2007, 2011 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
@@ -58,21 +58,29 @@ public class DisassemblyTextHover implements ITextHover {
String ident = doc.get(offset, hoverRegion.getLength());
String value = null;
pos = doc.getModelPosition(offset);
- if (pos instanceof SourcePosition) {
- value = evaluateExpression(ident);
- } else if (pos instanceof LabelPosition) {
- value = evaluateExpression(ident);
- } else if (pos instanceof DisassemblyPosition) {
- // first, try to evaluate as register
- value = evaluateRegister(ident);
- if (value == null) {
- // if this fails, try expression
+
+ value = fDisassemblyPart.getHoverInfoData(pos, ident);
+
+ // If returns null (or empty string), not implemented or something went wrong.
+ if (value == null || value.length() == 0) {
+ if (pos instanceof SourcePosition) {
+ value = evaluateExpression(ident);
+ } else if (pos instanceof LabelPosition) {
value = evaluateExpression(ident);
+ } else if (pos instanceof DisassemblyPosition) {
+ // first, try to evaluate as register
+ value = evaluateRegister(ident);
+ if (value == null) {
+ // if this fails, try expression
+ value = evaluateExpression(ident);
+ }
+ }
+ if (value != null) {
+ return ident + " = " + value; //$NON-NLS-1$
}
}
- if (value != null) {
- return ident + " = " + value; //$NON-NLS-1$
- }
+ else
+ return value;
} catch (BadLocationException e) {
if (DsfUIPlugin.getDefault().isDebugging()) {
DsfUIPlugin.getDefault().getLog().log(new Status(IStatus.ERROR, DsfUIPlugin.PLUGIN_ID, "Internal Error", e)); //$NON-NLS-1$
@@ -87,8 +95,7 @@ public class DisassemblyTextHover implements ITextHover {
* @return register value or <code>null</code>
*/
private String evaluateRegister(String register) {
- // TLETODO [disassembly] evaluate register
- return null;
+ return fDisassemblyPart.evaluateRegister(register);
}
/**

Back to the top