tarantool / tarantool/doc

Console debugger for Lua

Open
#3,195 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

2.11 debugger feature
Dominant language
CSS
Stars
15
Forks
49
Avg merge
1d 13h
Merged PRs (30d)
3

Description

Related dev issue: https://github.com/tarantool/tarantool/issues/7456
Product: Tarantool
Since: 2.11
Root document: TBD. Likely to be Tooling
SME: @ tsafin @ igormunkin

Details

Console debugger luadebug.lua

Module luadebug.lua is available as console debugger of Lua scripts.
It's activated via:

local debugger = require 'luadebug'
debugger()

Originally we have used 3rd-party code from slembcke/debugger.lua but
significantly refactored since then.

Currently available console shell commands are:

    c|cont|continue
    - continue execution
    d|down
    - move down the stack by one frame
    e|eval $expression
    - execute the statement
    f|finish|step_out
    - step forward until exiting the current function
    h|help|?
    - print this help message
    l|locals
    - print the function arguments, locals and upvalues
    n|next|step_over
    - step forward by one line (skipping over functions)
    p|print $expression
    - execute the expression and print the result
    q|quit
    - exit debugger
    s|st|step|step_into
    - step forward by one line (into functions)
    t|trace|bt
    - print the stack trace
    u|up
    - move up the stack by one frame
    w|where $linecount
    - print source code around the current line

Console debugger luadebug.lua allows to see sources of builtin
Tarantool module (e.g. @builtin/datetime.lua), and it uses new
function introduced for that purpose tarantool.debug.getsources(),
one could use this function in any external GUI debugger (i.e. vscode
or JetBrains) if need to show sources of builtin modules while they
have been debugged.

Please see third_party/lua/README-luadebug.md for a fuller description
of an original luadebug.lua implementation.
Requested by @tsafin in https://github.com/tarantool/tarantool/commit/a2ba5013d18f7fa8cc9a9baed44e1cb46c7e72fd.

Definition of done

  • Docs provide complete and correct info about using the new debugger.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading third_party/lua/README-luadebug.md and the issue's command list, then inspect the Tooling documentation linked in the issue to determine the appropriate page. Document complete and correct usage of luadebug.lua, including activation and available console commands, and ensure the new debugger is covered in the documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.