forked from google/starlark-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
starlark: API additions for improved debugging (google#76)
This change adds a number of small features to improve debugging. The actual debugger API will come in a later change. - Thread.Name : an optional string field that describes the purpose of the thread, for use in debugging. - (*Program).Filename: a method that reports the file of the program. Also, a String method that returns the same thing. Also, a test that it reports the correct location even for an empty file (a special case of the previous implementation). - (*Frame).Local(i int): a method to return the value of a local variable of an active frame, such as one might use in debugger's stack trace. - ExprFunc: creates a starlark.Function from a given expression, such as one might use in a debugger REPL.
- Loading branch information
Showing
9 changed files
with
135 additions
and
23 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
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
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package starlark | ||
|
||
// This file defines an experimental API for the debugging tools. | ||
// Some of these declarations expose details of internal packages. | ||
// (The debugger makes liberal use of exported fields of unexported types.) | ||
// Breaking changes may occur without notice. | ||
|
||
// Local returns the value of the i'th local variable. | ||
// It may be nil if not yet assigned. | ||
// | ||
// Local may be called only for frames whose Callable is a *Function (a | ||
// function defined by Starlark source code), and only while the frame | ||
// is active; it will panic otherwise. | ||
// | ||
// This function is provided only for debugging tools. | ||
// | ||
// THIS API IS EXPERIMENTAL AND MAY CHANGE WITHOUT NOTICE. | ||
func (fr *Frame) Local(i int) Value { return fr.locals[i] } |
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
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