Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4660281

jdb fails to find sources listed in another package per JSR-45

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 1.4.0
    • core-svc
    • x86
    • windows_2000



      Name: gm110360 Date: 03/29/2002


      FULL PRODUCT VERSION :
      java version "1.4.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
      Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)

      FULL OPERATING SYSTEM VERSION :
      Microsoft Windows 2000 [Version 5.00.2195]

      A DESCRIPTION OF THE PROBLEM :
      Source files in another package are not found by jdb
      for non-Java sources compiled in accordance with JSR-45.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Download AspectJ 1.0.3 (or later) tools and docs
         from http://aspectj.org/dl

      2. Compile the source code below using ajc:
        mkdir classes
        ajrt="${ASPECTJ_HOME}/lib/aspectjrt.jar"
        ajc -d classes -classpath "$ajrt" jdb/JDBTest.java
      aj/Aspectj.java

      3. Run under jdb:
        jdb -classpath "classes;$ajrt" -sourcepath . jdb.JDBTest

      4. add breakpoint in main, step to advice
         (actual session:
      > stop in jdb.JDBTest.main
      Deferring breakpoint jdb.JDBTest.main.
      It will be set after the class is loaded.
      > run
      run jdb.JDBTest
      >
      VM Started: Set deferred breakpoint jdb.JDBTest.main

      Breakpoint hit: "thread=main", jdb.JDBTest.main(), line=6
      bci=0
      6 new JDBTest().run();

      main[1] step
      >
      Step completed: "thread=main", jdb.JDBTest.<init>(), line=3
      bci=0
      3 public class JDBTest {

      main[1] step
      >
      Step completed: "thread=main", jdb.JDBTest.main(), line=6
      bci=7
      6 new JDBTest().run();

      main[1] step
      >
      Step completed: "thread=main", jdb.JDBTest.run(), line=8
      bci=0
      8 public void run() {

      main[1] step
      >
      Step completed: "thread=main", jdb.Aspect.before0$ajc(),
      line=5 bci=0

      main[1] list
      Source file not found: Aspect.java


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      expect to see listing of aj/Aspect.java since JSR-45 was
      implemented in ajc to produce compliant bytecode.

      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      // two files, jdb/JDBTest.java and aj/Aspect.aj
      // (aj/Aspect.aj is an AspectJ source file)
      // Use the AspectJ compiler, ajc, to compile both
      // per the steps to reproduce

      // ---------------------- aj/Aspect.aj
      package jdb;

      aspect Aspect {
          before(JDBTest jdbtest) : target(jdbtest) && execution(void run()) {
              handle(jdbtest);
          }
          void handle(JDBTest jdbtest) {
              jdbtest.i += 10;
          }
      }

      // ---------------------- jdb/JDBTest.java
      package jdb;

      public class JDBTest {
          int i;
          public static void main (String[] args) {
              new JDBTest().run();
          }
          public void run() {
              i += 1;
          }
      }


      ---------- END SOURCE ----------
      (Review ID: 144694)
      ======================================================================

            duke J. Duke
            gmanwanisunw Girish Manwani (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: