Skip to content
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

feat: add an interactive debugger to GnoVM #1563

Merged
merged 42 commits into from
May 14, 2024
Merged

Commits on Jan 19, 2024

  1. feat: and an interactive debugger to GnoVM

    We provide here an embedded interactive debugger to let the user control
    and inspect its program at symbolic level, with the same features and
    commands as classical debuggers: gdb, lldb or delve.
    
    The debugger is enabled by setting the `-debug` flag in `gno run`
    command, which loads the target program and immediately shows a debugger
    prompt on the console:
    
    	$ gno run -debug /tmp/my-program.gno
    	Welcome to the Gnovm debugger. Type 'help' for list of commands.
    	dbg>
    
    Providing `-debug-addr` flag allows to start a remote debugging session,
    and not interfer with the program stdin and stdout.
    For example, in a first terminal:
    
    	$ gno run -debug-addr :4000 /tmp/my-program.gno
    	Waiting for debugger client to connect at :4000
    
    And in a second terminal, using a netcat like nc(1):
    
    	$ nc localhost 4000
    	Welcome to the Gnovm debugger. Type 'help' for list of commands.
    	dbg>
    
    The debugger works by intercepting each execution step at virtual
    machine level (each iteration within `Machine.Run` loop) to a
    callback, which in turns can provide a debugger command REPL or
    check if the execution can proceed to the next step, etc.
    
    This change request is still work-in-progress, as many debugger commands
    are not ready yet. Nevertheless, the general logic and structure is
    there. It is possible to `continue`, `stepi`, `detach`, etc and get
    a general feedback of the user experience and the impact on the code.
    
    Efforts are made to make this feature minimally intrusive in the actual
    VM, and not interfering when the debugger is not used.
    
    It is planned shortly after this PR is integrated to add the capacity
    to attach to an already running program, and to taylor the data format
    for existing debugging environments such as VScode, etc, as demand
    arises.
    mvertes committed Jan 19, 2024
    Configuration menu
    Copy the full SHA
    21832ab View commit details
    Browse the repository at this point in the history

Commits on Jan 25, 2024

  1. Configuration menu
    Copy the full SHA
    6d55061 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    103ae9a View commit details
    Browse the repository at this point in the history

Commits on Jan 30, 2024

  1. Configuration menu
    Copy the full SHA
    0cd9c23 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    80b17c4 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8169086 View commit details
    Browse the repository at this point in the history

Commits on Jan 31, 2024

  1. Configuration menu
    Copy the full SHA
    f74fd61 View commit details
    Browse the repository at this point in the history

Commits on Feb 1, 2024

  1. Improve stack trace

    mvertes committed Feb 1, 2024
    Configuration menu
    Copy the full SHA
    55d89de View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f5e13d7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    071b4be View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2a64081 View commit details
    Browse the repository at this point in the history

Commits on Feb 2, 2024

  1. Configuration menu
    Copy the full SHA
    a7c3876 View commit details
    Browse the repository at this point in the history

Commits on Feb 6, 2024

  1. Add unit tests for debugger

    mvertes committed Feb 6, 2024
    Configuration menu
    Copy the full SHA
    c302790 View commit details
    Browse the repository at this point in the history

Commits on Feb 9, 2024

  1. Configuration menu
    Copy the full SHA
    66ace69 View commit details
    Browse the repository at this point in the history

Commits on Feb 16, 2024

  1. Implement a go expression parser for the 'print' command.

    debugEvalExpr evaluates a Go expression in the context of the VM and returns
    the corresponding value, or an error.
    The supported expression syntax is a small subset of Go expressions:
    basic literals, identifiers, selectors, index expressions, or a combination
    of those are supported, but none of function calls, arithmetic, logic or
    assign operations, type assertions of convertions.
    mvertes committed Feb 16, 2024
    Configuration menu
    Copy the full SHA
    3976c57 View commit details
    Browse the repository at this point in the history

Commits on Feb 18, 2024

  1. Configuration menu
    Copy the full SHA
    0ac45cb View commit details
    Browse the repository at this point in the history

