Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v9]

2023-10-20 Thread Johannes Bechberger
On Fri, 20 Oct 2023 08:22:17 GMT, Johannes Bechberger wrote: >> Fix `onthrow` issue by passing the event info to the `initialize` method. >> >> This prevents `jdb` from receiving a broken exception event and throwing an >> internal NullPointerException, upon attaching to the JDWP-agent. > > Jo

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v9]

2023-10-20 Thread Christoph Langer
On Fri, 20 Oct 2023 08:22:17 GMT, Johannes Bechberger wrote: >> Fix `onthrow` issue by passing the event info to the `initialize` method. >> >> This prevents `jdb` from receiving a broken exception event and throwing an >> internal NullPointerException, upon attaching to the JDWP-agent. > > Jo

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v9]

2023-10-20 Thread Johannes Bechberger
> Fix `onthrow` issue by passing the event info to the `initialize` method. > > This prevents `jdb` from receiving a broken exception event and throwing an > internal NullPointerException, upon attaching to the JDWP-agent. Johannes Bechberger has updated the pull request incrementally with one

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v6]

2023-10-19 Thread Johannes Bechberger
On Wed, 18 Oct 2023 20:05:07 GMT, Chris Plummer wrote: >> Johannes Bechberger has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Add suggested modification > > test/jdk/com/sun/jdi/JdwpOnThrowTest.java line 64: > >> 62: int port =

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v8]

2023-10-18 Thread Chris Plummer
On Wed, 18 Oct 2023 23:47:43 GMT, Serguei Spitsyn wrote: >> Johannes Bechberger has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Add suggested fixes > > test/jdk/com/sun/jdi/JdwpOnThrowTest.java line 94: > >> 92:

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v8]

2023-10-18 Thread Serguei Spitsyn
On Wed, 18 Oct 2023 21:48:33 GMT, Johannes Bechberger wrote: >> Fix `onthrow` issue by passing the event info to the `initialize` method. >> >> This prevents `jdb` from receiving a broken exception event and throwing an >> internal NullPointerException, upon attaching to the JDWP-agent. > > Jo

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v8]

2023-10-18 Thread Chris Plummer
On Wed, 18 Oct 2023 21:48:33 GMT, Johannes Bechberger wrote: >> Fix `onthrow` issue by passing the event info to the `initialize` method. >> >> This prevents `jdb` from receiving a broken exception event and throwing an >> internal NullPointerException, upon attaching to the JDWP-agent. > > Jo

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v8]

2023-10-18 Thread Christoph Langer
On Wed, 18 Oct 2023 21:48:33 GMT, Johannes Bechberger wrote: >> Fix `onthrow` issue by passing the event info to the `initialize` method. >> >> This prevents `jdb` from receiving a broken exception event and throwing an >> internal NullPointerException, upon attaching to the JDWP-agent. > > Jo

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v7]

