mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
198979
This commit is contained in:
parent
91a2802384
commit
e58cfb9ff8
7 changed files with 51 additions and 1 deletions
|
@ -414,6 +414,8 @@ public abstract class AbstractPane extends Canvas
|
||||||
fCaretAddress = fRendering.getMemoryBlockEndAddress().add(
|
fCaretAddress = fRendering.getMemoryBlockEndAddress().add(
|
||||||
BigInteger.valueOf(cellOffset / fRendering.getAddressableSize()));
|
BigInteger.valueOf(cellOffset / fRendering.getAddressableSize()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fRendering.setCaretAddress(fCaretAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean isOdd(int value)
|
protected boolean isOdd(int value)
|
||||||
|
|
|
@ -181,6 +181,7 @@ public class AddressPane extends AbstractPane
|
||||||
|
|
||||||
this.fCaretAddress = cellAddress;
|
this.fCaretAddress = cellAddress;
|
||||||
this.fSubCellCaretPosition = x2;
|
this.fSubCellCaretPosition = x2;
|
||||||
|
setCaretAddress(fCaretAddress);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
|
|
|
@ -211,6 +211,7 @@ public class DataPane extends AbstractPane
|
||||||
|
|
||||||
this.fCaretAddress = cellAddress;
|
this.fCaretAddress = cellAddress;
|
||||||
this.fSubCellCaretPosition = subCellCharacterPosition;
|
this.fSubCellCaretPosition = subCellCharacterPosition;
|
||||||
|
setCaretAddress(fCaretAddress);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
|
|
|
@ -23,6 +23,9 @@ import org.eclipse.debug.internal.ui.views.memory.renderings.GoToAddressComposit
|
||||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||||
import org.eclipse.jface.resource.JFaceResources;
|
import org.eclipse.jface.resource.JFaceResources;
|
||||||
import org.eclipse.swt.SWT;
|
import org.eclipse.swt.SWT;
|
||||||
|
import org.eclipse.swt.dnd.Clipboard;
|
||||||
|
import org.eclipse.swt.dnd.TextTransfer;
|
||||||
|
import org.eclipse.swt.dnd.Transfer;
|
||||||
import org.eclipse.swt.events.ControlEvent;
|
import org.eclipse.swt.events.ControlEvent;
|
||||||
import org.eclipse.swt.events.ControlListener;
|
import org.eclipse.swt.events.ControlListener;
|
||||||
import org.eclipse.swt.events.KeyAdapter;
|
import org.eclipse.swt.events.KeyAdapter;
|
||||||
|
@ -1568,6 +1571,28 @@ public class Rendering extends Composite implements IDebugEventSetListener
|
||||||
fBinaryPane.settingsChanged();
|
fBinaryPane.settingsChanged();
|
||||||
fTextPane.settingsChanged();
|
fTextPane.settingsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void copyAddressToClipboard()
|
||||||
|
{
|
||||||
|
Clipboard clip = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
clip = new Clipboard(getDisplay());
|
||||||
|
|
||||||
|
String addressString = "0x" + getCaretAddress().toString(16);
|
||||||
|
|
||||||
|
TextTransfer plainTextTransfer = TextTransfer.getInstance();
|
||||||
|
clip.setContents(new Object[] { addressString },
|
||||||
|
new Transfer[] { plainTextTransfer });
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if(clip != null)
|
||||||
|
{
|
||||||
|
clip.dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static final char[] hexdigits = { '0', '1', '2', '3', '4', '5', '6', '7',
|
static final char[] hexdigits = { '0', '1', '2', '3', '4', '5', '6', '7',
|
||||||
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
|
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
|
||||||
|
|
|
@ -183,6 +183,7 @@ public class TextPane extends AbstractPane
|
||||||
|
|
||||||
this.fCaretAddress = cellAddress;
|
this.fCaretAddress = cellAddress;
|
||||||
this.fSubCellCaretPosition = x2;
|
this.fSubCellCaretPosition = x2;
|
||||||
|
setCaretAddress(fCaretAddress);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(Exception e)
|
catch(Exception e)
|
||||||
|
|
|
@ -484,6 +484,24 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe
|
||||||
// copy
|
// copy
|
||||||
|
|
||||||
final Action copyAction = new CopyAction(this.fRendering);
|
final Action copyAction = new CopyAction(this.fRendering);
|
||||||
|
|
||||||
|
// copy address
|
||||||
|
|
||||||
|
final Action copyAddressAction = new Action(
|
||||||
|
TraditionalRenderingMessages
|
||||||
|
.getString("TraditionalRendering.COPY_ADDRESS")) //$NON-NLS-1$
|
||||||
|
{
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
Display.getDefault().asyncExec(new Runnable()
|
||||||
|
{
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
TraditionalRendering.this.fRendering.copyAddressToClipboard();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// go to address
|
// go to address
|
||||||
|
|
||||||
|
@ -925,6 +943,7 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe
|
||||||
manager.add(new Separator());
|
manager.add(new Separator());
|
||||||
|
|
||||||
manager.add(copyAction);
|
manager.add(copyAction);
|
||||||
|
manager.add(copyAddressAction);
|
||||||
|
|
||||||
manager.add(gotoAddressAction);
|
manager.add(gotoAddressAction);
|
||||||
manager.add(gotoBaseAddressAction);
|
manager.add(gotoBaseAddressAction);
|
||||||
|
|
|
@ -45,4 +45,5 @@ TraditionalRendering.COLUMN_COUNT_5=5
|
||||||
TraditionalRendering.COLUMN_COUNT_6=6
|
TraditionalRendering.COLUMN_COUNT_6=6
|
||||||
TraditionalRendering.COLUMN_COUNT_7=7
|
TraditionalRendering.COLUMN_COUNT_7=7
|
||||||
TraditionalRendering.COLUMN_COUNT_8=8
|
TraditionalRendering.COLUMN_COUNT_8=8
|
||||||
TraditionalRendering.COLUMN_COUNT_CUSTOM=Custom...
|
TraditionalRendering.COLUMN_COUNT_CUSTOM=Custom...
|
||||||
|
TraditionalRendering.COPY_ADDRESS=Copy Address
|
Loading…
Add table
Reference in a new issue