[Tarantool-patches] [PATCH v2 luajit 5/6] dbg: generalize extension
Sergey Kaplun
skaplun at tarantool.org
Wed May 27 15:55:05 MSK 2026
Hi, Sergey!
Thanks for the review!
Fixed your comment and force-pushed the branch.
On 27.05.26, Sergey Bronnikov wrote:
> Hi, Sergey,
>
> thanks for the patch! LGTM with a minor comment.
>
> Sergey
>
> On 5/19/26 15:39, Sergey Kaplun wrote:
> > This patch joins the LLDB and GDB LuaJIT debugging extensions
> > into one, so now the extension logic can be debugger-agnostic.
> >
> > To do that, an adapter class is introduced, and all of the
> > debugger-specific behavior is encapsulated there and in its child
> > debugger classes with the specific implementations of required methods.
> > The extension auto-detects the debugger it was loaded into and selects
> > the correct low-level logic implementation.
> >
> > The F821 ignore is removed from <.flake8rc> since there is no more need
> > for it.
> > ---
> > .flake8rc | 5 -
> > src/luajit-gdb.py | 884 ------------
> > src/luajit_dbg.py | 1281 +++++++++++++++++
> > src/luajit_lldb.py | 1015 -------------
> > .../debug-extension-tests.py | 4 +-
> > 5 files changed, 1283 insertions(+), 1906 deletions(-)
> > delete mode 100644 src/luajit-gdb.py
> > create mode 100644 src/luajit_dbg.py
>
> "autopep8 -i" generates the following patch:
>
> --- a/src/luajit_dbg.py
> +++ b/src/luajit_dbg.py
> @@ -651,7 +651,7 @@ def frame_ftsz(framelink):
>
> def frame_pc(framelink):
> return dbg.cast('BCIns *', frame_ftsz(framelink)) if LJ_FR2 \
> - else mref('BCIns *', framelink['fr']['tp']['pcr'])
> + else mref('BCIns *', framelink['fr']['tp']['pcr'])
>
>
> def frame_prevl(framelink):
>
> Feel free to ignore, but I propose following PEP8 style from the beginning.
This is weird, since flake8 checks PEP8 compliance as well, and it
didn't warn about it.
Fixed, thanks!
===================================================================
diff --git a/src/luajit_dbg.py b/src/luajit_dbg.py
index 164f0955..d9196f06 100644
--- a/src/luajit_dbg.py
+++ b/src/luajit_dbg.py
@@ -651,7 +651,7 @@ def frame_ftsz(framelink):
def frame_pc(framelink):
return dbg.cast('BCIns *', frame_ftsz(framelink)) if LJ_FR2 \
- else mref('BCIns *', framelink['fr']['tp']['pcr'])
+ else mref('BCIns *', framelink['fr']['tp']['pcr'])
def frame_prevl(framelink):
===================================================================
> > delete mode 100644 src/luajit_lldb.py
> >
<snipped>
[1]: https://peps.python.org/pep-0008/#indentation
--
Best regards,
Sergey Kaplun
More information about the Tarantool-patches
mailing list