[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[platform-debug-dev] IDebugContextProvider API and external usage of the Memory View?
|
Hi,
A collegue of mine, Elin Karasalo, recently asked why a code snippet
using the Memory View doesn't work with Eclipse 3.2 but with Eclipse
3.1.2. Samantha Chan suggested that we should review the getAdapter()
methods in our memory block and memory block retrieval implementations.
I looked at the CDT implementations of these classes to get an
understanding of what adapters you are expected to support and I think
we cover these now. By the way, why is there no info in the Javadoc for
org.eclipse.debug about what adapters you are supposed to handle when,
for example, using the Memory View?
Samantha, you also said that the memory block and memory block retrieval
implementations should extend PlatformObject. Isn't it enough to just
implement IAdaptable and delegate to
Platform.getAdapterManager().getAdapter(), which would be equivalent to
delegating to PlatformObject? Or does the Memory View explicitly check
for instaceof PlatformObject?
Since making our getAdapter() methods handle the expected adapters
didn't solve our problem (the Memory View is still empty), I debugged
what really happened and realised that the Memory View in Eclipse 3.2
requires an active selection from the Debug View to work at all. This
wasn't the case in Eclipse 3.1. However, I was glad that see that the
Memory View isn't coupled directly to the Debug View per se, but
actually to the current IDebugContextProvider. So I implemented my own
IDebugContextProvider and hooked it in by calling:
DebugContextManager.getDefault().addDebugContextProvider(myDebugContextProvider)
Voila, now I see my memory blocks appearing in the Memory View! However,
the image and text labels are not displayed for the memory blocks,
instead a small empty selection rectangle is displayed, and the
rendering is without content... I will try to find out what is missing
by debugging the Memory View.
My main question is regarding IDebugContextProvider. I think that it is
extremely useful to be able to add your own debug context provider in
order to use the Memory View and other context-sensitive debug related
views without having a running source code debug session. However,
IDebugContextProvider and its mate IDebugContextListener are located in
the org.eclipse.debug.internal.ui.contexts.provisional package and the
DebugContextManager in the org.eclipse.debug.internal.ui.contexts
package. Is it the intention to make these three classes/interfaces
public in Eclipse 3.3 so that the IDebugContextProvider concept can be
fully used? Can we safely start using it with Eclipse 3.2?
Kind regards,
Stefan