2023-10-18 Thread Johannes Bechberger
On Wed, 18 Oct 2023 21:40:54 GMT, Christoph Langer wrote: >> Johannes Bechberger has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Add suggested fixes > > test/jdk/com/sun/jdi/OnThrowTest.java line 2: > >> 1: /* >> 2: * Copyright (c) 202

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v8]

2023-10-18 Thread Johannes Bechberger
> Fix `onthrow` issue by passing the event info to the `initialize` method. > > This prevents `jdb` from receiving a broken exception event and throwing an > internal NullPointerException, upon attaching to the JDWP-agent. Johannes Bechberger has updated the pull request incrementally with one

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v7]

2023-10-18 Thread Christoph Langer
On Wed, 18 Oct 2023 21:38:05 GMT, Johannes Bechberger wrote: >> Fix `onthrow` issue by passing the event info to the `initialize` method. >> >> This prevents `jdb` from receiving a broken exception event and throwing an >> internal NullPointerException, upon attaching to the JDWP-agent. > > Jo

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v7]

2023-10-18 Thread Johannes Bechberger
> Fix `onthrow` issue by passing the event info to the `initialize` method. > > This prevents `jdb` from receiving a broken exception event and throwing an > internal NullPointerException, upon attaching to the JDWP-agent. Johannes Bechberger has updated the pull request incrementally with one

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v6]

2023-10-18 Thread Johannes Bechberger
On Wed, 18 Oct 2023 20:28:53 GMT, Christoph Langer wrote: >> Johannes Bechberger has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Add suggested modification > > src/jdk.jdwp.agent/share/native/libjdwp/debugInit.c line 631: > >> 629: * I

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v6]

2023-10-18 Thread Johannes Bechberger
On Wed, 18 Oct 2023 21:04:48 GMT, Christoph Langer wrote: >> Johannes Bechberger has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Add suggested modification > > test/jdk/com/sun/jdi/JdwpOnThrowTest.java line 29: > >> 27: import com.sun.j

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v6]

2023-10-18 Thread Christoph Langer
On Tue, 17 Oct 2023 19:54:24 GMT, Johannes Bechberger wrote: >> Fix `onthrow` issue by passing the event info to the `initialize` method. >> >> This prevents `jdb` from receiving a broken exception event and throwing an >> internal NullPointerException, upon attaching to the JDWP-agent. > > Jo

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v6]

2023-10-18 Thread Christoph Langer
On Wed, 11 Oct 2023 20:11:09 GMT, Christoph Langer wrote: >> Johannes Bechberger has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Add suggested modification > > LGTM > Changes look good. I'm approving, but I think also @RealCLanger shoul

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v6]

2023-10-18 Thread Chris Plummer
On Tue, 17 Oct 2023 19:54:24 GMT, Johannes Bechberger wrote: >> Fix `onthrow` issue by passing the event info to the `initialize` method. >> >> This prevents `jdb` from receiving a broken exception event and throwing an >> internal NullPointerException, upon attaching to the JDWP-agent. > > Jo

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v6]

2023-10-18 Thread Chris Plummer
On Wed, 18 Oct 2023 07:07:45 GMT, Johannes Bechberger wrote: >> test/jdk/com/sun/jdi/JdwpOnThrowTest.java line 121: >> >>> 119: private static String ATTACH_CONNECTOR = >>> "com.sun.jdi.SocketAttach"; >>> 120: // cache socket attaching connector >>> 121: private static AttachingCon

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v6]

2023-10-18 Thread Johannes Bechberger
On Wed, 18 Oct 2023 00:01:08 GMT, Chris Plummer wrote: > Does that mean the open is done by the debugger before the debuggee even > throws the exception, and that just leaves the debugger blocked on the open > until the debuggee does an accept? Yes. This is for three reasons: 1. server mode i

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v6]

2023-10-17 Thread Chris Plummer
On Tue, 17 Oct 2023 19:54:24 GMT, Johannes Bechberger wrote: >> Fix `onthrow` issue by passing the event info to the `initialize` method. >> >> This prevents `jdb` from receiving a broken exception event and throwing an >> internal NullPointerException, upon attaching to the JDWP-agent. > > Jo

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v4]

2023-10-17 Thread Johannes Bechberger
On Tue, 17 Oct 2023 21:37:05 GMT, Chris Plummer wrote: >> Yes, so the current way is probably ok? >> >> IDEs like IntelliJ properly handle the exception event that is sent and >> don't report an error, so I don't see a problem. > >> On the other hand, I think if the debug agent requires that a

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v4]

2023-10-17 Thread Chris Plummer
On Tue, 17 Oct 2023 20:41:10 GMT, Johannes Bechberger wrote: >> It seems that ex.request()) is null for this event. The spec for >> Event.request() says null might happen for VMDeath events, but doesn't >> mention any other. In any case, I guess JDI does not filter out any events >> for which

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v4]

2023-10-17 Thread Johannes Bechberger
On Tue, 17 Oct 2023 20:32:52 GMT, Chris Plummer wrote: >> test/jdk/com/sun/jdi/JdwpOnThrowTest.java line 76: >> >>> 74: while(eventIterator.hasNext() && start + TIMEOUT > >>> System.currentTimeMillis()) { >>> 75: Event event = eventIterator.next(); >>

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v4]

2023-10-17 Thread Chris Plummer
On Tue, 17 Oct 2023 20:16:18 GMT, Chris Plummer wrote: >> Johannes Bechberger has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Fixed event location > > test/jdk/com/sun/jdi/JdwpOnThrowTest.java line 76: > >> 74: while

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v4]

2023-10-17 Thread Chris Plummer
On Mon, 16 Oct 2023 19:07:37 GMT, Johannes Bechberger wrote: >> Fix `onthrow` issue by passing the event info to the `initialize` method. >> >> This prevents `jdb` from receiving a broken exception event and throwing an >> internal NullPointerException, upon attaching to the JDWP-agent. > > Jo

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v5]

2023-10-17 Thread Johannes Bechberger
On Mon, 16 Oct 2023 21:05:58 GMT, Johannes Bechberger wrote: >> Fix `onthrow` issue by passing the event info to the `initialize` method. >> >> This prevents `jdb` from receiving a broken exception event and throwing an >> internal NullPointerException, upon attaching to the JDWP-agent. > > Jo

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v5]

2023-10-17 Thread Chris Plummer
On Tue, 17 Oct 2023 19:29:48 GMT, Johannes Bechberger wrote: > Maybe in a follow-up in a PR? This is not directly related to the exception > value and could potentially change the behavior of the `onthrow` feature, > therefore needing more tests. Possibly, but the changes I made already have

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v6]

2023-10-17 Thread Johannes Bechberger
> Fix `onthrow` issue by passing the event info to the `initialize` method. > > This prevents `jdb` from receiving a broken exception event and throwing an > internal NullPointerException, upon attaching to the JDWP-agent. Johannes Bechberger has updated the pull request incrementally with one

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v5]

2023-10-17 Thread Johannes Bechberger
On Tue, 17 Oct 2023 19:07:45 GMT, Chris Plummer wrote: > I'm also wondering if we shouldn't just export cbException() and call it > directly rather than mimic a lot of what it is doing, although probably what > would be easier is a new API that handles the event described in the > EventInfo p

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v5]

2023-10-17 Thread Chris Plummer
On Mon, 16 Oct 2023 21:05:58 GMT, Johannes Bechberger wrote: >> Fix `onthrow` issue by passing the event info to the `initialize` method. >> >> This prevents `jdb` from receiving a broken exception event and throwing an >> internal NullPointerException, upon attaching to the JDWP-agent. > > Jo

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v5]

2023-10-16 Thread Chris Plummer
On Mon, 16 Oct 2023 21:05:58 GMT, Johannes Bechberger wrote: >> Fix `onthrow` issue by passing the event info to the `initialize` method. >> >> This prevents `jdb` from receiving a broken exception event and throwing an >> internal NullPointerException, upon attaching to the JDWP-agent. > > Jo

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v5]

2023-10-16 Thread Chris Plummer
On Mon, 16 Oct 2023 21:05:58 GMT, Johannes Bechberger wrote: >> Fix `onthrow` issue by passing the event info to the `initialize` method. >> >> This prevents `jdb` from receiving a broken exception event and throwing an >> internal NullPointerException, upon attaching to the JDWP-agent. > > Jo

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v5]

2023-10-16 Thread Johannes Bechberger
> Fix `onthrow` issue by passing the event info to the `initialize` method. > > This prevents `jdb` from receiving a broken exception event and throwing an > internal NullPointerException, upon attaching to the JDWP-agent. Johannes Bechberger has updated the pull request incrementally with one

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v4]

2023-10-16 Thread Chris Plummer
On Mon, 16 Oct 2023 19:07:37 GMT, Johannes Bechberger wrote: >> Fix `onthrow` issue by passing the event info to the `initialize` method. >> >> This prevents `jdb` from receiving a broken exception event and throwing an >> internal NullPointerException, upon attaching to the JDWP-agent. > > Jo

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v2]

2023-10-16 Thread Johannes Bechberger
On Mon, 16 Oct 2023 18:16:59 GMT, Johannes Bechberger wrote: >> `ex.catchLocation())` and `ex.thread().frame(0).location()` are valid. > > The problem is that the properties of the `ex.location()` are broken: > > `` > LocationImpl(VirtualMachine vm, > ReferenceTypeImpl dec

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v4]

2023-10-16 Thread Johannes Bechberger
> Fix `onthrow` issue by passing the event info to the `initialize` method. > > This prevents `jdb` from receiving a broken exception event and throwing an > internal NullPointerException, upon attaching to the JDWP-agent. Johannes Bechberger has updated the pull request incrementally with one

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v2]

2023-10-16 Thread Johannes Bechberger
On Mon, 16 Oct 2023 17:51:31 GMT, Johannes Bechberger wrote: >> Ok. It should work so there is a bug somewhere. I'll look into it. In the >> meantime can you verify that ex.catchLocation().method() is valid? > > `ex.catchLocation())` and `ex.thread().frame(0).location()` are valid. The problem

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v2]

2023-10-16 Thread Johannes Bechberger
On Mon, 16 Oct 2023 17:20:57 GMT, Chris Plummer wrote: >> I resolved all the other things you pointed out, but this issue is sticky. > > Ok. It should work so there is a bug somewhere. I'll look into it. In the > meantime can you verify that ex.catchLocation().method() is valid? `ex.catchLocati

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v2]

2023-10-16 Thread Chris Plummer
On Mon, 16 Oct 2023 16:34:40 GMT, Johannes Bechberger wrote: >> `if (!ex.thread().frame(0).location().equals(ex.location())) {` causes an >> exception: >> >> >> java.lang.IllegalArgumentException: Invalid method id: 139869509179824 >> at >> jdk.jdi/com.sun.tools.jdi.ReferenceTypeImpl

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v2]

2023-10-16 Thread Johannes Bechberger
On Mon, 16 Oct 2023 16:22:29 GMT, Johannes Bechberger wrote: >> test/jdk/com/sun/jdi/JdwpOnThrowTest.java line 86: >> >>> 84: if (ex.catchLocation() == null) { >>> 85: throw new RuntimeException("Exception >>> catch location is null")

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v3]

2023-10-16 Thread Johannes Bechberger
> Fix `onthrow` issue by passing the event info to the `initialize` method. > > This prevents `jdb` from receiving a broken exception event and throwing an > internal NullPointerException, upon attaching to the JDWP-agent. Johannes Bechberger has updated the pull request incrementally with one

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v2]

2023-10-16 Thread Johannes Bechberger
On Mon, 16 Oct 2023 15:50:05 GMT, Chris Plummer wrote: >> Johannes Bechberger has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Add test case > > test/jdk/com/sun/jdi/JdwpOnThrowTest.java line 86: > >> 84: if (

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v2]

2023-10-16 Thread Chris Plummer
On Mon, 16 Oct 2023 16:01:39 GMT, Johannes Bechberger wrote: >> Fix `onthrow` issue by passing the event info to the `initialize` method. >> >> This prevents `jdb` from receiving a broken exception event and throwing an >> internal NullPointerException, upon attaching to the JDWP-agent. > > Jo

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option

2023-10-16 Thread Johannes Bechberger
On Wed, 11 Oct 2023 10:44:53 GMT, Johannes Bechberger wrote: > Fix `onthrow` issue by passing the event info to the `initialize` method. > > This prevents `jdb` from receiving a broken exception event and throwing an > internal NullPointerException, upon attaching to the JDWP-agent. I added a

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option [v2]

2023-10-16 Thread Johannes Bechberger
> Fix `onthrow` issue by passing the event info to the `initialize` method. > > This prevents `jdb` from receiving a broken exception event and throwing an > internal NullPointerException, upon attaching to the JDWP-agent. Johannes Bechberger has updated the pull request incrementally with one

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option

2023-10-16 Thread Johannes Bechberger
On Wed, 11 Oct 2023 10:44:53 GMT, Johannes Bechberger wrote: > Fix `onthrow` issue by passing the event info to the `initialize` method. > > This prevents `jdb` from receiving a broken exception event and throwing an > internal NullPointerException, upon attaching to the JDWP-agent. After the

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option

2023-10-15 Thread Chris Plummer
On Wed, 11 Oct 2023 10:44:53 GMT, Johannes Bechberger wrote: > Fix `onthrow` issue by passing the event info to the `initialize` method. > > This prevents `jdb` from receiving a broken exception event and throwing an > internal NullPointerException, upon attaching to the JDWP-agent. Ok. I thi

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option

2023-10-14 Thread Johannes Bechberger
On Wed, 11 Oct 2023 10:44:53 GMT, Johannes Bechberger wrote: > Fix `onthrow` issue by passing the event info to the `initialize` method. > > This prevents `jdb` from receiving a broken exception event and throwing an > internal NullPointerException, upon attaching to the JDWP-agent. Sorry, I

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option

2023-10-14 Thread Chris Plummer
On Wed, 11 Oct 2023 10:44:53 GMT, Johannes Bechberger wrote: > Fix `onthrow` issue by passing the event info to the `initialize` method. > > This prevents `jdb` from receiving a broken exception event and throwing an > internal NullPointerException, upon attaching to the JDWP-agent. So when y

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option

2023-10-14 Thread Johannes Bechberger
On Wed, 11 Oct 2023 10:44:53 GMT, Johannes Bechberger wrote: > Fix `onthrow` issue by passing the event info to the `initialize` method. > > This prevents `jdb` from receiving a broken exception event and throwing an > internal NullPointerException, upon attaching to the JDWP-agent. There is

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option

2023-10-12 Thread Chris Plummer
On Wed, 11 Oct 2023 10:44:53 GMT, Johannes Bechberger wrote: > Fix `onthrow` issue by passing the event info to the `initialize` method. > > This prevents `jdb` from receiving a broken exception event and throwing an > internal NullPointerException, upon attaching to the JDWP-agent. So with 8

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option

2023-10-12 Thread Johannes Bechberger
On Wed, 11 Oct 2023 10:44:53 GMT, Johannes Bechberger wrote: > Fix `onthrow` issue by passing the event info to the `initialize` method. > > This prevents `jdb` from receiving a broken exception event and throwing an > internal NullPointerException, upon attaching to the JDWP-agent. I can con

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option

2023-10-11 Thread Chris Plummer
On Wed, 11 Oct 2023 10:44:53 GMT, Johannes Bechberger wrote: > Fix `onthrow` issue by passing the event info to the `initialize` method. > > This prevents `jdb` from receiving a broken exception event and throwing an > internal NullPointerException, upon attaching to the JDWP-agent. Also, doe

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option

2023-10-11 Thread Chris Plummer
On Wed, 11 Oct 2023 10:44:53 GMT, Johannes Bechberger wrote: > Fix `onthrow` issue by passing the event info to the `initialize` method. > > This prevents `jdb` from receiving a broken exception event and throwing an > internal NullPointerException, upon attaching to the JDWP-agent. It would

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option

2023-10-11 Thread Johannes Bechberger
On Wed, 11 Oct 2023 10:44:53 GMT, Johannes Bechberger wrote: > Fix `onthrow` issue by passing the event info to the `initialize` method. > > This prevents `jdb` from receiving a broken exception event and throwing an > internal NullPointerException, upon attaching to the JDWP-agent. No. But i

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option

2023-10-11 Thread Chris Plummer
On Wed, 11 Oct 2023 10:44:53 GMT, Johannes Bechberger wrote: > Fix `onthrow` issue by passing the event info to the `initialize` method. > > This prevents `jdb` from receiving a broken exception event and throwing an > internal NullPointerException, upon attaching to the JDWP-agent. Do you ha

Re: RFR: JDK-8317920: JDWP-agent sends broken exception event with onthrow option

2023-10-11 Thread Christoph Langer
On Wed, 11 Oct 2023 10:44:53 GMT, Johannes Bechberger wrote: > Fix `onthrow` issue by passing the event info to the `initialize` method. > > This prevents `jdb` from receiving a broken exception event and throwing an > internal NullPointerException, upon attaching to the JDWP-agent. LGTM ---