groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Milles (JIRA)" <>
Subject [jira] [Comment Edited] (GROOVY-8289) STC and default value in ctor is causing debugging error
Date Thu, 17 Aug 2017 21:34:00 GMT


Eric Milles edited comment on GROOVY-8289 at 8/17/17 9:33 PM:

Result of moving `controller.getCompileStack().init` and `controller.getCallSiteWriter().makeSiteEntry`
to the top of `AsmClassGenerator.visitStdMethod`.

The start and length of 'this' and other locals has been corrected to 0.  This matches the
output if I had added the `super()` constructor call to the code explicitly.

was (Author: emilles):
Result of moving `controller.getCompileStack().init` and `controller.getCallSiteWriter().makeSiteEntry`
to the top of `AsmClassGenerator.visitStdMethod`

> STC and default value in ctor is causing debugging error
> --------------------------------------------------------
>                 Key: GROOVY-8289
>                 URL:
>             Project: Groovy
>          Issue Type: Bug
>          Components: bytecode
>    Affects Versions: 2.4.12
>            Reporter: Eric Milles
>         Attachments: C1.txt, C2.txt, C3.txt
> When debugging in the IDE, there is a curious behavior where it looks like step requests
are not being respected.  One thing I have found is that JDWP requests to the JVM process
are failing to resolve the variable "this" in certain cases.  I need some help from someone
who knows the bytecode better than myself to figure out where the problem lies.
> Original issue:
> I have narrowed it down to a small bit of code with static compilation enabled.
> {code}
> @groovy.transform.CompileStatic
> class C {
>   String string
>   C(String s = null) { string = s }
>   static void main(args) {
>     def c = new C('') // put breakpoint on this line, run as Java app, and step
>     println c
>   }
> }
> {code}
> Debug stepping fails when executing the constructor for C.  If I use {{new C(string:'')}},
the generated default constructor is used instead and debugging works fine.  So I think it
has something to do with the one-arg constructor's bytecode.
> I dumped the class file using javap and have attached them.  {{C1.txt}} is for the code
above.  {{C2.txt}} is the above with the named args constructor used instead.  I'm not sure
if the local args table for the single-argument constructor is bad and that is why "this"
cannot be resolved.
> There are several similar bugs reported for other tools and whatnots when looking for
"JDWP error code 35".  Hopefully, these help point to something in the bytecode that can be

This message was sent by Atlassian JIRA

View raw message