Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Chuong2010-11-11 12:05:56 -0500
committerPatrick Chuong2010-11-11 12:05:56 -0500
commitb0f3b7b7689e2cef4c2b8e85b93e554478708e49 (patch)
tree8f85663abb23efaa8ef5dcd18e49861e574656ae /debug/org.eclipse.cdt.debug.ui
parenta754d862003304e8b61817d1b06328944d88284a (diff)
downloadorg.eclipse.cdt-b0f3b7b7689e2cef4c2b8e85b93e554478708e49.tar.gz
org.eclipse.cdt-b0f3b7b7689e2cef4c2b8e85b93e554478708e49.tar.xz
org.eclipse.cdt-b0f3b7b7689e2cef4c2b8e85b93e554478708e49.zip
Bug 329682 - [disassembly] Address bar does not work for symbols
Diffstat (limited to 'debug/org.eclipse.cdt.debug.ui')
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/DisassemblyBackendCdi.java52
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/IDisassemblyBackend.java10
2 files changed, 44 insertions, 18 deletions
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/DisassemblyBackendCdi.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/DisassemblyBackendCdi.java
index 3c0b54bc1f..87c0bb721f 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/DisassemblyBackendCdi.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/DisassemblyBackendCdi.java
@@ -8,6 +8,7 @@
* Contributors:
* Wind River Systems - initial API and implementation
* Freescale Semiconductor - refactoring
+ * Patrick Chuong (Texas Instruments) - Bug fix (329682)
*******************************************************************************/
package org.eclipse.cdt.debug.internal.ui.disassembly.dsf;
@@ -349,6 +350,20 @@ public class DisassemblyBackendCdi implements IDisassemblyBackend, IDebugEventSe
* @see org.eclipse.cdt.dsf.debug.internal.ui.disassembly.IDisassemblyBackend#gotoSymbol(java.lang.String)
*/
public void gotoSymbol(String symbol) {
+ final BigInteger address = evaluateSymbolAddress(symbol, false);
+ if (address != null) {
+ fCallback.asyncExec(new Runnable() {
+ public void run() {
+ fCallback.gotoAddress(address);
+ }});
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyBackend#evaluateSymbolAddress(java.lang.String, boolean)
+ */
+ public BigInteger evaluateSymbolAddress(String symbol, final boolean suppressError) {
if (fTargetFrameContext != null) {
try {
// This logic was lifted from CMemoryBlockRetrievalExtension.getExtendedMemoryBlock(String, Object)
@@ -368,11 +383,7 @@ public class DisassemblyBackendCdi implements IDisassemblyBackend, IDebugEventSe
String addressStr = cstackFrame.evaluateExpressionToString(expr);
if (addressStr != null) {
try {
- final BigInteger address = (addressStr.startsWith("0x")) ? new BigInteger(addressStr.substring(2), 16) : new BigInteger(addressStr); //$NON-NLS-1$
- fCallback.asyncExec(new Runnable() {
- public void run() {
- fCallback.gotoAddress(address);
- }});
+ return (addressStr.startsWith("0x")) ? new BigInteger(addressStr.substring(2), 16) : new BigInteger(addressStr); //$NON-NLS-1$
} catch (NumberFormatException e) {
if (i >= attempts.length) {
@@ -390,24 +401,29 @@ public class DisassemblyBackendCdi implements IDisassemblyBackend, IDebugEventSe
}
}
catch (final CDIException exc) {
- fCallback.asyncExec(new Runnable() {
- public void run() {
- ErrorDialog.openError(fCallback.getSite().getShell(),
- CDebugUIMessages.getString("DisassemblyBackendCdi_Error_Dlg_Title"), //$NON-NLS-1$
- null, new Status(IStatus.ERROR, CDebugUIPlugin.PLUGIN_ID, exc.getLocalizedMessage()));
- }});
+ if (!suppressError) {
+ fCallback.asyncExec(new Runnable() {
+ public void run() {
+ ErrorDialog.openError(fCallback.getSite().getShell(),
+ CDebugUIMessages.getString("DisassemblyBackendCdi_Error_Dlg_Title"), //$NON-NLS-1$
+ null, new Status(IStatus.ERROR, CDebugUIPlugin.PLUGIN_ID, exc.getLocalizedMessage()));
+ }});
+ }
}
catch (final DebugException exc) {
- fCallback.asyncExec(new Runnable() {
- public void run() {
- ErrorDialog.openError(fCallback.getSite().getShell(),
- CDebugUIMessages.getString("DisassemblyBackendCdi_Error_Dlg_Title"), //$NON-NLS-1$
- null, exc.getStatus());
- }});
+ if (!suppressError) {
+ fCallback.asyncExec(new Runnable() {
+ public void run() {
+ ErrorDialog.openError(fCallback.getSite().getShell(),
+ CDebugUIMessages.getString("DisassemblyBackendCdi_Error_Dlg_Title"), //$NON-NLS-1$
+ null, exc.getStatus());
+ }});
+ }
}
}
+ return null;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.cdt.dsf.debug.internal.ui.disassembly.IDisassemblyBackend#retrieveDisassembly(java.lang.String, int, java.math.BigInteger, boolean, boolean, boolean)
*/
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/IDisassemblyBackend.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/IDisassemblyBackend.java
index 04d6847659..0e65121e8c 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/IDisassemblyBackend.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/disassembly/dsf/IDisassemblyBackend.java
@@ -8,6 +8,7 @@
* Contributors:
* Wind River Systems - initial API and implementation
* Freescale Semiconductor - refactoring
+ * Patrick Chuong (Texas Instruments) - Bug fix (329682)
*******************************************************************************/
package org.eclipse.cdt.debug.internal.ui.disassembly.dsf;
@@ -141,6 +142,15 @@ public interface IDisassemblyBackend {
Object insertSource(Position pos, BigInteger address, final String file, int lineNumber);
void gotoSymbol(String symbol);
+
+ /**
+ * Evaluate the symbol address.
+ *
+ * @param symbol the symbol
+ * @param suppressError true to suppress error dialogs
+ * @return the address, <code>null</code> if failed to evaluate symbol
+ */
+ BigInteger evaluateSymbolAddress(String symbol, boolean suppressError);
/**
* Retrieves disassembly of the code generated by a source file, starting at

Back to the top