Home » Eclipse Projects » Memory Analyzer » OQL: how to define JS functions
| | | |
Re: OQL: how to define JS functions [message #651537 is a reply to message #651484] |
Mon, 31 January 2011 15:26 |
Krum Tsvetkov Messages: 165 Registered: July 2009 |
Senior Member |
|
|
Quote: | I could not find the javadocs of MAT, are they published somewhere?
|
You can currently find the javadoc only in the help of the tool, i.e. if you have MAT installed, the open the Help and then "Memory Analyzer" -> "Reference" -> "API Reference".
There you'll find also some description of the extension points.
Quote: | Is there a way to specify more than one classname that is handled by my extension? I'd like to pack several in one go.
|
Yes, you can pack more than one IQuery implementations (and also other extensions) in one plugin. MAT itself does this.
I know that we need to improve on documenting how excensions are written and also provide some examples. For the moment you could probably look into MAT sources as a reference.
Quote: | It would be very nice to present a programatic interface in addition to the extension points. Do you think that's feasible?
|
This would be the middle way - less effort than the extensions implementation, but still more flexibility than plain OQL. However, at the moment such an improvement is not planned. I think it will be better to spend more time documenting how one can use the extension points and provide good samples for this, rather than starting a new alternative, befor having the first really finished. But this is only my personal opinion, I'd be happy to hear more oppinions on this.
Krum
|
|
|
Re: OQL: how to define JS functions [message #651555 is a reply to message #651537] |
Mon, 31 January 2011 16:11 |
Iulian Dragos Messages: 23 Registered: July 2009 |
Junior Member |
|
|
Krum Tsvetkov wrote on Mon, 31 January 2011 10:26 | Quote: | I could not find the javadocs of MAT, are they published somewhere?
|
You can currently find the javadoc only in the help of the tool, i.e. if you have MAT installed, the open the Help and then "Memory Analyzer" -> "Reference" -> "API Reference".
Quote: | It would be very nice to present a programatic interface in addition to the extension points. Do you think that's feasible?
|
This would be the middle way - less effort than the extensions implementation, but still more flexibility than plain OQL. However, at the moment such an improvement is not planned. I think it will be better to spend more time documenting how one can use the extension points and provide good samples for this, rather than starting a new alternative, befor having the first really finished. But this is only my personal opinion, I'd be happy to hear more oppinions on this.
Krum
|
Having a programatic interface is nice because one does not need to install new plugins, and can have a much shorter cycle when testing different queries. Deployment is not always easy.
I have my extensions working fine in the debug build (so launching a second instance of Eclipse picks up my changes), but I cannot deploy it in my default Eclipse installation. I followed the guide and exported my plugin to a directory, and placed the resulting jar in the dropins/ directory of my Eclipse installation. My plugin appears in Installation Details, but it doesn't get called. Any idea what is going wrong?
thanks
|
|
| | |
Re: OQL: how to define JS functions [message #651692 is a reply to message #651678] |
Tue, 01 February 2011 10:17 |
Iulian Dragos Messages: 23 Registered: July 2009 |
Junior Member |
|
|
Krum Tsvetkov wrote on Tue, 01 February 2011 03:44 | I agree. I think we should open a bugzilla ticket for this request. I can't tell currently if and when we'll be able to work on it. I'll be happy if we get some contributions in this area
Will you open the bug, or shall I do it?
|
I did: https://bugs.eclipse.org/bugs/show_bug.cgi?id=335943
I would love to help. I don't have much time right now, and I'm not very experienced with Eclipse, but I do have some experience with programming languages. You can see what I managed to do yesterday regarding name resolvers here:
https://github.com/dragos/MAT-name-resolver
Given the right extension points, I could start by contributing some simple plugins.
BTW: the documentation says the following about 'dominators(s)': The objects immediately dominated by s. That's a bit confusing, shouldn't it be 'dominated'? or 'dominatedSet'? To me, dominators sounds more like the nodes that dominate s, directly or indirectly. BTW, I think it would be helpful to have a function 'dominatorChain', which returns the chain of dominators of an object, up to a GC root. Or alternatively, a predicate 'dominates(a, b)' which is true when a dominates b (directly on indirectly). Both functions could be written with the available primitives, so this could be another argument in favor of a scripting engine!
thanks,
iulian
|
|
| |
Re: OQL: how to define JS functions [message #1064334 is a reply to message #656030] |
Tue, 18 June 2013 19:02 |
Robin Salkeld Messages: 8 Registered: June 2013 |
Junior Member |
|
|
Greetings all,
I know this is an old thread, but I thought I'd post because I've built something that I think addresses this need. I'm a PhD candidate at the University of British Columbia, and as part of my dissertation project I've built a kind of JVM emulator library which is able to simulate executing code without an actual live JVM. In particular, this makes it possible to run code on a heap dump as if it's a live process.
I've always thought that being able to run your own Java code against a heap dump would be a far easier and more effective approach to the kind of programmatic analysis. Take the example at the top of this thread, which involves trying to reconstruct the file path the Eclipse Path object is for. All you'd need to do is call the Path#toString() method, which is actually (looking at the latest version) a lot more complicated than the javascript function!
Anyway, my selfish motive is that I'm trying to come up with some cool examples of using this capability to do useful debugging or analysis of heap dumps. If any of you could describe what you were hoping to do with the scripting support I would greatly appreciate it. I've packaged up my system as a few Eclipse plugins and can make them available to anyone who wants to play with them.
Iulian, you might be particularly interested in this (or would have been two years ago ) regarding your Scala name resolver. In a similar vein, I was able to use my tool to print out a Ruby thread dump from a JRuby heap dump!
Thanks,
Robin
[Updated on: Tue, 18 June 2013 19:05] Report message to a moderator
|
|
| |
Re: OQL: how to define JS functions [message #1065155 is a reply to message #1064334] |
Mon, 24 June 2013 14:06 |
Iulian Dragos Messages: 23 Registered: July 2009 |
Junior Member |
|
|
Robin Salkeld wrote on Tue, 18 June 2013 15:02Greetings all,
I know this is an old thread, but I thought I'd post because I've built something that I think addresses this need. I'm a PhD candidate at the University of British Columbia, and as part of my dissertation project I've built a kind of JVM emulator library which is able to simulate executing code without an actual live JVM. In particular, this makes it possible to run code on a heap dump as if it's a live process.
Sounds cool, any pointers/papers?
Quote:I've always thought that being able to run your own Java code against a heap dump would be a far easier and more effective approach to the kind of programmatic analysis. Take the example at the top of this thread, which involves trying to reconstruct the file path the Eclipse Path object is for. All you'd need to do is call the Path#toString() method, which is actually (looking at the latest version) a lot more complicated than the javascript function!
In general, I want to be able to define my own functions. In this particular case `toString` would suffice, but I need the added flexibility (`toString` might not be defined on other types, or might do the wrong thing)
Quote:Anyway, my selfish motive is that I'm trying to come up with some cool examples of using this capability to do useful debugging or analysis of heap dumps. If any of you could describe what you were hoping to do with the scripting support I would greatly appreciate it. I've packaged up my system as a few Eclipse plugins and can make them available to anyone who wants to play with them.
Please do, I'd love to give it a try!
iulian
|
|
| | |
Goto Forum:
Current Time: Wed Feb 05 04:05:51 GMT 2025
Powered by FUDForum. Page generated in 0.04341 seconds
|