1 / 9

New debug/profile features in J2SE 6

New debug/profile features in J2SE 6. Ivan Popov, May, 2006 Intel Corporation. New features in J2SE 6 (JSR-270, core/debug). Access to heap contents (JDI, JDWP) rewritten JVMTI functions and callbacks for heap iteration new JDI and JDWP functions for finding objects in heap

lance
Download Presentation

New debug/profile features in J2SE 6

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. New debug/profile features in J2SE 6 Ivan Popov, May, 2006 Intel Corporation

  2. New features in J2SE 6 (JSR-270, core/debug) • Access to heap contents (JDI, JDWP) • rewritten JVMTI functions and callbacks for heap iteration • new JDI and JDWP functions for finding objects in heap • Attach-on-demand (JVMTI, java.lang.instrument) • new entry points for dynamically loaded JVMTI and Java agents • no spec for dynamic loading mechanism (implementation dependent) • Multiple simultaneous agents (JVMTI, java.lang.instrument) • defined algorithm of sequential classfile transformation • introduced transformation capable/incapable agents • new function RetransformClasses() in addition to RedefineClasses() • support for instrumenting native calls by providing Java wrappers • Several other changes in JVMTI, JDI, JDWP • Getting monitor info for stack frames, access to constant pool, etc. • JVMDI and JVMPI are removed

  3. Access to heap content • JVMTI • new set of heap iteration functions and callbacks • similar functionality but new design • old functions are still in JVMTI spec (marked version 1.0) • JDI/JDWP • Get all objects of a given class • Get all objects which refer to a given object

  4. Attach-on-demand • JVMTI: • new entry point for dynamically loaded JVMTI agents • Agent_OnAttach() vs. Agent_OnLoad() • java.lang.instrument: • new entry point for dynamically loaded Java agents • agentmain() vs. premain() • Problems: • no spec for algorithm of dynamic agent loading – it is implementation specific • no particular support for detach-on-demand

  5. Multiple simultaneous agents (bytecode instrumentation) • JVMTI: • described support for multiple classfile transformations • introduced classfile retransformation algorithm for new transformation capable agents • supports classfile redefinition algorithm for old transformation incapable agents • clarified semantics of RedefineClasses(), RetransformClasses(), CLASS_FILE_LOAD_HOOK for agents of both kinds • the whole algorithm is quite sophisticated • java.lang.instrument: • similar features for Java agents

  6. New features in J2SE 6 (JSR-270, core/debug) • Access to heap contents (JDI, JDWP) • rewritten JVMTI functions and callbacks for heap iteration • new JDI and JDWP functions for finding objects in heap • Attach-on-demand (JVMTI, java.lang.instrument) • new entry points for dynamically loaded JVMTI and Java agents • no spec for dynamic loading mechanism (implementation dependent) • Multiple simultaneous agents (JVMTI, java.lang.instrument) • defined algorithm of sequential classfile transformation • introduced transformation capable/incapable agents • new function RetransformClasses() in addition to RedefineClasses() • support for instrumenting native calls by providing Java wrappers • Several other changes in JVMTI, JDI, JDWP • Getting monitor info for stack frames, access to constant pool, etc. • JVMDI and JVMPI are removed

  7. Instrumenting native calls • JVMTI: • replacing native methods with Java wrappers • adding prefixes for renaming original native methods • managing prefixes for single and multiple agents • clarified algorithm for binding native methods using prefixes • the overall algorithm is quite sophisticated

  8. Other spec changes • JVMTI, JDWP, JDI: • Get locked monitors for frames • new functions return association between frames and locked monitors • support for monitor events on JDI/JDWP level • Access to constant pool • get classfile major/minor version • get constant pool bytes • Checking unmodifiable classes • new function checks if class bytecode can be modified • Force early method return • new function to force method to return with given value • new METHOD_EXIT_WITH_RETURN_VALUE event in JDI/JDWP

  9. Other spec changes (cont.) • JVMTI: • modification of class path for both bootstrap and system loaders: • AddToSystemClassLoaderSearch vs. AddToBootstrapClassLoaderSearch • JDI/JDWP: • source file filter for CLASS_PREPARE events • new JDI connector ProcessAttach uses PID for attaching to process • eliminates knowing port number for attaching connection • transport is determined dynamically and reported as “local” • no details of the algorithm

More Related