-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Print out warnings associated with local variables (#10842)
Fixes #9749 by: - [x] Adding `fn` option to `enso-debug-server` instrument - eb3b76e - [x] Print warnings (if any) to stderr - 4fda04b - [x] Improving output of `:list` to print out warnings - dbe3c45 - [x] Print errors to stderr - 1312546 - [x] Exiting on `DataflowError` - 2cc7ef5 and e6fbf73 - [x] Using all of that inside of `runner/*Main` - 7df58ef The core of the change is in instrumentation that wraps the `main` method and at its end checks for _warnings or errors_ among local variables. When an error is found, it wraps the original return value of `main` with a proxy that delegates to the original value, but also pretends to be _exit exception_ with exit code 173. That one is detected in `Main` launcher to exit the process with exit code 173. # Important Notes As a side-effect of this change, one can request an invocation of REPL at the end of any method just by providing a property to the VM: ```bash $ enso --vm.D=polyglot.enso-debug-server.method-break-point=err_test.main --run err_test.enso --repl ``` stops at the end of `main` method of `err_test.enso` file.
- Loading branch information
1 parent
22263e8
commit e5f865f
Showing
18 changed files
with
726 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 6 additions & 2 deletions
8
...so/polyglot/debugger/DebugServerInfo.java → ...java/org/enso/common/DebugServerInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
package org.enso.polyglot.debugger; | ||
package org.enso.common; | ||
|
||
/** Container for Runtime Server related constants. */ | ||
/** Container for debug server related constants. */ | ||
public class DebugServerInfo { | ||
private DebugServerInfo() { | ||
|
||
} | ||
public static final String URI = "enso://debug-server"; | ||
public static final String INSTRUMENT_NAME = "enso-debug-server"; | ||
public static final String ENABLE_OPTION = INSTRUMENT_NAME + ".enable"; | ||
public static final String METHOD_BREAKPOINT_OPTION = INSTRUMENT_NAME + ".method-break-point"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.