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

jdb incorrectly loops when executing "next"

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3
    • None
    • 1.4.1
    • core-svc
    • None
    • generic
    • solaris_2.6

    Description

      The following example causes jdb to incorrectly loop when executing "next"
      instruction (reproducible with 1.4 and 1.4.1 build 13).

      public class badscope {
          public static final void main(String args[])
          {
              // this line should be here
              try {
                  System.out.println("hi!");
              } catch (Exception e) {
                  e.printStackTrace();
              } finally {
                  System.out.println("done");
              }
          }
      }

      Steps to reproduce:
      ===================
      1) javac -g badscope.java
      2) jdb badscope
      3) inside jdb: > stop at badscope:7
      4) inside jdb: run

      jdb stops at badscope:7

      5) inside jdb: > next

      jdb stops at badscope:10

      5) inside jdb: > next

      jdb stops at badscope:7 again - THIS IS A BUG, SHOULD NOT GO BACK TO 7

      Please see output below:
      ========================

      Initializing jdb ...
      > stop at badscope:7
      Deferring breakpoint badscope:7.
      It will be set after the class is loaded.
      > run
      run badscope
      Set uncaught java.lang.Throwable
      Set deferred uncaught java.lang.Throwable
      >
      VM Started: Set deferred breakpoint badscope:7
      hi!

      Breakpoint hit: "thread=main", badscope.main(), line=7 bci=8
      7 } catch (Exception e) {

      main[1] next
      >
      Step completed: "thread=main", badscope.main(), line=10 bci=31
      10 System.out.println("done");

      main[1] next
      > done

      Step completed: "thread=main", badscope.main(), line=7 bci=11
      7 } catch (Exception e) {

      Attachments

        Issue Links

          Activity

            People

              tbell Tim Bell
              ksoshals Kirill Soshalskiy (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: