Skip to content
GitLab
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • LIGO LIGO
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 171
    • Issues 171
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 44
    • Merge requests 44
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ligolang
  • LIGOLIGO
  • Merge requests
  • !1209

Add support for function call trace in the interpreter

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged E. Rivas requested to merge er433/interpreter/stacktrace into dev Jun 30, 2021
  • Overview 0
  • Commits 13
  • Pipelines 14
  • Changes 14

This MR keeps track of function calls in the interpreter, so that a "trace" can be printed when there was some failure.

Example:

$ ligo test src/test/contracts/negative/interpreter_tests/test_trace.mligo 
File "src/test/contracts/negative/interpreter_tests/test_trace.mligo", line 3, characters 5-24:
  2 |   if x < 0 then
  3 |     (failwith "negative" : int)
  4 |   else

Test failed with "negative"
Trace:
File "src/test/contracts/negative/interpreter_tests/test_trace.mligo", line 5, characters 4-13 ,
File "src/test/contracts/negative/interpreter_tests/test_trace.mligo", line 5, characters 4-13 ,
File "src/test/contracts/negative/interpreter_tests/test_trace.mligo", line 5, characters 4-13 ,
File "src/test/contracts/negative/interpreter_tests/test_trace.mligo", line 5, characters 4-13 ,
File "src/test/contracts/negative/interpreter_tests/test_trace.mligo", line 5, characters 4-13 ,
File "src/test/contracts/negative/interpreter_tests/test_trace.mligo", line 9, characters 39-46 ,
File "src/test/contracts/negative/interpreter_tests/test_trace.mligo", line 9, characters 14-49

for

let rec j (x : int) : int =
  if x < 0 then
    (failwith "negative" : int)
  else
    j (x - 1)

let g (x : int) = x

let test_me = (fun (f : int -> int) -> f (g 4)) j
  • has a changelog entry
Edited Jul 14, 2021 by E. Rivas
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: er433/interpreter/stacktrace