mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 02:06:01 +02:00
[302554] [disassembly][api] Provisional disassembly API should use IAddress instead of BigInteger
This commit is contained in:
parent
ae828d8792
commit
1e9767d045
9 changed files with 225 additions and 232 deletions
|
@ -10,8 +10,6 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.dsf.gdb.internal.ui.actions;
|
package org.eclipse.cdt.dsf.gdb.internal.ui.actions;
|
||||||
|
|
||||||
import java.math.BigInteger;
|
|
||||||
|
|
||||||
import org.eclipse.cdt.core.IAddress;
|
import org.eclipse.cdt.core.IAddress;
|
||||||
import org.eclipse.cdt.debug.core.CDIDebugModel;
|
import org.eclipse.cdt.debug.core.CDIDebugModel;
|
||||||
import org.eclipse.cdt.debug.core.model.IMoveToAddress;
|
import org.eclipse.cdt.debug.core.model.IMoveToAddress;
|
||||||
|
@ -21,7 +19,6 @@ import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.Disassembly
|
||||||
import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.IDisassemblyPart;
|
import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.IDisassemblyPart;
|
||||||
import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.IDisassemblySelection;
|
import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.IDisassemblySelection;
|
||||||
import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin;
|
import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin;
|
||||||
import org.eclipse.cdt.utils.Addr64;
|
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IAdaptable;
|
import org.eclipse.core.runtime.IAdaptable;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
|
@ -46,12 +43,8 @@ public class DisassemblyMoveToLineAdapter implements IMoveToLineTarget {
|
||||||
selection = new DisassemblySelection((ITextSelection)selection, (IDisassemblyPart)part);
|
selection = new DisassemblySelection((ITextSelection)selection, (IDisassemblyPart)part);
|
||||||
}
|
}
|
||||||
IDisassemblySelection disassemblySelection = (IDisassemblySelection)selection;
|
IDisassemblySelection disassemblySelection = (IDisassemblySelection)selection;
|
||||||
BigInteger rawAddress = disassemblySelection.getStartAddress();
|
final IAddress address = disassemblySelection.getStartAddress();
|
||||||
if (rawAddress == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
final IAddress address = new Addr64(rawAddress);
|
|
||||||
if (address != null && target instanceof IAdaptable) {
|
if (address != null && target instanceof IAdaptable) {
|
||||||
final IMoveToAddress moveToAddress = (IMoveToAddress)((IAdaptable)target).getAdapter(IMoveToAddress.class);
|
final IMoveToAddress moveToAddress = (IMoveToAddress)((IAdaptable)target).getAdapter(IMoveToAddress.class);
|
||||||
if (moveToAddress != null && moveToAddress.canMoveToAddress(address)) {
|
if (moveToAddress != null && moveToAddress.canMoveToAddress(address)) {
|
||||||
|
@ -77,12 +70,11 @@ public class DisassemblyMoveToLineAdapter implements IMoveToLineTarget {
|
||||||
selection = new DisassemblySelection((ITextSelection)selection, (IDisassemblyPart)part);
|
selection = new DisassemblySelection((ITextSelection)selection, (IDisassemblyPart)part);
|
||||||
}
|
}
|
||||||
IDisassemblySelection disassemblySelection = (IDisassemblySelection)selection;
|
IDisassemblySelection disassemblySelection = (IDisassemblySelection)selection;
|
||||||
BigInteger rawAddress = disassemblySelection.getStartAddress();
|
final IAddress address = disassemblySelection.getStartAddress();
|
||||||
if (rawAddress == null) {
|
if (address == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
final IAddress address = new Addr64(rawAddress);
|
|
||||||
return moveToAddress.canMoveToAddress(address);
|
return moveToAddress.canMoveToAddress(address);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,6 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.dsf.gdb.internal.ui.actions;
|
package org.eclipse.cdt.dsf.gdb.internal.ui.actions;
|
||||||
|
|
||||||
import java.math.BigInteger;
|
|
||||||
|
|
||||||
import org.eclipse.cdt.core.IAddress;
|
import org.eclipse.cdt.core.IAddress;
|
||||||
import org.eclipse.cdt.debug.core.CDIDebugModel;
|
import org.eclipse.cdt.debug.core.CDIDebugModel;
|
||||||
import org.eclipse.cdt.debug.core.model.IResumeAtAddress;
|
import org.eclipse.cdt.debug.core.model.IResumeAtAddress;
|
||||||
|
@ -21,7 +19,6 @@ import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.Disassembly
|
||||||
import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.IDisassemblyPart;
|
import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.IDisassemblyPart;
|
||||||
import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.IDisassemblySelection;
|
import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.IDisassemblySelection;
|
||||||
import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin;
|
import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin;
|
||||||
import org.eclipse.cdt.utils.Addr64;
|
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IAdaptable;
|
import org.eclipse.core.runtime.IAdaptable;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
|
@ -46,12 +43,8 @@ public class DisassemblyResumeAtLineAdapter implements IResumeAtLineTarget {
|
||||||
selection = new DisassemblySelection((ITextSelection)selection, (IDisassemblyPart)part);
|
selection = new DisassemblySelection((ITextSelection)selection, (IDisassemblyPart)part);
|
||||||
}
|
}
|
||||||
IDisassemblySelection disassemblySelection = (IDisassemblySelection)selection;
|
IDisassemblySelection disassemblySelection = (IDisassemblySelection)selection;
|
||||||
BigInteger rawAddress = disassemblySelection.getStartAddress();
|
final IAddress address = disassemblySelection.getStartAddress();
|
||||||
if (rawAddress == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
final IAddress address = new Addr64(rawAddress);
|
|
||||||
if (address != null && target instanceof IAdaptable) {
|
if (address != null && target instanceof IAdaptable) {
|
||||||
final IResumeAtAddress resumeAtAddress = (IResumeAtAddress)((IAdaptable)target).getAdapter(IResumeAtAddress.class);
|
final IResumeAtAddress resumeAtAddress = (IResumeAtAddress)((IAdaptable)target).getAdapter(IResumeAtAddress.class);
|
||||||
if (resumeAtAddress != null && resumeAtAddress.canResumeAtAddress(address)) {
|
if (resumeAtAddress != null && resumeAtAddress.canResumeAtAddress(address)) {
|
||||||
|
@ -77,12 +70,11 @@ public class DisassemblyResumeAtLineAdapter implements IResumeAtLineTarget {
|
||||||
selection = new DisassemblySelection((ITextSelection)selection, (IDisassemblyPart)part);
|
selection = new DisassemblySelection((ITextSelection)selection, (IDisassemblyPart)part);
|
||||||
}
|
}
|
||||||
IDisassemblySelection disassemblySelection = (IDisassemblySelection)selection;
|
IDisassemblySelection disassemblySelection = (IDisassemblySelection)selection;
|
||||||
BigInteger rawAddress = disassemblySelection.getStartAddress();
|
final IAddress address = disassemblySelection.getStartAddress();
|
||||||
if (rawAddress == null) {
|
if (address == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
final IAddress address = new Addr64(rawAddress);
|
|
||||||
return resumeAtAddress.canResumeAtAddress(address);
|
return resumeAtAddress.canResumeAtAddress(address);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,6 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.dsf.gdb.internal.ui.actions;
|
package org.eclipse.cdt.dsf.gdb.internal.ui.actions;
|
||||||
|
|
||||||
import java.math.BigInteger;
|
|
||||||
|
|
||||||
import org.eclipse.cdt.core.IAddress;
|
import org.eclipse.cdt.core.IAddress;
|
||||||
import org.eclipse.cdt.debug.core.CDIDebugModel;
|
import org.eclipse.cdt.debug.core.CDIDebugModel;
|
||||||
import org.eclipse.cdt.debug.core.model.IRunToAddress;
|
import org.eclipse.cdt.debug.core.model.IRunToAddress;
|
||||||
|
@ -20,7 +18,6 @@ import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.Disassembly
|
||||||
import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.IDisassemblyPart;
|
import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.IDisassemblyPart;
|
||||||
import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.IDisassemblySelection;
|
import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.IDisassemblySelection;
|
||||||
import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin;
|
import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin;
|
||||||
import org.eclipse.cdt.utils.Addr64;
|
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IAdaptable;
|
import org.eclipse.core.runtime.IAdaptable;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
|
@ -51,12 +48,8 @@ public class DisassemblyRunToLineAdapter implements IRunToLineTarget {
|
||||||
selection = new DisassemblySelection((ITextSelection)selection, (IDisassemblyPart)part);
|
selection = new DisassemblySelection((ITextSelection)selection, (IDisassemblyPart)part);
|
||||||
}
|
}
|
||||||
IDisassemblySelection disassemblySelection = (IDisassemblySelection)selection;
|
IDisassemblySelection disassemblySelection = (IDisassemblySelection)selection;
|
||||||
BigInteger rawAddress = disassemblySelection.getStartAddress();
|
final IAddress address = disassemblySelection.getStartAddress();
|
||||||
if (rawAddress == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
final IAddress address = new Addr64(rawAddress);
|
|
||||||
if (address != null && target instanceof IAdaptable) {
|
if (address != null && target instanceof IAdaptable) {
|
||||||
final IRunToAddress runToAddress = (IRunToAddress)((IAdaptable)target).getAdapter(IRunToAddress.class);
|
final IRunToAddress runToAddress = (IRunToAddress)((IAdaptable)target).getAdapter(IRunToAddress.class);
|
||||||
if (runToAddress != null && runToAddress.canRunToAddress(address)) {
|
if (runToAddress != null && runToAddress.canRunToAddress(address)) {
|
||||||
|
@ -86,12 +79,11 @@ public class DisassemblyRunToLineAdapter implements IRunToLineTarget {
|
||||||
selection = new DisassemblySelection((ITextSelection)selection, (IDisassemblyPart)part);
|
selection = new DisassemblySelection((ITextSelection)selection, (IDisassemblyPart)part);
|
||||||
}
|
}
|
||||||
IDisassemblySelection disassemblySelection = (IDisassemblySelection)selection;
|
IDisassemblySelection disassemblySelection = (IDisassemblySelection)selection;
|
||||||
BigInteger rawAddress = disassemblySelection.getStartAddress();
|
final IAddress address = disassemblySelection.getStartAddress();
|
||||||
if (rawAddress == null) {
|
if (address == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
final IAddress address = new Addr64(rawAddress);
|
|
||||||
return runToAddress.canRunToAddress(address);
|
return runToAddress.canRunToAddress(address);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2009 Wind River Systems, Inc. and others.
|
* Copyright (c) 2009, 2010 Wind River Systems, Inc. and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -10,18 +10,17 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.dsf.gdb.internal.ui.breakpoints;
|
package org.eclipse.cdt.dsf.gdb.internal.ui.breakpoints;
|
||||||
|
|
||||||
import java.math.BigInteger;
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.IAddress;
|
||||||
import org.eclipse.cdt.debug.core.CDIDebugModel;
|
import org.eclipse.cdt.debug.core.CDIDebugModel;
|
||||||
import org.eclipse.cdt.debug.core.model.ICBreakpointType;
|
import org.eclipse.cdt.debug.core.model.ICBreakpointType;
|
||||||
import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.DisassemblySelection;
|
import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.DisassemblySelection;
|
||||||
import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.IDisassemblyPart;
|
import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.IDisassemblyPart;
|
||||||
import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.IDisassemblySelection;
|
import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.IDisassemblySelection;
|
||||||
import org.eclipse.cdt.utils.Addr64;
|
|
||||||
import org.eclipse.core.filesystem.URIUtil;
|
import org.eclipse.core.filesystem.URIUtil;
|
||||||
import org.eclipse.core.resources.IMarker;
|
import org.eclipse.core.resources.IMarker;
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
|
@ -125,7 +124,7 @@ public class DisassemblyToggleBreakpointsTarget implements IToggleBreakpointsTar
|
||||||
return breakpoints.toArray(breakpointsArray );
|
return breakpoints.toArray(breakpointsArray );
|
||||||
}
|
}
|
||||||
private void insertBreakpoint(IDisassemblySelection selection) throws CoreException {
|
private void insertBreakpoint(IDisassemblySelection selection) throws CoreException {
|
||||||
BigInteger address = selection.getStartAddress();
|
IAddress address = selection.getStartAddress();
|
||||||
if (address == null) {
|
if (address == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -147,7 +146,7 @@ public class DisassemblyToggleBreakpointsTarget implements IToggleBreakpointsTar
|
||||||
CDIDebugModel.createLineBreakpoint(filePath, resource, ICBreakpointType.REGULAR, srcLine + 1, true, 0, "", true); //$NON-NLS-1$
|
CDIDebugModel.createLineBreakpoint(filePath, resource, ICBreakpointType.REGULAR, srcLine + 1, true, 0, "", true); //$NON-NLS-1$
|
||||||
} else {
|
} else {
|
||||||
IResource resource = ResourcesPlugin.getWorkspace().getRoot();
|
IResource resource = ResourcesPlugin.getWorkspace().getRoot();
|
||||||
CDIDebugModel.createAddressBreakpoint(null, null, resource, ICBreakpointType.REGULAR, new Addr64(address), true, 0, "", true); //$NON-NLS-1$
|
CDIDebugModel.createAddressBreakpoint(null, null, resource, ICBreakpointType.REGULAR, address, true, 0, "", true); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -10,18 +10,17 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.dsf.gdb.internal.ui.breakpoints;
|
package org.eclipse.cdt.dsf.gdb.internal.ui.breakpoints;
|
||||||
|
|
||||||
import java.math.BigInteger;
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.IAddress;
|
||||||
import org.eclipse.cdt.debug.core.CDIDebugModel;
|
import org.eclipse.cdt.debug.core.CDIDebugModel;
|
||||||
import org.eclipse.cdt.debug.core.model.ICBreakpointType;
|
import org.eclipse.cdt.debug.core.model.ICBreakpointType;
|
||||||
import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.DisassemblySelection;
|
import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.DisassemblySelection;
|
||||||
import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.IDisassemblyPart;
|
import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.IDisassemblyPart;
|
||||||
import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.IDisassemblySelection;
|
import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.IDisassemblySelection;
|
||||||
import org.eclipse.cdt.utils.Addr64;
|
|
||||||
import org.eclipse.core.filesystem.URIUtil;
|
import org.eclipse.core.filesystem.URIUtil;
|
||||||
import org.eclipse.core.resources.IMarker;
|
import org.eclipse.core.resources.IMarker;
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
|
@ -125,7 +124,7 @@ public class DisassemblyToggleTracepointsTarget implements IToggleBreakpointsTar
|
||||||
return breakpoints.toArray(breakpointsArray );
|
return breakpoints.toArray(breakpointsArray );
|
||||||
}
|
}
|
||||||
private void insertBreakpoint(IDisassemblySelection selection) throws CoreException {
|
private void insertBreakpoint(IDisassemblySelection selection) throws CoreException {
|
||||||
BigInteger address = selection.getStartAddress();
|
IAddress address = selection.getStartAddress();
|
||||||
if (address == null) {
|
if (address == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -147,7 +146,7 @@ public class DisassemblyToggleTracepointsTarget implements IToggleBreakpointsTar
|
||||||
CDIDebugModel.createLineTracepoint(filePath, resource, ICBreakpointType.REGULAR, srcLine + 1, true, 0, "", true); //$NON-NLS-1$
|
CDIDebugModel.createLineTracepoint(filePath, resource, ICBreakpointType.REGULAR, srcLine + 1, true, 0, "", true); //$NON-NLS-1$
|
||||||
} else {
|
} else {
|
||||||
IResource resource = ResourcesPlugin.getWorkspace().getRoot();
|
IResource resource = ResourcesPlugin.getWorkspace().getRoot();
|
||||||
CDIDebugModel.createAddressTracepoint(null, null, resource, ICBreakpointType.REGULAR, -1, new Addr64(address), true, 0, "", true); //$NON-NLS-1$
|
CDIDebugModel.createAddressTracepoint(null, null, resource, ICBreakpointType.REGULAR, -1, address, true, 0, "", true); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -20,6 +20,7 @@ import java.util.List;
|
||||||
import java.util.ListIterator;
|
import java.util.ListIterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.IAddress;
|
||||||
import org.eclipse.cdt.debug.internal.ui.disassembly.dsf.AddressRangePosition;
|
import org.eclipse.cdt.debug.internal.ui.disassembly.dsf.AddressRangePosition;
|
||||||
import org.eclipse.cdt.debug.internal.ui.disassembly.dsf.DisassemblyPosition;
|
import org.eclipse.cdt.debug.internal.ui.disassembly.dsf.DisassemblyPosition;
|
||||||
import org.eclipse.cdt.debug.internal.ui.disassembly.dsf.ErrorPosition;
|
import org.eclipse.cdt.debug.internal.ui.disassembly.dsf.ErrorPosition;
|
||||||
|
@ -190,8 +191,6 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
||||||
private static final String COMMAND_ID_GOTO_ADDRESS = "org.eclipse.cdt.dsf.debug.ui.disassembly.commands.gotoAddress"; //$NON-NLS-1$
|
private static final String COMMAND_ID_GOTO_ADDRESS = "org.eclipse.cdt.dsf.debug.ui.disassembly.commands.gotoAddress"; //$NON-NLS-1$
|
||||||
private static final String COMMAND_ID_GOTO_PC = "org.eclipse.cdt.dsf.debug.ui.disassembly.commands.gotoPC"; //$NON-NLS-1$
|
private static final String COMMAND_ID_GOTO_PC = "org.eclipse.cdt.dsf.debug.ui.disassembly.commands.gotoPC"; //$NON-NLS-1$
|
||||||
private static final String COMMAND_ID_TOGGLE_BREAKPOINT = "org.eclipse.cdt.dsf.debug.ui.disassembly.commands.rulerToggleBreakpoint"; //$NON-NLS-1$
|
private static final String COMMAND_ID_TOGGLE_BREAKPOINT = "org.eclipse.cdt.dsf.debug.ui.disassembly.commands.rulerToggleBreakpoint"; //$NON-NLS-1$
|
||||||
// private static final String COMMAND_ID_RUN_TO_LINE = "org.eclipse.debug.ui.commands.RunToLine"; //$NON-NLS-1$
|
|
||||||
// private static final String COMMAND_ID_TOGGLE_STEPPING_MODE = "org.eclipse.cdt.dsf.debug.ui.debug.ui.menu.showDisassemblyAction"; //$NON-NLS-1$
|
|
||||||
|
|
||||||
public static final String KEY_BINDING_CONTEXT_DISASSEMBLY = "org.eclipse.cdt.dsf.debug.ui.disassembly.context"; //$NON-NLS-1$
|
public static final String KEY_BINDING_CONTEXT_DISASSEMBLY = "org.eclipse.cdt.dsf.debug.ui.disassembly.context"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
@ -1341,6 +1340,15 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
||||||
/*
|
/*
|
||||||
* @see org.eclipse.cdt.dsf.debug.internal.ui.disassembly.IDisassemblyPart#gotoAddress(java.math.BigInteger)
|
* @see org.eclipse.cdt.dsf.debug.internal.ui.disassembly.IDisassemblyPart#gotoAddress(java.math.BigInteger)
|
||||||
*/
|
*/
|
||||||
|
public final void gotoAddress(IAddress address) {
|
||||||
|
if (address != null) {
|
||||||
|
gotoAddress(address.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @see org.eclipse.cdt.debug.internal.ui.disassembly.dsf.IDisassemblyPartCallback#gotoAddress(java.math.BigInteger)
|
||||||
|
*/
|
||||||
public final void gotoAddress(BigInteger address) {
|
public final void gotoAddress(BigInteger address) {
|
||||||
fFocusAddress = address;
|
fFocusAddress = address;
|
||||||
if (fDebugSessionId == null) {
|
if (fDebugSessionId == null) {
|
||||||
|
|
|
@ -13,9 +13,12 @@ package org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional;
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.IAddress;
|
||||||
|
import org.eclipse.cdt.debug.internal.ui.disassembly.dsf.AddressRangePosition;
|
||||||
import org.eclipse.cdt.debug.internal.ui.disassembly.dsf.DisassemblyPosition;
|
import org.eclipse.cdt.debug.internal.ui.disassembly.dsf.DisassemblyPosition;
|
||||||
import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.SourcePosition;
|
import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.SourcePosition;
|
||||||
import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.model.DisassemblyDocument;
|
import org.eclipse.cdt.dsf.debug.internal.ui.disassembly.model.DisassemblyDocument;
|
||||||
|
import org.eclipse.cdt.utils.Addr64;
|
||||||
import org.eclipse.core.filesystem.URIUtil;
|
import org.eclipse.core.filesystem.URIUtil;
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
|
@ -35,7 +38,7 @@ public class DisassemblySelection implements IDisassemblySelection {
|
||||||
private final ITextSelection fTextSelection;
|
private final ITextSelection fTextSelection;
|
||||||
private IStorage fSourceFile;
|
private IStorage fSourceFile;
|
||||||
private int fSourceLine;
|
private int fSourceLine;
|
||||||
private BigInteger fStartAddress;
|
private IAddress fStartAddress;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a disassembly selection from a normal text selection and a disassembly part.
|
* Create a disassembly selection from a normal text selection and a disassembly part.
|
||||||
|
@ -56,17 +59,26 @@ public class DisassemblySelection implements IDisassemblySelection {
|
||||||
} catch (BadLocationException exc) {
|
} catch (BadLocationException exc) {
|
||||||
sourcePosition = null;
|
sourcePosition = null;
|
||||||
}
|
}
|
||||||
|
BigInteger docAddress = null;
|
||||||
if (sourcePosition != null) {
|
if (sourcePosition != null) {
|
||||||
fStartAddress = sourcePosition.fAddressOffset;
|
docAddress = sourcePosition.fAddressOffset;
|
||||||
if (sourcePosition.length > 0) {
|
if (sourcePosition.length > 0) {
|
||||||
fSourceFile = sourcePosition.fFileInfo.fFile;
|
fSourceFile = sourcePosition.fFileInfo.fFile;
|
||||||
DisassemblyPosition pos = (DisassemblyPosition) document.getDisassemblyPosition(fStartAddress);
|
AddressRangePosition pos = document.getDisassemblyPosition(docAddress);
|
||||||
if (pos != null) {
|
if (pos instanceof DisassemblyPosition) {
|
||||||
fSourceLine = pos.getLine();
|
fSourceLine = ((DisassemblyPosition) pos).getLine();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fStartAddress = document.getAddressOfOffset(offset);
|
docAddress = document.getAddressOfOffset(offset);
|
||||||
|
}
|
||||||
|
if (docAddress != null) {
|
||||||
|
try {
|
||||||
|
fStartAddress = new Addr64(docAddress);
|
||||||
|
} catch (RuntimeException rte) {
|
||||||
|
// not a valid address
|
||||||
|
fStartAddress = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -156,7 +168,7 @@ public class DisassemblySelection implements IDisassemblySelection {
|
||||||
/*
|
/*
|
||||||
* @see org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.IDisassemblySelection#getStartAddress()
|
* @see org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional.IDisassemblySelection#getStartAddress()
|
||||||
*/
|
*/
|
||||||
public BigInteger getStartAddress() {
|
public IAddress getStartAddress() {
|
||||||
return fStartAddress;
|
return fStartAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2008, 2009 Wind River Systems, Inc. and others.
|
* Copyright (c) 2008, 2010 Wind River Systems, Inc. and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -10,8 +10,7 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional;
|
package org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional;
|
||||||
|
|
||||||
import java.math.BigInteger;
|
import org.eclipse.cdt.core.IAddress;
|
||||||
|
|
||||||
import org.eclipse.jface.action.IMenuListener;
|
import org.eclipse.jface.action.IMenuListener;
|
||||||
import org.eclipse.jface.text.source.ISourceViewer;
|
import org.eclipse.jface.text.source.ISourceViewer;
|
||||||
import org.eclipse.ui.IWorkbenchPart;
|
import org.eclipse.ui.IWorkbenchPart;
|
||||||
|
@ -74,7 +73,7 @@ public interface IDisassemblyPart extends IWorkbenchPart {
|
||||||
*
|
*
|
||||||
* @param address
|
* @param address
|
||||||
*/
|
*/
|
||||||
void gotoAddress(BigInteger address);
|
void gotoAddress(IAddress address);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Navigate to current program counter.
|
* Navigate to current program counter.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2009 Wind River Systems, Inc. and others.
|
* Copyright (c) 2009, 2010 Wind River Systems, Inc. and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -10,9 +10,9 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional;
|
package org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional;
|
||||||
|
|
||||||
import java.math.BigInteger;
|
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.IAddress;
|
||||||
import org.eclipse.core.resources.IFile;
|
import org.eclipse.core.resources.IFile;
|
||||||
import org.eclipse.jface.text.ITextSelection;
|
import org.eclipse.jface.text.ITextSelection;
|
||||||
|
|
||||||
|
@ -28,9 +28,9 @@ import org.eclipse.jface.text.ITextSelection;
|
||||||
public interface IDisassemblySelection extends ITextSelection {
|
public interface IDisassemblySelection extends ITextSelection {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the address associated with the start of the selection
|
* @return the address associated with the start of the selection, may be <code>null</code>
|
||||||
*/
|
*/
|
||||||
BigInteger getStartAddress();
|
IAddress getStartAddress();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the {@link IFile} associated with the selection, may be <code>null</code>
|
* @return the {@link IFile} associated with the selection, may be <code>null</code>
|
||||||
|
|
Loading…
Add table
Reference in a new issue