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

next does not work properly in jdb

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P2 P2
    • None
    • 1.3.0
    • vm-legacy
    • generic
    • generic

      jdb, if next is applied, skips next block if there is 'if', 'while' or any other blocks after current line of execution.

      To reproduce:

      public class test {

          static String fnCall(String str) {
              return str;
          }

          public static void main(String[] argv) {
              String atr = fnCall("test this");
              if (atr.indexOf("th") != 0) {
                  System.out.println ("\"th\" is inside the string");
              } else {
                  System.out.println ("\"th\" is not inside the string");
              }
              atr = fnCall("test this");
          }
      }


      Cammands:
      stop in test.main
      next

      Initializing jdb...
      > stop in test.main
      Deferring breakpoint test.main.
      It will be set after the class is loaded.
      > run
      run test
      >
      VM Started: Set deferred breakpoint test.main

      Breakpoint hit: thread="main", test.main(), line=10, bci=0
        10 String atr = fnCall("test this");

      main[1] next
      "th" is inside the string
      main[1]
      The application exited

      =============

      Moved Brad's additions to wetmore-notes attachement.

            dcubed Daniel Daugherty
            avolkovorcl Alexei Volkov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: