10.07.2015 Views

Enhancing Source-Level Programming Tools with An Awareness of ...

Enhancing Source-Level Programming Tools with An Awareness of ...

Enhancing Source-Level Programming Tools with An Awareness of ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

grammer observes that persistence-enabling proxies generatedby Hibernate extend the persistent classes. As yet anotherexample, certain performance bottlenecks in the enhancedcode can be identified by examining the enhancements.For example, the use <strong>of</strong> RMI in remoting enhancementscan be detrimental to performance in some networkingenvironments. As a final example, some bugs in metadata,which describes which program constructs are to beenhanced, can be more easily identified if the enhancementcode is visible.Figure 15. Documentation for the Proxy class Enhancement.Figure 16. Documentation for the Split class Enhancement.In this case study, we have integrated the SER interpreter<strong>with</strong> an Eclipse Java code editor. Whenever the programmerselects a class whose bytecode is subject to enhancement, anew view pops up displaying an abbreviated description <strong>of</strong>the enhancements. We call this view window a zoom-in-onenhancementsview. Following the Eclipse tooling strategy,the view is visible only if activated, so if they so choose, theprogrammers are free to remain oblivious about the natureand specifics <strong>of</strong> enhancements. In the case if the originalclass is modified at the bytecode level, the enhancements areshown as special comments in the main editor. Since not allthe information about the enhancements in known at sourceedit time, the enhancements cannot be expressed in sourcecode form. If a single class is associated <strong>with</strong> several classescreated during an enhancement, each <strong>of</strong> the created classesis displayed in a separate view.Figures 13, 14, 15, and 16 show the screen-shots <strong>of</strong> thezoom-in-on-enhancements views, which document the enhancementsused in the example applications described inSection 4.1. The views have been integrated <strong>with</strong> Eclipse.Figure 17 presents a collaboration diagram that showsthe backend processing triggered by the source editor tolaunch a zoom-in-on-enhancements view. When the SER interpreter’smain module receives a Java source file as input,the corresponding SER script is identified (using a configurationfile), loaded, and parsed. The interpreter employs severalabstract syntax tree walkers (using Visitors) to traversethe Java program, collecting the information about how thegeneral enhancement instructions in the SER script will affectthe specific program constructs (e.g., fields, methods,constructors, etc.). The collected enhancement informationis stored in a symbol table for fast searching and retrieval. Finally,the interpreter compiles a complete documentation <strong>of</strong>the enhancements, which it uses to parameterize the zoomin-on-enhancementviewer.4.3 A Symbolic Debugger for Enhanced IntermediateCodeBecause intermediate code enhancements are not representedat the source code level, source-level debugging <strong>of</strong>such enhanced bytecode is nontrivial. Application code isenhanced to be able to interact <strong>with</strong> a framework, and theenhancements cannot be simply turned <strong>of</strong>f to facilitate debugging.Thus, tracing, analyzing, and fixing flawed programswhose bytecode has been enhanced <strong>with</strong> a standarddebugger is misleading—the debugger will show all the enhancedprogram’s code faithfully, both the original logic andthe transparently introduced enhancements. From the debuggingperspective, enhancements obfuscate the originalsource code’s logic.The debugging <strong>of</strong> transparently enhanced programs canbe facilitated by making a symbolic debugger aware <strong>of</strong> theenhancements. The debugger could execute an enhancedprogram, but report the source code information pertainingto the original source code. As our pro<strong>of</strong> <strong>of</strong> concept, we havecreated a new debugging architecture that leverages the facilities<strong>of</strong>fered by the Java Platform Debugger ArchitectureAccepted to OOPSLA 2009 11 2009/5/14

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!