Author Topic: Attach to Virtual Machine not working  (Read 8832 times)

kwilliams

  • Community Member
  • Posts: 45
  • Hero Points: 0
Re: Attach to Virtual Machine not working
« Reply #45 on: September 16, 2021, 12:39:08 AM »
sounds good. I'll grab the jar and run another test in the morning.

kwilliams

  • Community Member
  • Posts: 45
  • Hero Points: 0
Re: Attach to Virtual Machine not working
« Reply #46 on: September 16, 2021, 07:35:07 PM »
Here are the new logs. Thanks for fixing the nulls in the logging. That made it a lot easier.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: Attach to Virtual Machine not working
« Reply #47 on: September 16, 2021, 08:50:07 PM »
That did it, I can reproduce it with the information from that log.  I've followed it enough to determine it's not going to be a quick fix confined to the backend, so there won't be a updated download today at least.

Thanks for sending in those logs.


kwilliams

  • Community Member
  • Posts: 45
  • Hero Points: 0
Re: Attach to Virtual Machine not working
« Reply #48 on: September 16, 2021, 09:09:55 PM »
awesome!
I'll wait to here from you then.
Thanks!

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: Attach to Virtual Machine not working
« Reply #49 on: September 17, 2021, 07:54:08 PM »
Ok, I've updated the vsdebug.dll and the jar file.  You can download and re-apply those, and it should be able to hit the breakpoints.


kwilliams

  • Community Member
  • Posts: 45
  • Hero Points: 0
Re: Attach to Virtual Machine not working
« Reply #50 on: September 20, 2021, 04:49:30 PM »
Ok. I'll give it a try.

kwilliams

  • Community Member
  • Posts: 45
  • Hero Points: 0
Re: Attach to Virtual Machine not working
« Reply #51 on: September 21, 2021, 09:48:12 PM »
Ok, now when I attempt to place a breakpoint, I get: "Error enabling breakpoint: DBGP error: Parse error in command".

When I click OK in the error pop-up, my breakpoint is disabled.

I've attached the usual logs.
« Last Edit: September 21, 2021, 09:53:04 PM by kwilliams »

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: Attach to Virtual Machine not working
« Reply #52 on: September 23, 2021, 01:28:22 PM »
That's unexpected, it means we don't have a package + class associated with the breakpoint locations.   We use the tagging information to fill that out.  I do need to fix it to give a better error for this before the debugger tries to attach, having a package + class (or just class for the main module with no package statement) is required to set the breakpoints reliably for Scala.

For that project, in standard edit mode (not the debugger) run "toggle-breakpoints" in the SlickEdit command line to bring up the breakpoints window.  Are there any breakpoints that have empty "Class" columns? If you use F9 to get rid of and then re-add the breakpoint with an empty Class column at the same location, does the class field get populated?   If you go to that location in the editor window, does the "Current context" widget that's probably at the top of your editor (unless you removed it via View -> Toolbars) show any package + class, or is it blank? 

If the tagging really isn't marking a class/package for that location, we'll need to debug the tagging to see why that is, either by getting a high level idea of where the breakpoints are set (ie, "in the body of a Seq.map that's in a object method"), or getting some sort of example that can reproduce a place where a breakpoint can't be set. 

kwilliams

  • Community Member
  • Posts: 45
  • Hero Points: 0
Re: Attach to Virtual Machine not working
« Reply #53 on: September 23, 2021, 05:38:27 PM »
yep, the class is empty for any breakpoints I set in that file. breakpoints in another file in the project seem to fill in the class.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: Attach to Virtual Machine not working
« Reply #54 on: September 23, 2021, 06:37:24 PM »
Are these breakpoints in a method, or on a property initialization in a class or object somewhere?  Or somewhere else I'm not considering?

For the files I have tried so far, the only place I can get a blank Class for the breakpoint is trying to set one outside of a object/class/method body.  There may be a error parsing your file that's leaving us with no class/package information for that line, but I can't see that without an example that reproduces it.  That's why I'm trying to get a general idea of what sort of Scala statements are around your breakpoint lines. 

One other way to narrow it down would be to delete pieces of the code before the breakpoint in one of the problem files, take out whole vars or methods at a time.  After each one, use F9 to clear and re-set the breakpoint.  If it comes back with the Class field populated, than the parser is likely having problems with the last thing you deleted, and then we can figure out if you can PM that snippet or a (sanitized version with identifier names changed) to me so I can try to track down the problem from there.

kwilliams

  • Community Member
  • Posts: 45
  • Hero Points: 0
Re: Attach to Virtual Machine not working
« Reply #55 on: September 23, 2021, 07:06:27 PM »
they were in a try block inside a future.

it looked a little like this:
Future { blocking { try { <breakpoints in here> } catch {...} } }

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1818
  • Hero Points: 151
Re: Attach to Virtual Machine not working
« Reply #56 on: September 23, 2021, 08:02:57 PM »
Ok.  So if I do a skeleton of that layout inside a method like the following, I it works, so I think we're parsing the overall structure correctly.  Here's the actual snippet I put in an existing function:
Code: [Select]
val f = Future { blocking {
                try {
                    do_something()
                } catch {
                    case Bad() => ()
                }
            } }

Messing around with adding bad syntax to this to this, I can get it to fail to set a breakpoint either by putting bad syntax in the body of the try, or in the body of the catch.  So in this case is is possible code coming after the breakpoint can cause it to fail the parse, if we fail in the catch body.

So more blind divide and conquer - remove the body of the catch block, does the breakpoint resolve a class when  you toggle it then?  If so, put it back, and remove catch clauses until you get to clause that changes the behavior.  And then, it's either the destructuring in the catch clause, or something in the body of the clause, and we can go from there.

If clearing the catch clause doesn't make it go away, start removing statements in the try body, before the breakpoint until the breakpoint can resolve, and we can drill down into the last statement you deleted before it started working.

kwilliams

  • Community Member
  • Posts: 45
  • Hero Points: 0
Re: Attach to Virtual Machine not working
« Reply #57 on: September 23, 2021, 08:43:05 PM »
Ok. I'll try that and see what I find. It may take me a bit. I have my hair on fire right now with a high priority task.

More to follow.

kwilliams

  • Community Member
  • Posts: 45
  • Hero Points: 0
Re: Attach to Virtual Machine not working
« Reply #58 on: September 30, 2021, 07:27:19 PM »
Just got back in to test this and discovered that my trial expired :(

SlickEdit Support

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 384
  • Hero Points: 29
Re: Attach to Virtual Machine not working
« Reply #59 on: October 01, 2021, 01:44:11 PM »
New trial license on the way; check your Inbox :)

Best,
SlickEdit Support