-
Notifications
You must be signed in to change notification settings - Fork 493
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
TealDbg: Support for StepOver and refactoring object IDs #3653
Merged
michaeldiamant
merged 36 commits into
algorand:master
from
algochoi:algochoi/tealdbg-subroutine
Apr 13, 2022
Merged
Changes from 11 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
bb40245
Add stepover function for subroutines
algochoi e585a7a
Move object ID strings to cdtStateObjects.go
algochoi d015136
Run make sanity
algochoi 852e71e
Use error return for setBreakpoint
algochoi d939d21
Revert accidental change in local state
algochoi 3a55617
Add better checks to gloadImpl and add a unit test for runAll on grou…
algochoi 07716aa
Revert gloadImpl check
algochoi fbfd338
Merge branch 'master' into algochoi/tealdbg-subroutine
algochoi 9c21330
Add program source to tests
algochoi 89ecb51
Add support for call stack on cdt tealdbg
algochoi c25ba18
Merge branch 'master' into algochoi/tealdbg-subroutine
algochoi c60ed66
Add parsing test for call stack
algochoi 8cb9870
Revert a mistake in the test
algochoi eedee40
Merge branch 'master' into algochoi/tealdbg-subroutine
algochoi e6b39de
Add unit test for testing stepover control
algochoi 766db9a
Refactor and cleanup unnecessary stepover flag
algochoi e2dcf4c
Finally fix the race conditions and defer notifications until end of …
algochoi 7472837
Fix bad json struct
algochoi 8ddfcc4
Check callstack in the Update handler
algochoi b6e23a5
Fix callsub tests
algochoi d39e57d
Change state after taking lock
algochoi 73c857c
Add step out and unit tests
algochoi 6546ac1
Refactor debugConfig to take multiple breakpoints for resume
algochoi 942cb05
Change one of the comments for debugConfig to reflect updates
algochoi 4dd4cd7
More minor refactoring and clean up to delete redundant code
algochoi 61949c5
Consume error in deprecated webdbg :/
algochoi e46f1e3
Add line check inside the lock
algochoi f42f312
Minor fixes to testS
algochoi 8717637
Refactor TestCallStackControl into subtests
michaeldiamant 4ce49dc
Merge pull request #2 from michaeldiamant/algochoi/tealdbg-subroutine…
algochoi 8307899
Run gofmt
algochoi 24bdfa5
Fix stepout semantics and pause debugger only when we are outside sub…
algochoi fa51fff
Fix completed typo
algochoi f616437
Finish fixing typo
algochoi 7634b63
Merge branch 'master' into algochoi/tealdbg-subroutine
algochoi 1c9ed1a
Add new test for debugger hook
algochoi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// Copyright (C) 2019-2022 Algorand, Inc. | ||
// This file is part of go-algorand | ||
// | ||
// go-algorand is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Affero General Public License as | ||
// published by the Free Software Foundation, either version 3 of the | ||
// License, or (at your option) any later version. | ||
// | ||
// go-algorand is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Affero General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License | ||
// along with go-algorand. If not, see <https://www.gnu.org/licenses/>. | ||
|
||
package main | ||
|
||
import ( | ||
"github.com/algorand/go-algorand/cmd/tealdbg/cdt" | ||
) | ||
|
||
// Object IDs | ||
const ( | ||
localScopeObjID = "localScopeObjId" | ||
globalScopeObjID = "globalScopeObjID" | ||
globalsObjID = "globalsObjID" | ||
txnObjID = "txnObjID" | ||
gtxnObjID = "gtxnObjID" | ||
stackObjID = "stackObjID" | ||
scratchObjID = "scratchObjID" | ||
tealErrorID = "tealErrorID" | ||
appGlobalObjID = "appGlobalObjID" | ||
appLocalsObjID = "appLocalsObjID" | ||
txnArrayFieldObjID = "txnArrayField" | ||
logsObjID = "logsObjID" | ||
innerTxnsObjID = "innerTxnsObjID" | ||
) | ||
|
||
// Object Prefix IDs | ||
const ( | ||
gtxnObjIDPrefix = gtxnObjID + "_gid_" | ||
logObjIDPrefix = logsObjID + "_id" | ||
innerTxnObjIDPrefix = innerTxnsObjID + "_id" | ||
innerNestedTxnObjIDPrefix = innerTxnsObjID + "_nested" | ||
appGlobalObjIDPrefix = appGlobalObjID + "_" | ||
appLocalsObjIDPrefix = appLocalsObjID + "_" | ||
appLocalAppIDPrefix = appLocalsObjID + "__" | ||
txnArrayFieldPrefix = txnArrayFieldObjID + "__" | ||
) | ||
|
||
type objectDescFn func(s *cdtState, preview bool) []cdt.RuntimePropertyDescriptor | ||
|
||
var objectDescMap = map[string]objectDescFn{ | ||
globalScopeObjID: makeGlobalScope, | ||
localScopeObjID: makeLocalScope, | ||
globalsObjID: makeGlobals, | ||
txnObjID: makeTxn, | ||
gtxnObjID: makeTxnGroup, | ||
stackObjID: makeStack, | ||
scratchObjID: makeScratch, | ||
tealErrorID: makeTealError, | ||
appGlobalObjID: makeAppGlobalState, | ||
appLocalsObjID: makeAppLocalsState, | ||
logsObjID: makeLogsState, | ||
innerTxnsObjID: makeInnerTxnsState, | ||
} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
log the error?
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.
I think the only time it would error would be if
callsub
was at the end of the program andsetBreakpoint()
will try to set a breakpoint past the program. In that case, it feels normal to not log something and just continue, but maybe I'm missing a case.