You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

debugging.html 2.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <html>
  2. <title>Debugging AspectJ Programs
  3. </title>
  4. <body>
  5. <h2>Debugging AspectJ Programs
  6. </h2>
  7. <h3>Debugging AspectJ 1.0 Programs
  8. </h3>
  9. <!-- @author Wes Isberg -->
  10. <!-- START-SAMPLE trails-debugging-aspectj10 Debugging AspectJ 1.0 Programs -->
  11. The AspectJ 1.0 compiler produces .class files that have the
  12. normal source file attribute and line information as well
  13. as the information specified by JSR-045 required to debug
  14. .class files composed of multiple source files.
  15. This permits the compiler to inline advice code
  16. into the .class files of the target classes;
  17. the advice code in the target class can have source
  18. attributes that point back to the aspect file.
  19. <p>
  20. Support for JSR-45 varies.
  21. At the time of this writing, Sun's VM supports it,
  22. but not some others, which means that the Sun VM
  23. must be used as the runtime VM.
  24. Because the VM does all the work of associating the
  25. source line with the code being debugged,
  26. debuggers should be able to operate normally with
  27. AspectJ 1.0 source files even if they weren't written
  28. with that in mind, if they use the correct
  29. API's to the debugger. Unfortunately, some debuggers
  30. take shortcuts based on the default case of one file
  31. per class in order to avoid having the VM calculate
  32. the file suffix or package prefix. These debuggers
  33. do not support JSR-45 and thus AspectJ.
  34. <!-- END-SAMPLE trails-debugging-aspectj10 -->
  35. <h3>Debugging AspectJ 1.1 Programs
  36. </h3>
  37. <!-- @author Wes Isberg -->
  38. <!-- START-SAMPLE trails-debugging-aspectj11 Debugging AspectJ 1.1 Programs -->
  39. The AspectJ 1.1 compiler usually implements advice as
  40. call-backs to the aspect, which means that most
  41. AspectJ programs do not require JSR-45 support in
  42. order to be debugged. However, it does do a limited
  43. amount of advice inlining; to avoid this, use the
  44. <code>-XnoInline</code> flag.
  45. <p>
  46. Because inlined advice can be more efficient, we
  47. plan to support JSR-45 as soon as feasible.
  48. This will require upgrading the BCEL library we
  49. use to pass around the correct source attributes.
  50. <p>
  51. Sometimes debuggers correctly get the source line information,
  52. but fail when they attempt to parse AspectJ source files
  53. expected to contain Java code. For these it might be possible
  54. to step into AspectJ code, but not to set breakpoints, or to
  55. work around the parse errors by using <code>.aj</code> rather
  56. than <code>.java</code> as a file extension.
  57. <!-- END-SAMPLE trails-debugging-aspectj11 -->
  58. </body>
  59. </html>