mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-12 18:55:38 +02:00
[302348] [dis] Expression support in DSF Disassembly view is too limited
This commit is contained in:
parent
29acaaa99c
commit
730d211888
1 changed files with 30 additions and 11 deletions
|
@ -39,6 +39,7 @@ import org.eclipse.cdt.dsf.debug.service.IRunControl;
|
||||||
import org.eclipse.cdt.dsf.debug.service.ISourceLookup;
|
import org.eclipse.cdt.dsf.debug.service.ISourceLookup;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IStack;
|
import org.eclipse.cdt.dsf.debug.service.IStack;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IDisassembly.IDisassemblyDMContext;
|
import org.eclipse.cdt.dsf.debug.service.IDisassembly.IDisassemblyDMContext;
|
||||||
|
import org.eclipse.cdt.dsf.debug.service.IExpressions.IExpressionDMAddress;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IExpressions.IExpressionDMContext;
|
import org.eclipse.cdt.dsf.debug.service.IExpressions.IExpressionDMContext;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IFormattedValues.FormattedValueDMContext;
|
import org.eclipse.cdt.dsf.debug.service.IFormattedValues.FormattedValueDMContext;
|
||||||
import org.eclipse.cdt.dsf.debug.service.IFormattedValues.FormattedValueDMData;
|
import org.eclipse.cdt.dsf.debug.service.IFormattedValues.FormattedValueDMData;
|
||||||
|
@ -822,27 +823,45 @@ public class DisassemblyBackendDsf implements IDisassemblyBackend, SessionEndedL
|
||||||
if (expressions == null) {
|
if (expressions == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
IExpressionDMContext exprDmc= expressions.createExpression(fTargetContext, '&'+symbol);
|
final IExpressionDMContext exprDmc= expressions.createExpression(fTargetContext, symbol);
|
||||||
final FormattedValueDMContext valueDmc= expressions.getFormattedValueContext(exprDmc, IFormattedValues.HEX_FORMAT);
|
// first, try to get l-value address
|
||||||
expressions.getFormattedExpressionValue(valueDmc, new DataRequestMonitor<FormattedValueDMData>(executor, null) {
|
expressions.getExpressionAddressData(exprDmc, new DataRequestMonitor<IExpressionDMAddress>(executor, null) {
|
||||||
@Override
|
@Override
|
||||||
protected void handleSuccess() {
|
protected void handleSuccess() {
|
||||||
FormattedValueDMData data= getData();
|
IExpressionDMAddress data = getData();
|
||||||
final String value= data.getFormattedValue();
|
final IAddress address = data.getAddress();
|
||||||
final BigInteger address= DisassemblyUtils.decodeAddress(value);
|
|
||||||
if (address != null) {
|
if (address != null) {
|
||||||
fCallback.asyncExec(new Runnable() {
|
fCallback.asyncExec(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
fCallback.gotoAddress(address);
|
fCallback.gotoAddress(address.getValue());
|
||||||
}});
|
}});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected void handleError() {
|
protected void handleError() {
|
||||||
fCallback.asyncExec(new Runnable() {
|
// not an l-value, evaluate expression
|
||||||
public void run() {
|
final FormattedValueDMContext valueDmc= expressions.getFormattedValueContext(exprDmc, IFormattedValues.HEX_FORMAT);
|
||||||
ErrorDialog.openError(fCallback.getSite().getShell(), "Error", null, getStatus()); //$NON-NLS-1$
|
expressions.getFormattedExpressionValue(valueDmc, new DataRequestMonitor<FormattedValueDMData>(executor, null) {
|
||||||
}});
|
@Override
|
||||||
|
protected void handleSuccess() {
|
||||||
|
FormattedValueDMData data= getData();
|
||||||
|
final String value= data.getFormattedValue();
|
||||||
|
final BigInteger address= DisassemblyUtils.decodeAddress(value);
|
||||||
|
if (address != null) {
|
||||||
|
fCallback.asyncExec(new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
fCallback.gotoAddress(address);
|
||||||
|
}});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
protected void handleError() {
|
||||||
|
fCallback.asyncExec(new Runnable() {
|
||||||
|
public void run() {
|
||||||
|
ErrorDialog.openError(fCallback.getSite().getShell(), "Error", null, getStatus()); //$NON-NLS-1$
|
||||||
|
}});
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}});
|
}});
|
||||||
|
|
Loading…
Add table
Reference in a new issue