Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-debug-dev] MemoryBlock retrieval : PLZ Urgent

Hello,

>From the memory block manager point of view, it manages IMemoryBlock.
DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks(
getDebugTarget() ); will always return an array of IMemoryBlock.

However, what's contained inside the array could be classes other than
IMemoryBlock.  Therefore, you can do something like this to cast to the
types desired:
IMemoryBlock[] memoryBlocks =
DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks(
getDebugTarget() );
IMemoryBlockForPixel[] pixels = new
IMemoryBlockForPixl[memoryblocks.length];
System.arrayCopy(memoryBlocks, 0, pixels, 0, memoryblocks.length);

You can then work with the "pixels" array to look at memory.  Or you can
simply iterate the memoryBlocks array and cast them to the desired type:

IMemoryBlock[] memoryBlocks =
DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks(
getDebugTarget() );
for (int i=0; i<memoryBlocks.length; i++)
{
      IMemoryBlockPixel pixel = (IMemoryBlockPixel)memoryBlocks[i];
}

Either way allows you to cast the array by the memory blocks manager to the
desired type to work with.

Samantha




                                                                           
             Khaled ABDA                                                   
             <khaled.abda@st.c                                             
             om>                                                        To 
             Sent by:                  <platform-debug-dev@xxxxxxxxxxx>,   
             platform-debug-de         <cdt-debug-dev@xxxxxxxxxxx>         
             v-bounces@eclipse                                          cc 
             .org                                                          
                                                                   Subject 
                                       [platform-debug-dev] MemoryBlock    
             30/10/2007 08:49          retrieval : PLZ Urgent              
             AM                                                            
                                                                           
                                                                           
             Please respond to                                             
             "Eclipse Platform                                             
              Debug component                                              
             developers list."                                             
             <platform-debug-d                                             
              ev@xxxxxxxxxxx>                                              
                                                                           
                                                                           




Hello

I want to manage the memory data of my target
I want to reuse the standard Memory view of eclipe
The Problem is that :
1/ My target has a Pixel Mode
So that I don't manage(set or get) blocks of Bytes but
Blocks of Pixels (10 or 12 or 14 bits)
2/ The eclipse Debug plugin and CDT manages blocks of "bytes".

I have extended and re-implemented many class and interface
In order to getPixels and Set them instead of Bytes.
(classes such CMemoryBlockExtension, IMemoryBlock,
IMemoryBlockExtension...)
Every thing seems to go well
But the last problem in my CMemoryBlockExtension(ForPixel) urged me to
implement
My own CMemoryBlockRetrievalExtension
In this later
I faced  the Big problem which is that the debugPlugin activator gets
MemoryBlocks which are (IMemoryBlock[])

DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks()
And gives no way to get my own (IMemoryBlockForPixel[]) which manages
pixels and not bytes

I want to know if the debugPlugin returns only block of Bytes or it doesn't
care of that
So I could cast the block like this

public String getMemento() throws CoreException {
IMemoryBlockForPixel[] blocks =(IMemoryBlockForPixel[])
DebugPlugin.getDefault().getMemoryBlockManager().getMemoryBlocks(
getDebugTarget() );
..........
}

NB :[CMemoryBlockExtensionForPixel will be the class "instanceOf" of my
"renderingBingings"
Corresponding to my new "renderingType"]

I see that the question is long and compilcated to explain
But your answer will be of great help for me
Thanks in advance.
Khaled ABDA

_______________________________________________
platform-debug-dev mailing list
platform-debug-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-debug-dev




Back to the top