Commits on Mar 28, 2024

  1. simplify debug command names sorting

    Co-authored-by: Morgan <git@howl.moe>
    mvertes and thehowl authored Mar 28, 2024
    Configuration menu
    Copy the full SHA
    7455761 View commit details
    Browse the repository at this point in the history
  2. Revert "simplify debug command names sorting"

    This reverts commit 7455761.
    mvertes committed Mar 28, 2024
    Configuration menu
    Copy the full SHA
    49149cc View commit details
    Browse the repository at this point in the history

Commits on Apr 4, 2024

  1. Configuration menu
    Copy the full SHA
    11f51de View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9fd850c View commit details
    Browse the repository at this point in the history
  3. fix typo

    mvertes committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    d4cda36 View commit details
    Browse the repository at this point in the history
  4. fix thelper lint

    mvertes committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    c7e14a6 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    860d8bc View commit details
    Browse the repository at this point in the history

Commits on Apr 5, 2024

  1. Configuration menu
    Copy the full SHA
    7fe0fec View commit details
    Browse the repository at this point in the history
  2. improve test coverage

    mvertes committed Apr 5, 2024
    Configuration menu
    Copy the full SHA
    a8edb0a View commit details
    Browse the repository at this point in the history

Commits on Apr 6, 2024

  1. fix test

    mvertes committed Apr 6, 2024
    Configuration menu
    Copy the full SHA
    79096ba View commit details
    Browse the repository at this point in the history

Commits on Apr 11, 2024

  1. Configuration menu
    Copy the full SHA
    e4ebcc7 View commit details
    Browse the repository at this point in the history

Commits on Apr 24, 2024

  1. Configuration menu
    Copy the full SHA
    445c565 View commit details
    Browse the repository at this point in the history
  2. typos

    mvertes committed Apr 24, 2024
    Configuration menu
    Copy the full SHA
    26dd6a3 View commit details
    Browse the repository at this point in the history
  3. revert alternate debugPrint

    mvertes committed Apr 24, 2024
    Configuration menu
    Copy the full SHA
    a69a496 View commit details
    Browse the repository at this point in the history

Commits on Apr 25, 2024

  1. fix list and break commands when source file is not set

    Fix also list for sources comming from memory packages.
    mvertes committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    3b19e1a View commit details
    Browse the repository at this point in the history
  2. fix previous

    mvertes committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    e573bb4 View commit details
    Browse the repository at this point in the history

Commits on Apr 29, 2024

  1. Configuration menu
    Copy the full SHA
    dfb202e View commit details
    Browse the repository at this point in the history

Commits on May 6, 2024

  1. fix: don not panic in case of error of remote debugger connection

    The connection is now initiated of the debugger state machine, so
    the error can be processed from the start. It also allows slight
    simplifcations.
    mvertes committed May 6, 2024
    Configuration menu
    Copy the full SHA
    98d9b1f View commit details
    Browse the repository at this point in the history

Commits on May 10, 2024

  1. fix: lookup values in if body. Do not panic if debug expr error.

    Also improve test coverage (now > 96% for debugger.go).
    mvertes committed May 10, 2024
    Configuration menu
    Copy the full SHA
    3fad6b9 View commit details
    Browse the repository at this point in the history
  2. fix test

    mvertes committed May 10, 2024
    Configuration menu
    Copy the full SHA
    a6700bf View commit details
    Browse the repository at this point in the history

Commits on May 13, 2024

  1. Configuration menu
    Copy the full SHA
    1d4bc06 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a7a2602 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    50c3edf View commit details
    Browse the repository at this point in the history

Commits on May 14, 2024

  1. Configuration menu
    Copy the full SHA
    9557a26 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    dc77bed View commit details
    Browse the repository at this point in the history
  3. fix invalid test

    thehowl committed May 14, 2024
    Configuration menu
    Copy the full SHA
    1c52ee6 View commit details
    Browse the repository at this point in the history