-
Notifications
You must be signed in to change notification settings - Fork 1.1k
fix #1484: position of while incorrect in debug #1951
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
Conversation
The debugging information is annotated as comments to the code in brackets: val x = f(3) // [break] [next: line=5]
val y = 5
Note: jdb uses line number starts from 1 |
As a side effect, this PR also tests |
Very nice! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice indeed!
LGTM, one question though - don't you want to run this on CI?
I think it would be good to run in CI.
|
So please add it :) You do so in the |
It would be much better if this could just be another JUnit test, we already have too many different commands to run all tests. |
@felixmulder thanks for the tip, just added.
The concern makes sense. However the debug test involves several processes and scripts, it would be a little awkward to do in JUnit. I can add a junit test to call the script when this becomes a problem. |
@liufengyun - perhaps it would be possible to use jdb java interfaces directly instead of using It would be good to explore this before cementing on using the a script based solution, I agree with @smarter. If we can have this as unit tests, then that leads to less of a cognitive overhead when somebody looks at adding more of these tests in X day/weeks/years. :) |
It's also necessary if we want the tests to run on Windows, we cannot rely on bash scripts then. |
The "proper" way to do this would probably to use the JVM debugging APIs: https://docs.oracle.com/javase/8/docs/technotes/guides/jpda/architecture.html I don't know how complicated they are to use. |
I've checked JVM TI and JDI, both are possible alternative solutions. However, JVM TI requires writing C++ code, JDI involves technical details about the network connections and the debugging protocol. From the point of view of maintenance, how much efforts we put in the implementation implies the cost it takes for a third person to maintain it. The JDB interface requires no knowledge from the API whatsoever, seems to be a much simpler approach to the problem. WDYT ? @smarter @felixmulder |
Another option would be to use http://scala-debugger.org/ though that would add a dependency on scala code to our test suite. For now, the simplest solution might be to disable the debugging tests when running on Windows. |
Thanks @smarter , scala-debugger looks much more friendly and approachable. |
@liufengyun, note that as discussed during the meeting depending on scala artifacts isn't a good idea, as we'll need to compile&publish them before we test the compiler, ie you'll be building them with untested compiler. |
As long as they are published with 2.11 and we support 2.11, we don't need to compile and publish them ourselves. If one day we stop supporting 2.11 artefacts then this is more problematic, but we can always publish scala-debugger with an already-tested and published version of dotty. |
The last clause is false if new version of dotty is binary incompatible
with artifacts compiled by previous version, including stdlib.
And I'm willing to bet that there would at least be several occasions when
dotty will break binary compatibility.
…On 9 February 2017 2:18:02 pm Guillaume Martres ***@***.***> wrote:
> as we'll need to compile&publish them before we test the compiler
As long as they are published with 2.11 and we support 2.11, we don't need
to compile and publish them ourselves. If one day we stop supporting 2.11
artefacts then this is more problematic, but we can always publish
scala-debugger with an already-tested and published version of dotty.
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#1951 (comment)
|
@smarter if the concern is about windows, then it's not a big issue, as the main thing used is The driver script (link) is just a few lines, can easy be turned into powershell or the like. |
@felixmulder : just checked the home on drone is |
@liufengyun - sure, just remove the |
0dc771f
to
8bab01e
Compare
This PR needs to be rebased and the |
This commit fix #1484: position of while incorrect in debug. Also, it introduces the infrastructure for testing debuggability.
To add a new debuggability test, just put a scala file like the follows under
tests/debug
with debug annotations (see the comment in code for detail):Review @felixmulder .