What started out as a personal need for writing and debugging JNI-based applications, both based on Eclipse and for Android, has turned into something bigger, a lot bigger. The hardest problem we face for what I'm doing is supporting multiple debugger technologies in the same debug session and ensuring a nice seamless experience. Showing both Java and C/C++ stacks merged together and stepping back and forth between them would be the cat's meow.
As I'm starting to hear from the greater Eclipse community, there is need for cross language/cross technology debugging in other areas as well. One example is Rhino which is being used by the e4 team to support writing plugins in JavaScript. Having a debug session with JavaScript and Java in the same stack would also be awesome. Similarly, we have JavaScript or ActionScript running in the browser interacting with a Equinox server, or maybe PHP running in Apache. Web applications are the manifestation of distributed applications and, as promised, those applications tend to involve multiple languages.
Traditionally, the language tooling projects at Eclipse have lived in silos. The CDT team has have very little interaction with the JDT team, for example. And that's not generally the fault of the team members. It's just a symptom of the lack of investment in Eclipse towards common technologies. Being an engineer, I have no idea how to solve that except to ineffectively whine about it. ;)
But one objective we've had with the CDT was to ensure that the C wasn't just for C/C++. Many of our frameworks are language independent as much as we practically could. We haven't had enough investment to be able to push that out to the general Eclipse community, but we do have projects like Photran (Fortran) and the fledgling Hibachi (Ada) and the new but remote ObjectivEclipse (Objective-C) doing that.
I think in particular, our new debug framework, DSF, could be used for much more than C and related languages. DSF started out as a solution for the difficult debug environments we face in the embedded space and actually started as the Device Debug project of DSDP. We've migrated it down into the CDT in 6.0. We've often quipped that it really should be down in the Eclipse platform itself. There will be challenges, technically and otherwise, to make that happen.
What I want to do is start prototyping multi-language, multi-debugger debug sessions based on DSF. That would initially include Java and C/C++. I'll also take a peak at JavaScript debugging and consider how that impacts it. I'm confident the flexibility we brought with DSF can be leveraged to make the Eclipse side of this relatively straightforward. The bigger challenge will be co-ordinating the different debuggers.
If others are interested in this work, we should co-ordinate our efforts. Let me know and we could set up a mailing list to talk about this area, and hopefully we can start breaking down the silos.
Rhino can generate Java class files with debug information (i.e., mapping to line numbers) enabled. It'd be worth trying whether you can get a unified debugging environment by debugging in Java and effectively treating the JS code like Java.
ReplyDeleteInteresting. That may be as simple as setting up the source locator correctly. But I'm not sure how that works in Java, yet...
ReplyDeleteMy company is developing debugger for both C/C++ and Lua/JavaScript language.
ReplyDeleteWe modify gdbserver.exe, sending back more information about debuggee for us to control the whole debugger chain. And we create our own debug session based on CDT, adding new debug target for script debugging. Currently, we are able to set breakpoints for both C++ and Lua language now. But we still can not step into C++ stack directly from Lua stack. More works need to be done.
We are interested in multi-language multi-session debugger framework.
nice comment
ReplyDeleteIf you want ide flash disk contact us http://www.magicram.com
I'm not sure you can fit that in but when possible, make sure that "multi-source per output position" debugging is possible (as opposed to the traditional "one source line == one output line").
ReplyDeleteBackground: When you have a complex code generator and you want to debug the generation process (not the output but what lead to it), you need to be able to have many "source locations" per output "byte". Example: A line of output can come from a template that is being transformed by the generator and part of the template is influenced by a config file.
To be able to debug this, the generator must attach location information to each "piece" of output (which can be anything from a single byte to a lot of text). In the example, this would be the name(s) and line(s) of the relevant variables in the config file, the template filename and the relevant location inside of it plus the location of the transformer in the code generator.
This is also true for JVM alternative languages. Eclipse Plug-ins dedicated to Scala, Clojure or other JVM language support have to resort to dirty hacks to provide the functionality required (for instance, to resolve Java classes, and to provide the specified alternative JVM language objects into JDT to allow calls back and forth). The solution the Scala IDE developers had to choose was the usage of Equinox Aspects to use aspects on JDT's AST (which is, afaik, not meant to be tempered with outside of JDT).
ReplyDeleteAs a part of commonizing IDEs infrastructure, it would be a great occasion to re-think the separation between the underlying architecture/platform and the language, for instance JDT should rest on JVM Eclipse support, CDT on executables (a.out, ELF, ...) support, etc. I don't know how much sense it makes for CDT to do so, because C is often the common denominator, since language creators often provide C bindings, but for Java/the JVM it is really required if Eclipse and Java are to compete with Visual and .NET in the many-language-in-one-platform area.
I really like this blog, It's always nice when you can not only be informed, but also get knowledge, from these type of blog, nice entry. Thanks
ReplyDeleteTerm Paper
If possible, as you gain expertise, would you mind updating your blog with more information? It is extremely helpful for me.
ReplyDeleteAdvantage Term Papers – We do it your way