From 3774e85d2124ef8897b7934e1a09b2c5d7a1c9b0 Mon Sep 17 00:00:00 2001 From: Timur Safin <tsafin@tarantool.org> Date: Wed, 2 Nov 2022 00:34:12 +0300 Subject: [PATCH] Revert "debugger: prevent running from Tarantool REPL" This reverts commit ace88542710dd7e8d5b58df322a06f75edecff25. That commit disabled repl in tarantool for debugger console session because debugger console wasn't compatible with Tarantool console, i.e. this code hang in terminal: ```lua tarantool> dbg = require 'luadebug' tarantool> dbg() ``` With the previous patch in the patchset, full readline support and console compatibility was introduced. Thus, no need to disable repl. Part of #7738 NO_TEST=internal NO_DOC=internal, revert unpublished NO_CHANGELOG=internal --- third_party/lua/README-luadebug.md | 10 ---------- third_party/lua/luadebug.lua | 9 --------- 2 files changed, 19 deletions(-) diff --git a/third_party/lua/README-luadebug.md b/third_party/lua/README-luadebug.md index 1a5bee0c06..e35cd3181c 100644 --- a/third_party/lua/README-luadebug.md +++ b/third_party/lua/README-luadebug.md @@ -198,16 +198,6 @@ Want to disable ANSI color support or disable GNU readline? Set the `NO_COLOR`. Known Issues: - -- Debugger REPL is not yet compatible with Tarantool console, i.e. this - code will hang in terminal - -```lua -tarantool> dbg = require 'luadebug' -tarantool> dbg() -``` - One should call debugger activation only in their instrumented code, not - from interactive console. - - Lua 5.1 lacks the API to access varargs. The workaround is to do something like `local args = {...}` and then use `unpack(args)` when you want to access them. In Lua 5.2+ and LuaJIT, you can simply use `...` in your expressions with the print command. - You can't add breakpoints to a running program or remove them. Currently the only way to set them is by explicitly calling the `dbg()` function explicitly in your code. (This is sort of by design and sort of because it's difficult/slow otherwise.) - Different interpreters (and versions) print out slightly different stack trace information. diff --git a/third_party/lua/luadebug.lua b/third_party/lua/luadebug.lua index 11847e25ea..b5109f5783 100644 --- a/third_party/lua/luadebug.lua +++ b/third_party/lua/luadebug.lua @@ -1122,15 +1122,6 @@ dbg = setmetatable({ return end - --[[ - Prevent debugger from running from inside of Tarantool console. - Check pointer, which Tarantool console stored to the console object - in the fiber.self().storage.console while inside of - REPL loop. - --]] - assert(require('fiber').self().storage.console == nil, DEBUGGER .. - ' is not yet compatible with interactive Tarantool console') - top_offset = top_offset or 0 stack_inspect_offset = top_offset stack_top = top_offset -- GitLab