Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Step over continues to next breakpoint #312

Closed
felixdo opened this issue Jun 14, 2017 · 4 comments
Closed

Step over continues to next breakpoint #312

felixdo opened this issue Jun 14, 2017 · 4 comments
Assignees
Labels

Comments

@felixdo
Copy link
Contributor

felixdo commented Jun 14, 2017

I have GroovyEclipse installed and I am debugging a JUnit4 Plugin Test which launches a script through a GroovyShell. I have a breakpoint where execution stops. When I press "Step Over", i expect execution to halt at the next line, but that doesn't happen. Instead, execution just continues. Is this groovy-eclipse/jdt patch related maybe?

@eric-milles
Copy link
Member

eric-milles commented Aug 15, 2017

I've been poking away at this since I have experienced similar behavior. Best I can tell, Eclipse is communicating with the runtime process (the thing being debugged) and some requests for "this" in a given scope are failing. These failures break down the checks for breakpoints and stepping.

Here is my recreation scenario:

@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
  }
}

JDWP will get into org.eclipse.jdi.internal.MirrorImpl.defaultReplyErrorHandler(int) with error code 35, because org.eclipse.jdt.internal.debug.core.model.JDIThread.StepHandler.createStepRequest(int) fails on call to ObjectReference thisObject = currentFrame.thisObject(); (line 2576 in Eclipse Oxygen).

If I replace new C('') with new C(string:'') the problem goes away. I have not had a chance to investigate why this is. There may be a Groovy core bug forthcoming.

eric-milles added a commit that referenced this issue Aug 18, 2017
Any constructor that lacks an explicit call to its super class
constructor relied on code generation that affected the start and length
of local variables.  This caused JDI/JDWP errors when debugger requested
"this" for a stack frame.
@eric-milles
Copy link
Member

I patched the issue that I discovered and filed a bug with Groovy core to do so as well. You will need to recompile all your sources with this fix to get improved debugging. I'm not sure if that will be enough to fix your issue, but it did help debugging and variables display for me.

@felixdo
Copy link
Contributor Author

felixdo commented Aug 23, 2017 via email

@eric-milles
Copy link
Member

eric-milles commented Aug 23, 2017 via email

@eric-milles eric-milles added the bug label Sep 7, 2017
@eric-milles eric-milles self-assigned this Oct 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants