mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
199195 - IMemoryBlockConnection adapter
199197 - endian not properly handled during cell editing 199198 - edit coloring only reflects last keystroke
This commit is contained in:
parent
e58cfb9ff8
commit
0665f8bad3
3 changed files with 39 additions and 18 deletions
|
@ -75,11 +75,7 @@ public class DataPane extends AbstractPane
|
|||
if(isSigned)
|
||||
byteData[byteLen - 1] |= 128;
|
||||
|
||||
boolean shouldReorderBytes = fRendering.isLittleEndian() == bytes[0].isBigEndian(); // swapped in presentation
|
||||
if(!bytes[0].isBigEndian()) // swapped by BigInteger/java endianness
|
||||
shouldReorderBytes = !shouldReorderBytes;
|
||||
|
||||
if(shouldReorderBytes)
|
||||
if(fRendering.isLittleEndian() != bytes[0].isBigEndian())
|
||||
{
|
||||
byte[] byteDataSwapped = new byte[byteData.length];
|
||||
for(int i = 0; i < byteData.length; i++)
|
||||
|
@ -103,6 +99,8 @@ public class DataPane extends AbstractPane
|
|||
}
|
||||
else
|
||||
{
|
||||
if(bytes[i] instanceof TraditionalMemoryByte)
|
||||
bytesToSet[i].setEdited(((TraditionalMemoryByte) bytes[i]).isEdited());
|
||||
bytesToSet[i].setChanged(bytes[i].isChanged());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -141,6 +141,18 @@ public class Rendering extends Composite implements IDebugEventSetListener
|
|||
|
||||
this.fParent = renderingParent;
|
||||
|
||||
// initialize the viewport start
|
||||
if(fParent.getMemoryBlock() != null)
|
||||
{
|
||||
fViewportAddress = fParent.getMemoryBlockStartAddress();
|
||||
|
||||
// this will be null if memory may be retrieved at any address less than
|
||||
// this memory block's base. if so use the base address.
|
||||
if (fViewportAddress == null)
|
||||
fViewportAddress = fParent.getBigBaseAddress();
|
||||
fBaseAddress = fViewportAddress;
|
||||
}
|
||||
|
||||
// instantiate the panes, TODO default visibility from state or
|
||||
// plugin.xml?
|
||||
this.fAddressPane = new AddressPane(this);
|
||||
|
@ -185,18 +197,6 @@ public class Rendering extends Composite implements IDebugEventSetListener
|
|||
|
||||
this.fAddressBarControl.setVisible(false);
|
||||
|
||||
// initialize the viewport start
|
||||
if(fParent.getMemoryBlock() != null)
|
||||
{
|
||||
fViewportAddress = fParent.getMemoryBlockStartAddress();
|
||||
|
||||
// this will be null if memory may be retrieved at any address less than
|
||||
// this memory block's base. if so use the base address.
|
||||
if (fViewportAddress == null)
|
||||
fViewportAddress = fParent.getBigBaseAddress();
|
||||
fBaseAddress = fViewportAddress;
|
||||
}
|
||||
|
||||
getHorizontalBar().addSelectionListener(new SelectionListener()
|
||||
{
|
||||
public void widgetSelected(SelectionEvent se)
|
||||
|
|
|
@ -28,6 +28,7 @@ import org.eclipse.debug.internal.ui.DebugPluginImages;
|
|||
import org.eclipse.debug.internal.ui.DebugUIMessages;
|
||||
import org.eclipse.debug.internal.ui.DebugUIPlugin;
|
||||
import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
|
||||
import org.eclipse.debug.internal.ui.memory.IMemoryBlockConnection;
|
||||
import org.eclipse.debug.internal.ui.views.memory.renderings.GoToAddressAction;
|
||||
import org.eclipse.debug.ui.memory.AbstractMemoryRendering;
|
||||
import org.eclipse.debug.ui.memory.AbstractTableRendering;
|
||||
|
@ -99,6 +100,7 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe
|
|||
private Action displayEndianLittleAction;
|
||||
|
||||
private IWorkbenchAdapter fWorkbenchAdapter;
|
||||
private IMemoryBlockConnection fConnection;
|
||||
|
||||
public TraditionalRendering(String id)
|
||||
{
|
||||
|
@ -1001,7 +1003,6 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe
|
|||
|
||||
public Object getAdapter(Class adapter)
|
||||
{
|
||||
|
||||
if(adapter == IWorkbenchAdapter.class)
|
||||
{
|
||||
if(this.fWorkbenchAdapter == null)
|
||||
|
@ -1033,10 +1034,32 @@ public class TraditionalRendering extends AbstractMemoryRendering implements IRe
|
|||
return this.fWorkbenchAdapter;
|
||||
}
|
||||
|
||||
if (adapter == IMemoryBlockConnection.class)
|
||||
{
|
||||
if (fConnection == null)
|
||||
{
|
||||
fConnection = new IMemoryBlockConnection()
|
||||
{
|
||||
public void update()
|
||||
{
|
||||
// update UI asynchronously
|
||||
Display display = DebugUIPlugin.getDefault().getWorkbench().getDisplay();
|
||||
display.asyncExec(new Runnable() {
|
||||
public void run() {
|
||||
TraditionalRendering.this.fRendering.refresh();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
return fConnection;
|
||||
}
|
||||
|
||||
return super.getAdapter(adapter);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class TraditionalMemoryByte extends MemoryByte
|
||||
{
|
||||
private boolean isEdited = false;
|
||||
|
|
Loading…
Add table
Reference in a new issue