In jdk7 b142 the following sequence of commands:
"stop in <somewhere>
run
<jdb stops when breakpoint hit>
step
where
up 3
where
reenter"
reports:
Exception occurred: java.lang.NullPointerException (uncaught)"thread=MyThread", <...>.MyThread.func1(), line=67 bci=13
And the line 67 is:
67 return func2(intParam);
After failed reenter, "where" command reports:
MyThread[1] where
[1] nsk.jdb.reenter.reenter001.MyThread.func1 (reenter001a.java:67)
[2] nsk.jdb.reenter.reenter001.MyThread.run (reenter001a.java:59)
> stop in nsk.jdb.reenter.reenter001.reenter001a.main
Deferring breakpoint nsk.jdb.reenter.reenter001.reenter001a.main.
It will be set after the class is loaded.
> run
run nsk.jdb.reenter.reenter001.reenter001a
Set uncaught java.lang.Throwable
Set deferred uncaught java.lang.Throwable
>
VM Started: Set deferred breakpoint nsk.jdb.reenter.reenter001.reenter001a.main
Breakpoint hit: "thread=main", nsk.jdb.reenter.reenter001.reenter001a.main(), line=24 bci=0
main[1] stop in nsk.jdb.reenter.reenter001.reenter001a.lastBreak
Set breakpoint nsk.jdb.reenter.reenter001.reenter001a.lastBreak
main[1] cont
>
Breakpoint hit: "thread=MyThread", nsk.jdb.reenter.reenter001.reenter001a.lastBreak(), line=27 bci=0
MyThread[1] threads
Group system:
(java.lang.ref.Reference$ReferenceHandler)0x140 Reference Handler cond. waiting
(java.lang.ref.Finalizer$FinalizerThread)0x13f Finalizer cond. waiting
(java.lang.Thread)0x13e Signal Dispatcher running
(java.lang.Thread)0x13d Attach Listener running
Group main:
(java.lang.Thread)0x1 main cond. waiting
(nsk.jdb.reenter.reenter001.MyThread)0x198 MyThread running (at breakpoint)
MyThread[1] thread 0x198
MyThread[1] step
>
Step completed: "thread=MyThread", nsk.jdb.reenter.reenter001.MyThread.func5(), line=96 bci=14
MyThread[1] where
[1] nsk.jdb.reenter.reenter001.MyThread.func5 (reenter001a.java:96)
[2] nsk.jdb.reenter.reenter001.MyThread.func4 (reenter001a.java:88)
[3] nsk.jdb.reenter.reenter001.MyThread.func3 (reenter001a.java:81)
[4] nsk.jdb.reenter.reenter001.MyThread.func2 (reenter001a.java:74)
[5] nsk.jdb.reenter.reenter001.MyThread.func1 (reenter001a.java:67)
[6] nsk.jdb.reenter.reenter001.MyThread.run (reenter001a.java:59)
MyThread[1] up 3
MyThread[4] where
[4] nsk.jdb.reenter.reenter001.MyThread.func2 (reenter001a.java:74)
[5] nsk.jdb.reenter.reenter001.MyThread.func1 (reenter001a.java:67)
[6] nsk.jdb.reenter.reenter001.MyThread.run (reenter001a.java:59)
MyThread[4] reenter
>
Exception occurred: java.lang.NullPointerException (uncaught)"thread=MyThread", nsk.jdb.reenter.reenter001.MyThread.func1(), line=67 bci=13
MyThread[1] where
[1] nsk.jdb.reenter.reenter001.MyThread.func1 (reenter001a.java:67)
[2] nsk.jdb.reenter.reenter001.MyThread.run (reenter001a.java:59)
MyThread[1]