Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-debug-dev] How to add new renderings to the Memory view?

Thank you. I'll try it.

Mikhail
----- Original Message ----- From: "Samantha Chan" <chanskw@xxxxxxxxxx>
To: <platform-debug-dev@xxxxxxxxxxx>
Sent: Friday, October 01, 2004 4:22 PM
Subject: Re: [platform-debug-dev] How to add new renderings to the Memory view?






Hi -

The Memory View only shows memory blocks in raw hex format. To show memory
renderings, you will have to create a rendering view.
A rendering view is a view that shows memory monitor in any format that you
want.  For example, you may want to render the raw memory from the Memory
view as ASCII strings in the rendering view. You will have the flexibility to define what renderings a user can create. You can also decide how these
renderings will be presented to the user.

The memory framework does not provide any rendering definition.  To define
a new rendering, you have to extend from the
"org.eclipse.debug.core.memoryRenderings" extension point.  Each of the
rendering definition has the following attributes:
1.  rendering name
2.  rendering id
3.  optionally the rendering factory

You can define additional rendering properties associated to a type of
rendering.  Each of the properties consists of:
1.  rendering id  (for mapping the property to the rendering previously
defined)
2.  property name
3.  property value

As a rendering view developer, you have the responsibility to define how
renderings are to be defined and what properties are needed for you to
display the renderings.

Finally, you need to define rendering mapping of your memory block and the
rendering that you are defining.  A memory map declares the types of
renderings that are valid for a type of memory block.  A rendering mapping
definition consists of:
1.  classname of the memory block that your rendering supports
2.  a list of rendering ids indicating which renderings are valid for the
specified type of memory block.

Optionally, you can define a list of default renderings to be created
whenever a specified type of memory block is registered to the memory block
manager.

Your Rendering view needs to have the following basic capabilities:
1.  Allow your user to add a rendering
2.  Allow your user to remove a rendering
3.  Be able to detect addition and removal of renderings from the
workbench.
4.  Display the renderings created

To add and display a memory rendering from your Rendering view:
==========================================================
First, you need to get a hold of the memory block that you are trying to
let your user to create the rendering for.  You can do that by obtaining
the current selection from the Memory View or by allowing your user to
create a new memory block. With the memory block you will be able to query
of a list of valid memory renderings via the following API from
IMemoryRenderingManager:

     public IMemoryRenderingInfo[] getAllRenderingInfo(Object obj);

IMemoryRenderingInfo captures the attributes and properties of a rendering
type. You would be able to obtain the values of the rendering's attributes
and their properties via this interface.

Once you get the list of valid rendering types, you can prompt the user
about what to create. Then you will have to add the selected renderings to
the IMemoryRenderingManager via the following API:

     public IMemoryRendering addMemoryBlockRendering(IMemoryBlock mem,
String renderingId) throws DebugException;

The rendering manager checks to see if the rendering is defined with a
rendering factory and will call the factory to create a rendering.  If a
factory is not defined, a default factory will be used to create a default
IMemoryRendering object.  Then the manager fires an event to notify
listeners that a memory rendering has been added.

Your Rendering view needs implement IMemoryRenderingListener and registers
as a listener to the IMemoryRenderingManager.  When a new rendering is
created, the following function will be called via the
IMemoryRenderingListener interface:

     void MemoryBlockRenderingAdded(IMemoryRendering rendering);

Your Rendering view is responsible for handling the event and display the
new rendering accordingly.

To remove a memory rendering from your Rendering view:
==================================================
Like creating a new rendering, removing a rendering is also a two-step
process.  First you have to get hold of the IMemoryRendering object that
you wish to remove.  Then you will call IMemoryRenderingManger to remove
the memory rendering via the following API:

     public void removeMemoryBlockRendering(IMemoryRendering rendering);

The memory rendering manager will remove the rendering and will fire an
event to all its listeners. Since your Rendering view is a listener to the
rendering manager, the following function will be called via the
IMemoryRenderingListener interface upon removal of a memory rendering:

     void MemoryBlockRenderingRemoved(IMemoryRendering rendering);

Your Rendering view is responsible for handling this removal event and
removing the rendering from your view accordingly.

Default Renderings
=================
The memory rendering manager is also a listener to the memory block
manager. Whenever a new memory block is added to the memory block manager,
the rendering manager will receive an event.  Upon this event, the
rendering manager checks to see if default renderings are defined for that
particular type of memory block.  If default renderings are defined, then
the rendering manger will create the renderings automatically and fire the
MemoryBlockRenderingAdded event.  Again, since your view is already a
listener to the rendering manager, it will receive an event.  Your
Rendering view will then display that default rendering.

Removal of a Memory Block
=========================
Whenever a memory block is removed from the memory block manager, the
rendering manager is also going to get a memory block removed event.  Upon
this event, the rendering manager will find all the renderings that are
currently created for the removed memory block.   The rendering manager
will remove these renderings and fire renderings removed events.

The Memory Block framework provides APIs and interfaces for you to manage
memory renderings.  But it's up to the debug implementers to provide their
own view to display the renderings and decide how these renderings will be
presented.

This is a very brief overview of the memory rendering extension point.  I
hope this would help you to with your memory view and rendering view work.
Let me know if you have any question and suggestion as we migrate these
interfaces and functions to formal APIs.

Thanks.

Regards,
----------------------------------------------------------------
Samantha Chan
IBM Toronto Lab





            "Mikhail
            Khodjaiants"
            <mikhailk@xxxxxxx                                          To
            >                         <platform-debug-dev@xxxxxxxxxxx>
            Sent by:                                                   cc
            platform-debug-de
            v-admin@eclipse.o                                     Subject
            rg                        Re: [platform-debug-dev] How to add
                                      new renderings to the Memory view?

            10/01/2004 11:51
            AM


            Please respond to
            platform-debug-de
                    v






Thanks, Darin.
We are moving to the platform memory view API. So far it seems to work
fine,
though I have some minor comments. But we need to cover the features
provided by the CDT memory view and I hope the rendering mechanism will be
helpful.

Mikhail
----- Original Message -----
From: "Darin Wright" <Darin_Wright@xxxxxxxxxx>
To: <platform-debug-dev@xxxxxxxxxxx>
Sent: Friday, October 01, 2004 11:13 AM
Subject: Re: [platform-debug-dev] How to add new renderings to the Memory
view?


The memory view was contributed by Samantha Chan, so perhaps she can help
you out. Currently, I am aware of no doc (besides javadoc and extension
point doc). We will be working to make the memory view API in the 3.1 M3
milestone build.

Darin




"Mikhail Khodjaiants" <mikhailk@xxxxxxx>
Sent by: platform-debug-dev-admin@xxxxxxxxxxx
10/01/2004 10:04 AM
Please respond to
platform-debug-dev


To
<platform-debug-dev@xxxxxxxxxxx>
cc

Subject
[platform-debug-dev] How to add new renderings to the Memory view?






Hi,

Is there a document on how to add new renderings to the Memory view?

Thanks,
Mikhail Khodjaiants
QNX software Systems Ltd.

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


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


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




Back to the top