RFR: 7903071: Jtreg plugin debug functionality broken in 2021.3 [v2]

Lance Andersen lancea at openjdk.java.net
Tue Jan 4 19:29:22 UTC 2022


On Fri, 3 Dec 2021 16:47:51 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> IntelliJ 2021.3 changed the order in which certain plugin methods are called when debugging a jtreg test. More specifically, the `JtregDebuggerRunner::createContentDescriptor` method is called _after_ `JTRegConfigurationRunnableState::createJavaParameters`. Since the former sets up the debugging port which has then to be passed to the jtreg command line (in the latter), this means that, in 2021.3 we end up creating a command line that is broken because it has either no port (when we debug for the first time) or a stale port (when we debug subsequent times).
>> 
>> I discussed this with Anna Kozlova and, while jtreg is a bit peculiar compared to other debugging plugin (as jtreg spawns other VMs, which is why we need to create a command line which includes the port number), it is possible to fix this in a way that is also compatible with older versions - by overriding `JtregDebuggerRunner::execute`, which is called before the other two methods. So we can setup the port number in there - and then reuse port number in the subsequent calls.
>
> Maurizio Cimadamore has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains six commits:
> 
>  - Revert README changes
>  - Merge branch 'master' into debug_2021_3
>  - Fix debugging issues when using 2021.3
>  - Update README.md
>  - Fix link syntax
>  - Update toplevel readme

Looks OK to me

-------------

PR: https://git.openjdk.java.net/jtreg/pull/44


More information about the jtreg-dev mailing list