2

For my masterthesis I'm writing an Eclipse plugin for visualizing variables while debugging. I put a lot of effort in creating custom 'crawlers' for a comfortable access to the IJavaObject, IJavaType and IJavaValue and more. The problem is, that I haven't seen any possibility to get the real underlying object in memory but just the IJavaObject wrappers.

E.g. if I have a java.awt.Color I can get the IJavaObject and call methods with my crawler (so via the clumsy sendMessage of JDT). Therefore I am able to query for the single R, G and B values, built my own Color object and can directly show the color. But when it comes to an java.awt.Image I want to directly draw somewhere, for example, I can't do this. I have access to the IJavaObject and my crawler and can call some methods (btw only those that accept primitive types as parameters) and even query private fields, but I need the real Image object not just it's width, height or ImageObservers.

So in short: Is there ANY possibility to access the real underlying object of a IJavaObject?

Thanks in advance.

MrCube
  • 245
  • 2
  • 9
  • Have you made any progress with this? I would actually _love_ to use such a tool! I was considering writing something for myself but with OpenGL instead (since I'm both a game developer and a graphics enthusiast.) Basically just a better `toString` :) – Philip Guin Jan 11 '15 at 06:47
  • I successfully completed my thesis a year ago. The tool is of course not perfect but can be used (Eclipse 4.2, Java 7). I could send you the sources, relevant parts of my thesis or something specific, if you only need a special part. Can you pm on Stackoverflow if interested? – MrCube Jan 15 '15 at 16:18

1 Answers1

2

The real object is in a different JVM from the debug code which means there is no way to access it.

In the worst case the object may contain references to native objects (perhaps a graphics handle) these only make sense in the JVM the object is running in.

greg-449
  • 109,219
  • 232
  • 102
  • 145
  • So there is really no way or is it just much more complicated? This finally means that the only possibility to display the image is to somehow read all pixel value and create a completely new Image for that :( – MrCube Sep 26 '13 at 09:35
  • 1
    If the image contains the pixels. I don't know about the AWT `Image` but the SWT `Image` just contains a reference to a native graphics handle - which you can't do anything with at all. – greg-449 Sep 26 '13 at 09:54
  • Ok. Sounds sad but true. At least I managed to create the colors ;) – MrCube Sep 26 '13 at 10:05